Skip to content

Commit 9d796e3

Browse files
committed
upgrade
1 parent 5c2f666 commit 9d796e3

5 files changed

Lines changed: 1095 additions & 18 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -82,22 +82,10 @@ jobs:
8282
version: "latest"
8383
enable-cache: false
8484

85-
- name: Install dependencies on Linux and Windows
86-
if: runner.os != 'macOS'
87-
run: |
88-
uv venv
89-
uv pip install setuptools numpy ninja
90-
uv pip install torch --index-url https://download.pytorch.org/whl/nightly/cu128
91-
92-
- name: Install dependencies on macOS
93-
if: runner.os == 'macOS'
94-
run: |
95-
uv venv
96-
uv pip install setuptools numpy ninja
97-
uv pip install torch --index-url https://download.pytorch.org/whl/nightly/cpu
98-
9985
- name: Build wheel
100-
run: uv build --wheel --no-build-isolation
86+
env:
87+
TORCH_CUDA_ARCH_LIST: "7.0;7.5;8.0;8.6;9.0;10.0;12.0+PTX"
88+
run: uv build --wheel
10189

10290
- name: Relabel the Linux wheel
10391
if: runner.os == 'Linux'

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ dist
1010
__pycache__
1111
.python-version
1212
*.so
13-
uv.lock
1413
.vscode

pyproject.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@ authors = [
99
{ name = "CoML", email = "dev@cognitive-ml.fr" },
1010
]
1111
keywords = ["machine learning"]
12+
classifiers = [
13+
"Development Status :: 4 - Beta",
14+
"Intended Audience :: Science/Research",
15+
"Operating System :: OS Independent",
16+
"Programming Language :: C++",
17+
"Programming Language :: Python :: 3 :: Only",
18+
"Programming Language :: Python :: 3.12",
19+
"Programming Language :: Python :: 3.13",
20+
"Programming Language :: Python :: 3.14",
21+
"Topic :: Scientific/Engineering",
22+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
23+
]
1224
dependencies = [
1325
"torch>=2.10.0",
1426
]
@@ -44,6 +56,7 @@ line-length = 119
4456
select = ["ALL"]
4557
ignore = [
4658
"COM812", # missing-trailing-comma
59+
"D107", # undocumented-public-init
4760
"D203", # incorrect-blank-line-before-class
4861
"D213", # multi-line-summary-second-line
4962
"N803", # invalid-argument-name

setup.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,22 @@ def get_flags() -> tuple[list[str], list[str]]:
1919
raise RuntimeError(sys.platform)
2020

2121

22+
class CUDAArchListError(RuntimeError):
23+
"""To raise if CUDA is found and TORCH_CUDA_ARCH_LIST is not set."""
24+
25+
def __init__(self) -> None:
26+
super().__init__(
27+
"You must explicitly set TORCH_CUDA_ARCH_LIST to build from source if CUDA is found.\n"
28+
"Check you supported gpu architectures beforehand.\n"
29+
"For example: TORCH_CUDA_ARCH_LIST='7.0;7.5;8.0;8.6;9.0;10.0;12.0+PTX'"
30+
)
31+
32+
2233
def get_extension() -> Extension:
2334
"""Either CUDA or CPU extension."""
24-
if "TORCH_CUDA_ARCH_LIST" not in os.environ:
25-
os.environ["TORCH_CUDA_ARCH_LIST"] = "7.0;7.5;8.0;8.6;9.0;10.0;12.0+PTX"
2635
use_cuda = CUDA_HOME is not None
36+
if use_cuda and "TORCH_CUDA_ARCH_LIST" not in os.environ:
37+
raise CUDAArchListError
2738
extension = CUDAExtension if use_cuda else CppExtension
2839
sources = ["src/torchdtw/csrc/dtw.cpp"] + (["src/torchdtw/csrc/cuda/dtw.cu"] if use_cuda else [])
2940
compiler_flags, linker_flags = get_flags()

0 commit comments

Comments
 (0)