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
10 changes: 8 additions & 2 deletions .github/actions/install-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ runs:
shell: bash
run: uv venv

# Installed before the other dependencies, so that it also works on Python versions for which
# no stable torch wheel exists yet.
- name: Install torch nightly
if: ${{ inputs.torch_channel == 'nightly' }}
shell: bash
run: uv pip install --pre torch torchvision -P torch -P torchvision --extra-index-url https://download.pytorch.org/whl/nightly/cpu

- name: Install dependencies (options=[${{ inputs.options }}], groups=[${{ inputs.groups }}])
shell: bash
run: |
Expand All @@ -50,9 +57,8 @@ runs:
echo $cmd
eval $cmd

- name: Upgrade to torch nightly
- name: Print torch nightly version
if: ${{ inputs.torch_channel == 'nightly' }}
shell: bash
run: |
uv pip install --pre torch torchvision -P torch -P torchvision --extra-index-url https://download.pytorch.org/whl/nightly/cpu
uv run python -c "import torch, torchvision; print('torch:', torch.__version__, '| torchvision:', torchvision.__version__)"
5 changes: 5 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ jobs:
extra_groups: 'lower_bounds'
# Latest: torch nightly build.
- torch_channel: 'nightly'
# Upcoming Python version, not yet supported by stable torch. cvxpy is excluded because one
# of its dependencies (sparsediffpy) has no wheel yet and can't be built without BLAS.
- python-version: '3.15'
torch_channel: 'nightly'
options: 'quadprog_projector fairgrad'

steps:
- name: Checkout repository
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ worktrees/
CLAUDE.md
.claude/

# Profiling results
tests/profiling/results/
# Profiler results
tests/profiler/results/

# Trajectories results
tests/trajectories/results/
Expand Down
2 changes: 1 addition & 1 deletion tests/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
TORCHJD_DIR = Path(__file__).parent.parent
TESTS_DIR = Path(__file__).parent
PLOTS_RESULTS_DIR = TESTS_DIR / "plots" / "results"
PROFILING_RESULTS_DIR = TESTS_DIR / "profiling" / "results"
PROFILER_RESULTS_DIR = TESTS_DIR / "profiler" / "results"
TRAJECTORIES_RESULTS_DIR = TESTS_DIR / "trajectories" / "results"
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
matplotlib.use("Agg") # Use non-GUI backend to avoid tkinter dependency
import matplotlib.pyplot as plt
import numpy as np
from paths import PROFILING_RESULTS_DIR
from paths import PROFILER_RESULTS_DIR


@dataclass
Expand Down Expand Up @@ -63,7 +63,7 @@ def plot_memory_timelines(experiment: str, folders: list[str]) -> None:
cpu_timelines = []
cuda_timelines = []
for folder in folders:
path = PROFILING_RESULTS_DIR / folder / f"{experiment}.json"
path = PROFILER_RESULTS_DIR / folder / f"{experiment}.json"
cpu_timeline, cuda_timeline = extract_memory_timelines(path)
cpu_timelines.append(cpu_timeline)
cuda_timelines.append(cuda_timeline)
Expand Down Expand Up @@ -104,7 +104,7 @@ def plot_memory_timelines(experiment: str, folders: list[str]) -> None:

fig.tight_layout()

output_dir = Path(PROFILING_RESULTS_DIR / "memory_timelines")
output_dir = Path(PROFILER_RESULTS_DIR / "memory_timelines")
output_dir.mkdir(parents=True, exist_ok=True)
output_path = output_dir / f"{experiment}.png"
print(f"\nSaving plot to: {output_path}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
)
from utils.tensors import make_inputs_and_targets

from tests.paths import PROFILING_RESULTS_DIR
from tests.paths import PROFILER_RESULTS_DIR
from torchjd.aggregation import UPGrad, UPGradWeighting
from torchjd.autogram import Engine

Expand Down Expand Up @@ -98,7 +98,7 @@ def _save_and_print_trace(
batch_size: int,
) -> None:
filename = f"{factory}-bs{batch_size}-{DEVICE.type}.json"
output_dir = PROFILING_RESULTS_DIR / method_name
output_dir = PROFILER_RESULTS_DIR / method_name
output_dir.mkdir(parents=True, exist_ok=True)
trace_path = output_dir / filename

Expand Down
Loading