8000 Upgrade dependency stack by GeminiLight · Pull Request #54 · GeminiLight/virne · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11']
python-version: ['3.12', '3.13']
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -21,16 +21,22 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Verify dependency lock
if: matrix.python-version == '3.12'
run: |
python -m pip install uv==0.12.3
uv lock --check

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install torch==2.11.0 --index-url https://download.pytorch.org/whl/cpu
python -m pip install torch==2.13.0 --index-url https://download.pytorch.org/whl/cpu
python -m pip install --editable . pytest
python -m pip check

- name: Test installed package
working-directory: /tmp
run: python -c "import importlib.util, gymnasium, torch, torch_geometric, virne; assert gymnasium.__version__ == '1.3.0'; assert torch.__version__.startswith('2.11.'); assert torch_geometric.__version__ == '2.8.0.post1'; assert importlib.util.find_spec('gym') is None"
run: python -c "import importlib.util, gymnasium, torch, torch_geometric, virne; assert gymnasium.__version__ == '1.3.0'; assert torch.__version__.startswith('2.13.'); assert torch_geometric.__version__ == '2.8.0.post1'; assert importlib.util.find_spec('gym') is None"

- name: Run all tests
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# .gitignore
.vscode
.hydra
.venv*/

# cache
*.log
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.10"
python: "3.12"
jobs:
post_install:
- python -m pip install --upgrade pip setuptools
- python -m pip install torch==2.11.0 --index-url https://download.pytorch.org/whl/cpu
- python -m pip install torch==2.13.0 --index-url https://download.pytorch.org/whl/cpu
- python -m pip install --no-build-isolation --editable .
- python -m pip install -r docs/requirements.txt

Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
recursive-include virne/settings/ *.yaml
recursive-include settings *.yaml
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ Virne offers a unified and comprehensive framework for NFV-RA, with the followin
### Installation

The installation script supports CPU environments on Linux and macOS, plus
CUDA 12.6, 12.8, and 13.0 on Linux. Clone the repository, then create and
activate a Python 3.10 or 3.11 environment:
CUDA 12.6, 13.0, and 13.2 on Linux. Clone the repository, then create and
activate a Python 3.12 or newer environment:

```bash
git clone https://github.com/GeminiLight/virne.git
Expand All @@ -107,15 +107,15 @@ source .venv/bin/activate
```

Install either the CPU build or a supported CUDA build. The script defaults to
CPU and installs PyTorch 2.11.0 with PyG 2.8.0.post1. It also installs the
matching optional PyG acceleration wheels without hard-coding the operating
system or Python ABI:
CPU and installs PyTorch 2.13.0 with PyG 2.8.0.post1. It also installs the
matching optional `pyg_lib` acceleration wheel without hard-coding the
operating system or Python ABI:

```bash
# CPU-only PyTorch and PyG
bash install.sh -c cpu

# CUDA 12.6 (use 12.8 or 13.0 when appropriate for your driver and GPU)
# CUDA 12.6 (use 13.0 or 13.2 when appropriate for your driver and GPU)
bash install.sh -c 12.6
```

Expand Down
10 changes: 10 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ Then install the documentation toolchain:
python -m pip install -r docs/requirements.txt
```

For a reproducible CPU development environment, use the committed lock file:

```shell
uv sync --locked --group docs
```

This installs Virne, the test tools, and the documentation toolchain from
`uv.lock`. Use `install.sh` instead when selecting a CUDA build or installing
the optional `pyg_lib` acceleration wheel.

For a documentation-only preview, installing `docs/requirements.txt` is sufficient. Sphinx mocks optional machine-learning and optimization packages; NumPy and PyYAML remain real because Virne uses them while importing the registry and configuration utilities.

Read the Docs performs the project and documentation installation automatically through `.readthedocs.yaml`.
Expand Down
23 changes: 8 additions & 15 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
myst-parser
sphinx-design
sphinx
sphinx-copybutton
numpy
PyYAML
omegaconf
sphinx-press-theme
sphinx-rtd-theme
sphinx-markdown-tables
recommonmark
sphinx-autoapi
sphinx-autobuild
sphinx_autodoc_typehints
furo
sphinx==9.1.0
myst-parser==5.1.0
sphinx-design==0.7.0
sphinx-copybutton==0.5.2
furo==2025.12.19
numpy==2.5.2
PyYAML==6.0.3
omegaconf==2.3.1
2 changes: 1 addition & 1 deletion docs/source/_ext/solver_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# NumPy remains real because Virne calculates positional embeddings at import time.
# The remaining packages are not needed to inspect class metadata or the registry.
MOCK_IMPORTS = [
'colorama',
'colorlog',
'gymnasium',
'matplotlib',
Expand All @@ -22,6 +21,7 @@
'pandas',
'pyg_lib',
'sklearn',
'scipy',
'sympy',
'torch',
'torch_cluster',
Expand Down
17 changes: 8 additions & 9 deletions docs/source/start/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ Installation

.. note::

Virne's RL environments use the ``gymnasium==1.3.0`` API. NumPy remains
capped below 2.0 so that numerical compatibility can be validated in a
separate, reproducible upgrade.
Virne's RL environments use the ``gymnasium==1.3.0`` API. The scientific
stack requires NumPy 2 and Python 3.12 or newer.

Get the Source
--------------
Expand All @@ -26,18 +25,18 @@ Create a Virtual Environment
Install with the Script
-----------------------

The script supports CPU environments on Linux and macOS, plus CUDA 12.6, 12.8,
and 13.0 on Linux. It installs PyTorch 2.11.0, PyG 2.8.0.post1, Gymnasium 1.3.0,
and Virne itself in editable mode. Matching PyG acceleration wheels are selected
for the active platform and Python ABI. Run it from the repository root after
activating a Python 3.10 or 3.11 environment.
The script supports CPU environments on Linux and macOS, plus CUDA 12.6, 13.0,
and 13.2 on Linux. It installs PyTorch 2.13.0, PyG 2.8.0.post1, Gymnasium 1.3.0,
and Virne itself in editable mode. The matching optional ``pyg_lib`` acceleration
wheel is selected for the active platform and Python ABI. Run it from the
repository root after activating a Python 3.12 or newer environment.

.. code-block:: bash

# CPU-only PyTorch and PyG
bash install.sh -c cpu

# CUDA 12.6; 12.8 and 13.0 are also supported
# CUDA 12.6; 13.0 and 13.2 are also supported
bash install.sh -c 12.6

If ``-c`` is omitted, the script installs the CPU build. This explicit default
Expand Down
22 changes: 11 additions & 11 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/usr/bin/env bash
set -euo pipefail

readonly TORCH_VERSION="2.11.0"
readonly TORCH_VERSION="2.13.0"
readonly PYG_VERSION="2.8.0.post1"
readonly SUPPORTED_ACCELERATORS="cpu 12.6 12.8 13.0"
readonly SUPPORTED_ACCELERATORS="cpu 12.6 13.0 13.2"

accelerator="cpu"
virne_python="${VIRNE_PYTHON:-python3}"

usage() {
echo "Usage: $0 [-c cpu|12.6|12.8|13.0]"
echo "Usage: $0 [-c cpu|12.6|13.0|13.2]"
echo "Set VIRNE_PYTHON to choose the Python executable (default: python3)."
}

Expand Down Expand Up @@ -60,14 +60,14 @@ cpu)
torch_index="https://download.pytorch.org/whl/cu126"
pyg_wheel_tag="cu126"
;;
12.8)
torch_index="https://download.pytorch.org/whl/cu128"
pyg_wheel_tag="cu128"
;;
13.0)
torch_index="https://download.pytorch.org/whl/cu130"
pyg_wheel_tag="cu130"
;;
13.2)
torch_index="https://download.pytorch.org/whl/cu132"
pyg_wheel_tag="cu132"
;;
esac

echo "Installing Virne with PyTorch ${TORCH_VERSION}, PyG ${PYG_VERSION}, accelerator ${accelerator}."
Expand All @@ -82,12 +82,12 @@ fi
# pyproject.toml is the source of truth for PyG and all remaining dependencies.
"${virne_python}" -m pip install --editable .

# PyG can run without compiled extensions, but Virne installs the supported
# acceleration and SparseTensor packages. Remove old wheels first because their
# version numbers do not encode the PyTorch ABI they were compiled against.
# PyG C629 can run without compiled extensions. Remove old wheels first because their
# version numbers do not encode the PyTorch ABI they were compiled against, then
# install the extension currently published for PyTorch 2.13.
"${virne_python}" -m pip uninstall --yes \
pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv
"${virne_python}" -m pip install pyg_lib torch_scatter torch_sparse \
"${virne_python}" -m pip install pyg_lib \
--find-links "https://data.pyg.org/whl/torch-${TORCH_VERSION}+${pyg_wheel_tag}.html"

"${virne_python}" -c \
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@



@hydra.main(config_path="settings", config_name="main")
@hydra.main(version_base="1.3", config_path="settings", config_name="main")
def run(config):
print(f"\n{'-' * 20} Start {'-' * 20}\n")
# ---- Before running the simulation ---- #
Expand Down
Loading
Loading
0