Skip to content

Commit c1ac8d0

Browse files
authored
[CI] Upgrade CI envs to torch~=2.7.0 (#450)
1 parent fd0d54b commit c1ac8d0

File tree

7 files changed

+144
-24
lines changed

7 files changed

+144
-24
lines changed

.github/workflows/intel-a770.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,11 @@ jobs:
6262
- name: Setup python
6363
if: steps.find-dependent-tests.outputs.test_files && steps.check_skip.outputs.skip_tests == 'false'
6464
run: |
65+
pip install -U uv
6566
pip uninstall -y flash-linear-attention
66-
pip install -U pytest setuptools wheel ninja
67-
pip install -U torch pytorch-triton-xpu --index-url https://download.pytorch.org/whl/xpu
68-
pip install --no-use-pep517 .
67+
uv pip install -U pytest setuptools wheel ninja
68+
uv pip install -U torch~=2.7.0 pytorch-triton-xpu --index-url https://download.pytorch.org/whl/xpu
69+
pip install .
6970
7071
- name: Check GPU status
7172
if: steps.find-dependent-tests.outputs.test_files && steps.check_skip.outputs.skip_tests == 'false'
@@ -83,15 +84,13 @@ jobs:
8384
pytest ${{ steps.find-dependent-tests.outputs.test_files }}
8485
8586
- name: Run pytest on test files
86-
continue-on-error: true
8787
if: steps.find-dependent-tests.outputs.test_files && steps.check_skip.outputs.skip_tests == 'false'
8888
run: |
8989
FLA_COMPILER_MODE=0 TRITON_PRINT_AUTOTUNING=0 SKIP_TEST_CHUNK_VARLEN=1 \
9090
pytest ${{ steps.find-dependent-tests.outputs.test_files }}
9191
9292
- name: Run pytest on varlen test files
9393
if: steps.find-dependent-tests.outputs.test_files && steps.check_skip.outputs.skip_tests == 'false'
94-
continue-on-error: true
9594
run: |
9695
FLA_COMPILER_MODE=0 TRITON_PRINT_AUTOTUNING=0 SKIP_TEST_CHUNK_VARLEN=0 \
9796
pytest ${{ steps.find-dependent-tests.outputs.test_files }} || \
@@ -105,14 +104,12 @@ jobs:
105104
106105
# skip full pytest because it takes too long
107106
- name: Run full pytest on test files
108-
continue-on-error: true
109107
if: false && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && steps.check_skip.outputs.skip_tests == 'false'
110108
run: |
111109
FLA_COMPILER_MODE=0 TRITON_PRINT_AUTOTUNING=0 SKIP_TEST_CHUNK_VARLEN=1 \
112110
pytest ${{ steps.find-dependent-tests.outputs.test_files }}
113111
114112
- name: Run full pytest on varlen test files
115-
continue-on-error: true
116113
if: false && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && steps.check_skip.outputs.skip_tests == 'false'
117114
run: |
118115
FLA_COMPILER_MODE=0 TRITON_PRINT_AUTOTUNING=0 SKIP_TEST_CHUNK_VARLEN=0 \

.github/workflows/nvidia-4090.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,12 @@ jobs:
6767
# pip install -U pytest setuptools wheel ninja torch triton
6868
# MAX_JOBS=4 pip install -U flash-attn --no-build-isolation
6969
# pip install git+https://github.com/Dao-AILab/causal-conv1d.git --no-build-isolation
70-
pip install --no-use-pep517 .
70+
pip install -U uv
71+
pip uninstall -y flash-linear-attention
72+
uv pip install git+https://github.com/Dao-AILab/causal-conv1d.git -U --no-cache-dir --no-build-isolation
73+
uv pip install flash-attn -U --no-cache-dir --no-build-isolation
74+
uv pip install torch~=2.7.0 triton pytest setuptools wheel ninja -U --index-url https://download.pytorch.org/whl/cu128
75+
pip install .
7176
7277
- name: Check GPU status
7378
if: steps.find-dependent-tests.outputs.test_files && steps.check_skip.outputs.skip_tests == 'false'
@@ -85,15 +90,13 @@ jobs:
8590
pytest ${{ steps.find-dependent-tests.outputs.test_files }}
8691
8792
- name: Run pytest on test files
88-
continue-on-error: true
8993
if: steps.find-dependent-tests.outputs.test_files && steps.check_skip.outputs.skip_tests == 'false'
9094
run: |
9195
FLA_COMPILER_MODE=0 TRITON_PRINT_AUTOTUNING=0 SKIP_TEST_CHUNK_VARLEN=1 \
9296
pytest ${{ steps.find-dependent-tests.outputs.test_files }}
9397
9498
- name: Run pytest on varlen test files
9599
if: steps.find-dependent-tests.outputs.test_files && steps.check_skip.outputs.skip_tests == 'false'
96-
continue-on-error: true
97100
run: |
98101
FLA_COMPILER_MODE=0 TRITON_PRINT_AUTOTUNING=0 SKIP_TEST_CHUNK_VARLEN=0 \
99102
pytest ${{ steps.find-dependent-tests.outputs.test_files }} || \
@@ -106,14 +109,12 @@ jobs:
106109
pytest tests/
107110
108111
- name: Run full pytest on test files
109-
continue-on-error: true
110112
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && steps.check_skip.outputs.skip_tests == 'false'
111113
run: |
112114
FLA_COMPILER_MODE=0 TRITON_PRINT_AUTOTUNING=0 SKIP_TEST_CHUNK_VARLEN=1 \
113115
pytest ${{ steps.find-dependent-tests.outputs.test_files }}
114116
115117
- name: Run full pytest on varlen test files
116-
continue-on-error: true
117118
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && steps.check_skip.outputs.skip_tests == 'false'
118119
run: |
119120
FLA_COMPILER_MODE=0 TRITON_PRINT_AUTOTUNING=0 SKIP_TEST_CHUNK_VARLEN=0 \

.github/workflows/nvidia-a100.yml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: nvidia-a100-ci
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
5+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
6+
7+
on:
8+
pull_request:
9+
branches: [ '*' ]
10+
types: [opened, synchronize, reopened, closed]
11+
push:
12+
branches:
13+
- main
14+
tags:
15+
- '*'
16+
17+
jobs:
18+
test:
19+
if: github.event_name != 'pull_request' || github.event.action != 'closed'
20+
runs-on: 'nvidia-a100'
21+
env:
22+
FLA_CI_ENV: 1
23+
steps:
24+
- name: Check out repo
25+
uses: actions/checkout@v4
26+
27+
- name: Check skip keyword in LATEST commit (Push only)
28+
id: check_skip
29+
run: |
30+
if [ "${{ github.event_name }}" = "push" ] && ! [[ "${{ github.ref }}" =~ ^refs/tags/ ]]; then
31+
COMMIT_MSG=$(jq -r '.head_commit.message' <<< '${{ toJSON(github.event) }}')
32+
echo "Latest commit message: $COMMIT_MSG"
33+
if echo "$COMMIT_MSG" | grep -qF "[skip test]"; then
34+
echo "::notice::Tests skipped by commit message"
35+
echo "skip_tests=true" >> $GITHUB_OUTPUT
36+
else
37+
echo "skip_tests=false" >> $GITHUB_OUTPUT
38+
fi
39+
else
40+
echo "skip_tests=false" >> $GITHUB_OUTPUT
41+
fi
42+
43+
- name: Get changed files
44+
if: |
45+
(github.event_name == 'pull_request' ||
46+
(github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/'))) &&
47+
(steps.check_skip.outputs.skip_tests != 'true' || github.event_name != 'push')
48+
id: changed-files
49+
uses: tj-actions/[email protected]
50+
51+
- name: Find dependent test files
52+
if: |
53+
(github.event_name == 'pull_request' ||
54+
(github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/'))) &&
55+
(steps.check_skip.outputs.skip_tests != 'true' || github.event_name != 'push')
56+
id: find-dependent-tests
57+
run: |
58+
# Run the Python script to find dependent test files
59+
TEST_FILES=$(python scripts/find_dependent_tests.py "${{ steps.changed-files.outputs.all_changed_files }}")
60+
echo "test_files=$TEST_FILES" >> $GITHUB_OUTPUT
61+
62+
- name: Setup python
63+
if: steps.find-dependent-tests.outputs.test_files && steps.check_skip.outputs.skip_tests == 'false'
64+
run: |
65+
# Installed by hand to avoid issues with pip
66+
# pip install -U pytest setuptools wheel ninja torch triton
67+
# MAX_JOBS=4 pip install -U flash-attn --no-build-isolation
68+
# pip install git+https://github.com/Dao-AILab/causal-conv1d.git --no-build-isolation
69+
pip install -U uv
70+
pip uninstall -y flash-linear-attention
71+
uv pip install git+https://github.com/Dao-AILab/causal-conv1d.git -U --no-cache-dir --no-build-isolation
72+
uv pip install flash-attn -U --no-cache-dir --no-build-isolation
73+
uv pip install torch~=2.7.0 triton pytest setuptools wheel ninja -U --index-url https://download.pytorch.org/whl/cu128
74+
pip install .
75+
76+
- name: Check GPU status
77+
if: steps.find-dependent-tests.outputs.test_files && steps.check_skip.outputs.skip_tests == 'false'
78+
run: |
79+
python scripts/check_gpu.py
80+
if [ $? -ne 0 ]; then
81+
echo "GPU is occupied. Stopping the workflow."
82+
exit 1
83+
fi
84+
85+
- name: Test compiling on changed test files
86+
if: steps.find-dependent-tests.outputs.test_files && steps.check_skip.outputs.skip_tests == 'false'
87+
run: |
88+
FLA_COMPILER_MODE=1 TRITON_PRINT_AUTOTUNING=0 SKIP_TEST_CHUNK_VARLEN=1 \
89+
pytest ${{ steps.find-dependent-tests.outputs.test_files }}
90+
91+
- name: Run pytest on test files
92+
if: steps.find-dependent-tests.outputs.test_files && steps.check_skip.outputs.skip_tests == 'false'
93+
run: |
94+
FLA_COMPILER_MODE=0 TRITON_PRINT_AUTOTUNING=0 SKIP_TEST_CHUNK_VARLEN=1 \
95+
pytest ${{ steps.find-dependent-tests.outputs.test_files }}
96+
97+
- name: Run pytest on varlen test files
98+
if: steps.find-dependent-tests.outputs.test_files && steps.check_skip.outputs.skip_tests == 'false'
99+
run: |
100+
FLA_COMPILER_MODE=0 TRITON_PRINT_AUTOTUNING=0 SKIP_TEST_CHUNK_VARLEN=0 \
101+
pytest ${{ steps.find-dependent-tests.outputs.test_files }} || \
102+
echo "Varlen tests failed (non-critical)"
103+
104+
- name: Test full compiling on all test files
105+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && steps.check_skip.outputs.skip_tests == 'false'
106+
run: |
107+
FLA_COMPILER_MODE=1 TRITON_PRINT_AUTOTUNING=0 SKIP_TEST_CHUNK_VARLEN=1 \
108+
pytest tests/
109+
110+
- name: Run full pytest on test files
111+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && steps.check_skip.outputs.skip_tests == 'false'
112+
run: |
113+
FLA_COMPILER_MODE=0 TRITON_PRINT_AUTOTUNING=0 SKIP_TEST_CHUNK_VARLEN=1 \
114+
pytest ${{ steps.find-dependent-tests.outputs.test_files }}
115+
116+
- name: Run full pytest on varlen test files
117+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && steps.check_skip.outputs.skip_tests == 'false'
118+
run: |
119+
FLA_COMPILER_MODE=0 TRITON_PRINT_AUTOTUNING=0 SKIP_TEST_CHUNK_VARLEN=0 \
120+
pytest ${{ steps.find-dependent-tests.outputs.test_files }} || \
121+
echo "Varlen tests failed (non-critical)"

.github/workflows/nvidia-h100.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,16 @@ jobs:
6262
- name: Setup python
6363
if: steps.find-dependent-tests.outputs.test_files && steps.check_skip.outputs.skip_tests == 'false'
6464
run: |
65-
pip uninstall -y flash-linear-attention
6665
# Installed by hand to avoid issues with pip
6766
# pip install -U pytest setuptools wheel ninja torch triton
6867
# MAX_JOBS=4 pip install -U flash-attn --no-build-isolation
6968
# pip install git+https://github.com/Dao-AILab/causal-conv1d.git --no-build-isolation
70-
pip install --no-use-pep517 .
69+
pip install -U uv
70+
pip uninstall -y flash-linear-attention
71+
uv pip install git+https://github.com/Dao-AILab/causal-conv1d.git -U --no-cache-dir --no-build-isolation
72+
uv pip install flash-attn -U --no-cache-dir --no-build-isolation
73+
uv pip install torch~=2.7.0 triton pytest setuptools wheel ninja -U --index-url https://download.pytorch.org/whl/cu128
74+
pip install .
7175
7276
- name: Check GPU status
7377
if: steps.find-dependent-tests.outputs.test_files && steps.check_skip.outputs.skip_tests == 'false'
@@ -85,15 +89,13 @@ jobs:
8589
pytest ${{ steps.find-dependent-tests.outputs.test_files }}
8690
8791
- name: Run pytest on test files
88-
continue-on-error: true
8992
if: steps.find-dependent-tests.outputs.test_files && steps.check_skip.outputs.skip_tests == 'false'
9093
run: |
9194
FLA_COMPILER_MODE=0 TRITON_PRINT_AUTOTUNING=0 SKIP_TEST_CHUNK_VARLEN=1 \
9295
pytest ${{ steps.find-dependent-tests.outputs.test_files }}
9396
9497
- name: Run pytest on varlen test files
9598
if: steps.find-dependent-tests.outputs.test_files && steps.check_skip.outputs.skip_tests == 'false'
96-
continue-on-error: true
9799
run: |
98100
FLA_COMPILER_MODE=0 TRITON_PRINT_AUTOTUNING=0 SKIP_TEST_CHUNK_VARLEN=0 \
99101
pytest ${{ steps.find-dependent-tests.outputs.test_files }} || \
@@ -106,14 +108,12 @@ jobs:
106108
pytest tests/
107109
108110
- name: Run full pytest on test files
109-
continue-on-error: true
110111
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && steps.check_skip.outputs.skip_tests == 'false'
111112
run: |
112113
FLA_COMPILER_MODE=0 TRITON_PRINT_AUTOTUNING=0 SKIP_TEST_CHUNK_VARLEN=1 \
113114
pytest ${{ steps.find-dependent-tests.outputs.test_files }}
114115
115116
- name: Run full pytest on varlen test files
116-
continue-on-error: true
117117
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && steps.check_skip.outputs.skip_tests == 'false'
118118
run: |
119119
FLA_COMPILER_MODE=0 TRITON_PRINT_AUTOTUNING=0 SKIP_TEST_CHUNK_VARLEN=0 \

FAQs.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ conda create -n triton-nightly python=3.12
2323
conda activate triton-nightly
2424

2525
# Install PyTorch nightly (required for Triton nightly compatibility)
26-
pip install -U --pre torch --index-url https://download.pytorch.org/whl/nightly/cu126
26+
pip install -U --pre torch --index-url https://download.pytorch.org/whl/nightly/cu128
2727

2828
# Install Triton nightly
2929
pip uninstall triton pytorch-triton -y
@@ -34,8 +34,9 @@ pip install einops ninja datasets transformers numpy
3434
pip uninstall flash-linear-attention && pip install -U --no-use-pep517 git+https://github.com/fla-org/flash-linear-attention --no-deps
3535

3636
# Optional: Install flash-attention
37-
conda install nvidia/label/cuda-12.6.3::cuda-nvcc
37+
conda install nvidia/label/cuda-12.8.1::cuda-nvcc
3838
pip install packaging psutil ninja
39+
pip install git+https://github.com/Dao-AILab/causal-conv1d.git --no-build-isolation
3940
pip install flash-attn --no-deps --no-cache-dir --no-build-isolation
4041

4142
# Optional: Verify flash-attention installation

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Roughly sorted according to the timeline supported in `fla`. The recommended tra
7676

7777
## Installation
7878

79-
[![nvidia-4090-ci](https://github.com/fla-org/flash-linear-attention/actions/workflows/nvidia-4090.yml/badge.svg?branch=main&event=push)](https://github.com/fla-org/flash-linear-attention/actions/workflows/nvidia-4090.yml) [![nvidia-h100-ci](https://github.com/fla-org/flash-linear-attention/actions/workflows/nvidia-h100.yml/badge.svg?branch=main&event=push)](https://github.com/fla-org/flash-linear-attention/actions/workflows/nvidia-h100.yml) [![intel-a770-ci](https://github.com/fla-org/flash-linear-attention/actions/workflows/intel-a770.yml/badge.svg?event=push)](https://github.com/fla-org/flash-linear-attention/actions/workflows/intel-a770.yml)
79+
[![nvidia-4090-ci](https://github.com/fla-org/flash-linear-attention/actions/workflows/nvidia-4090.yml/badge.svg?branch=main&event=push)](https://github.com/fla-org/flash-linear-attention/actions/workflows/nvidia-4090.yml) [![nvidia-a100-ci](https://github.com/fla-org/flash-linear-attention/actions/workflows/nvidia-a100.yml/badge.svg?branch=main)](https://github.com/fla-org/flash-linear-attention/actions/workflows/nvidia-a100.yml) [![nvidia-h100-ci](https://github.com/fla-org/flash-linear-attention/actions/workflows/nvidia-h100.yml/badge.svg?branch=main&event=push)](https://github.com/fla-org/flash-linear-attention/actions/workflows/nvidia-h100.yml) [![intel-a770-ci](https://github.com/fla-org/flash-linear-attention/actions/workflows/intel-a770.yml/badge.svg?event=push)](https://github.com/fla-org/flash-linear-attention/actions/workflows/intel-a770.yml)
8080

8181
The following requirements should be satisfied
8282
- [PyTorch](https://pytorch.org/) >= 2.5
@@ -88,12 +88,12 @@ The following requirements should be satisfied
8888

8989
You can install `fla` with pip:
9090
```sh
91-
pip install --no-use-pep517 flash-linear-attention
91+
pip install flash-linear-attention
9292
```
9393
As `fla` is actively developed now, for the latest features and updates, an alternative way is to install the package from source
9494
```sh
9595
# uninstall `fla` first to ensure a successful upgrade
96-
pip uninstall flash-linear-attention && pip install -U --no-use-pep517 git+https://github.com/fla-org/flash-linear-attention
96+
pip uninstall flash-linear-attention && pip install -U git+https://github.com/fla-org/flash-linear-attention
9797
```
9898
or manage `fla` with submodules
9999
```sh

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ dev = ["pytest"]
3131
Homepage = "https://github.com/fla-org/flash-linear-attention"
3232

3333
[build-system]
34-
requires = ["setuptools>=45", "wheel", "ninja", "torch"]
34+
requires = ["setuptools>=45", "wheel"]
3535

3636
[tool.isort]
3737
line_length = 127

0 commit comments

Comments
 (0)