Skip to content

Commit f218fa1

Browse files
authored
[57] Pinning flash-attention and other dependencies (ecmwf#75)
* work * work * changes * changes * reset * removing flash from install
1 parent b0c72a9 commit f218fa1

File tree

3 files changed

+193
-52
lines changed

3 files changed

+193
-52
lines changed

INSTALL.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@
1010
%>cd WeatherGenerator
1111
%>uv sync
1212
13-
# install flash_attn which is not uv compatible
14-
# (this step might take very long, it is faster when ninja is available but then
15-
# MAX_JOBS=4 should be set as environment variable; the step might need to be run
16-
# on a compute node to ensure the correct CUDA environment is available)
17-
%>uv pip install torch
18-
%>uv pip install flash_attn --no-build-isolation
1913
2014
%>uv run train
2115
```

pyproject.toml

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,21 @@ authors = [
99

1010
requires-python = ">=3.11,<3.13"
1111
# TODO: split the plotting dependencies into their own dep groups, they are not required.
12-
dependencies = [ 'torch',
13-
'numpy',
14-
'astropy_healpix',
15-
'zarr',
16-
'anemoi-datasets',
17-
'pandas',
18-
'pynvml',
19-
'tqdm',
20-
'matplotlib',
21-
'packaging',
22-
'wheel',
23-
'psutil']
12+
dependencies = [
13+
'torch==2.6.0',
14+
'numpy~=2.2',
15+
'astropy_healpix~=1.0',
16+
'zarr~=2.17',
17+
'anemoi-datasets~=0.5',
18+
'pandas~=2.2',
19+
'pynvml',
20+
'tqdm',
21+
'matplotlib',
22+
'packaging',
23+
'wheel',
24+
'psutil',
25+
"flash-attn",
26+
]
2427

2528
[project.urls]
2629
Homepage = "https://www.weathergenerator.eu"
@@ -91,4 +94,25 @@ ignore = [
9194
"F811",
9295
# To ignore, not relevant for us
9396
"E741",
94-
]
97+
]
98+
99+
[tool.uv]
100+
# This guarantees that the build is deterministic and will not be impacted
101+
# by future releases of dependencies or sub-dependencies.
102+
# See https://docs.astral.sh/uv/reference/settings/#exclude-newer
103+
# TODO: pytorch does not publish valid release timestamps, so sadly it does not work.
104+
# exclude-newer = "2025-03-14T00:00:00Z"
105+
106+
# Following the recommendations from https://docs.astral.sh/uv/guides/integration/pytorch
107+
[[tool.uv.index]]
108+
name = "pytorch-cu124"
109+
url = "https://download.pytorch.org/whl/cu124"
110+
explicit = true
111+
112+
[tool.uv.sources]
113+
torch = [
114+
{ index = "pytorch-cu124", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
115+
]
116+
# This URL was evaluated this way:
117+
# uv run ~/WeatherGenerator-private/hpc/hpc2020/ecmwf/get-flash-atten.sh
118+
flash-attn = { url = "https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.4.post1/flash_attn-2.7.4.post1+cu12torch2.6cxx11abiFALSE-cp312-cp312-linux_x86_64.whl" }

0 commit comments

Comments
 (0)