There was an error while loading. Please reload this page.
1 parent 5c2f666 commit 9d796e3Copy full SHA for 9d796e3
5 files changed
.github/workflows/release.yml
@@ -82,22 +82,10 @@ jobs:
82
version: "latest"
83
enable-cache: false
84
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
95
96
97
- uv pip install torch --index-url https://download.pytorch.org/whl/nightly/cpu
98
99
- name: Build wheel
100
- run: uv build --wheel --no-build-isolation
+ env:
+ TORCH_CUDA_ARCH_LIST: "7.0;7.5;8.0;8.6;9.0;10.0;12.0+PTX"
+ run: uv build --wheel
101
102
- name: Relabel the Linux wheel
103
if: runner.os == 'Linux'
.gitignore
@@ -10,5 +10,4 @@ dist
10
__pycache__
11
.python-version
12
*.so
13
-uv.lock
14
.vscode
pyproject.toml
@@ -9,6 +9,18 @@ authors = [
9
{ name = "CoML", email = "dev@cognitive-ml.fr" },
]
keywords = ["machine learning"]
+classifiers = [
+ "Development Status :: 4 - Beta",
+ "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
+]
24
dependencies = [
25
"torch>=2.10.0",
26
@@ -44,6 +56,7 @@ line-length = 119
44
56
select = ["ALL"]
45
57
ignore = [
46
58
"COM812", # missing-trailing-comma
59
+ "D107", # undocumented-public-init
47
60
"D203", # incorrect-blank-line-before-class
48
61
"D213", # multi-line-summary-second-line
49
62
"N803", # invalid-argument-name
setup.py
@@ -19,11 +19,22 @@ def get_flags() -> tuple[list[str], list[str]]:
raise RuntimeError(sys.platform)
+class CUDAArchListError(RuntimeError):
+ """To raise if CUDA is found and TORCH_CUDA_ARCH_LIST is not set."""
+
+ def __init__(self) -> None:
+ 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
33
def get_extension() -> Extension:
34
"""Either CUDA or CPU extension."""
- if "TORCH_CUDA_ARCH_LIST" not in os.environ:
- os.environ["TORCH_CUDA_ARCH_LIST"] = "7.0;7.5;8.0;8.6;9.0;10.0;12.0+PTX"
35
use_cuda = CUDA_HOME is not None
36
+ if use_cuda and "TORCH_CUDA_ARCH_LIST" not in os.environ:
37
+ raise CUDAArchListError
38
extension = CUDAExtension if use_cuda else CppExtension
39
sources = ["src/torchdtw/csrc/dtw.cpp"] + (["src/torchdtw/csrc/cuda/dtw.cu"] if use_cuda else [])
40
compiler_flags, linker_flags = get_flags()
0 commit comments