Skip to content
Draft
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
4 changes: 4 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ jobs:
torch_version: "2.10"
- torch_group: torch_2_11
torch_version: "2.11"
- torch_group: torch_2_12
torch_version: "2.12"
- torch_group: torch_2_13
torch_version: "2.13"
steps:
- name: Check out repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ VENV_TUTORIAL ?= .venv-tutorial
# The torch_2_* groups (pyproject.toml [dependency-groups]) currently at
# each end of the supported range. Bump these two lines — nothing else —
# when the project's torch version bounds change.
HIGHEST_TORCH_GROUP := torch_2_11
HIGHEST_TORCH_GROUP := torch_2_13
LOWEST_TORCH_GROUP := torch_2_8

# Torch dependency group (pyproject.toml [dependency-groups]) that every
Expand Down
1 change: 1 addition & 0 deletions changelog.d/64.added
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added support for PyTorch 2.12 and 2.13.
33 changes: 26 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ dependencies = [
# based on other package versions. We can either 1) add a stricter check to require the newer torchao
# version for everyone, or 2) add a runtime check in src/coreai_opt/init.py to ensure torchao
# version >= 0.15.0 for torch version >= 2.9.0. Opting option 1.
# These torch versions must be in bounds of torch_2_8, torch_2_9, torch_2_10, and torch_2_11
"torch>=2.8.0,<=2.11.0",
# These torch versions must be in bounds of torch_2_8, torch_2_9, torch_2_10, torch_2_11,
# torch_2_12, and torch_2_13
"torch>=2.8.0,<=2.13.0",
"torchao>=0.15.0,<=0.17.0",
"tqdm>=4.65",
]
Expand All @@ -56,7 +57,10 @@ name = "Apple Core AI Optimization Team"
[project.optional-dependencies]
coreai = [
"coreai-core==1.0.0b2",
"coreai-torch==0.4.1",
# TODO: Pin back to a released version once coreai-torch cuts a release past
# 0.4.1 (2026-07-01). main already dropped the torch<=2.13.0 ceiling
# (apple/coreai-torch#38, #39) that blocks torch_2_12/torch_2_13 below.
"coreai-torch",
"scikit-learn>=1.7.2",
]
coreml = [
Expand Down Expand Up @@ -141,6 +145,16 @@ torch_2_11 = [
"torchao==0.17.0",
"torchvision==0.26.0",
]
torch_2_12 = [
"torch==2.12.1",
"torchao==0.17.0",
"torchvision==0.27.1",
]
torch_2_13 = [
"torch==2.13.0",
"torchao==0.17.0",
"torchvision==0.28.0",
]
torch_2_8 = [
"torch==2.8.0",
"torchao==0.15.0",
Expand All @@ -154,7 +168,7 @@ torch_2_9 = [
# Since torch and torchao are project dependencies, we need to include torchvision in dev
# This allows standard `make test` to find torchvision
torchvision = [
"torchvision>=0.23.0,<=0.26.0",
"torchvision>=0.23.0,<=0.28.0",
]
tutorial = [
"ipykernel>=7.2.0",
Expand Down Expand Up @@ -182,7 +196,7 @@ find.where = [ "src" ]
default-groups = [ "dev", "coreai", "coreml" ]
index = [
{ explicit = true, name = "pytorch-cpu", url = "https://download.pytorch.org/whl/cpu" },
{ explicit = true, name = "pytorch-cu128", url = "https://download.pytorch.org/whl/cu128" },
{ explicit = true, name = "pytorch-cu129", url = "https://download.pytorch.org/whl/cu129" },
]
# Only resolve for platforms where all dependencies (including coreai) exist
environments = [
Expand All @@ -201,16 +215,21 @@ conflicts = [
{ group = "torch_2_9" },
{ group = "torch_2_10" },
{ group = "torch_2_11" },
{ group = "torch_2_12" },
{ group = "torch_2_13" },
],
]
[tool.uv.sources]
# TODO: Remove once coreai-torch cuts a release past 0.4.1 that includes the

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove git+ssh installation of coreai-torch once new release comes out

# torch<=2.13.0 ceiling removal from apple/coreai-torch#38/#39.
coreai-torch = { git = "https://github.com/apple/coreai-torch", rev = "c89f6a44713249a12a84beec9f3e0cf2206ecc38" }
torch = [
{ index = "pytorch-cpu", marker = "sys_platform != 'linux'" },
{ index = "pytorch-cu128", marker = "sys_platform == 'linux'" },
{ index = "pytorch-cu129", marker = "sys_platform == 'linux'" },
]
torchvision = [
{ index = "pytorch-cpu", marker = "sys_platform != 'linux'" },
{ index = "pytorch-cu128", marker = "sys_platform == 'linux'" },
{ index = "pytorch-cu129", marker = "sys_platform == 'linux'" },
]

[tool.ruff]
Expand Down
5 changes: 3 additions & 2 deletions scripts/make/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ ENSURE_MODE=false

# Groups excluded from --all-groups due to mutual conflicts in pyproject.toml.
# tamm-export is omitted because it's opt-in only (never in default-groups or --all-groups).
CONFLICTING_GROUPS=("torch_2_8" "torch_2_9" "torch_2_10" "torch_2_11")
CONFLICTING_GROUPS=("torch_2_8" "torch_2_9" "torch_2_10"
"torch_2_11" "torch_2_12" "torch_2_13")

show_help() {
echo "Usage: $0 [OPTIONS]"
Expand All @@ -136,7 +137,7 @@ show_help() {
echo " $0 --python-version 3.11 # Setup with dev group only"
echo " $0 --python-version 3.11 --with-docs # Setup with dev and docs groups"
echo " $0 --python-version 3.11 --all-groups # Setup with all non-conflicting groups"
echo " TORCH_GROUP=torch_2_11 $0 --python-version 3.11 --all-groups # Setup with all groups and torch 2.11"
echo " TORCH_GROUP=torch_2_13 $0 --python-version 3.11 --all-groups # Setup with all groups and torch 2.13"
echo " TORCH_GROUP=torch_2_8 $0 --python-version 3.11 --all-groups # Setup with all groups and torch 2.8"
echo " $0 --python-version 3.11 --venv .venv-exp # Setup with custom venv name"
echo " $0 --python-version 3.11 --with-docs --venv .venv-exp # Setup with docs group and custom venv name"
Expand Down