Skip to content

Commit 1254fc6

Browse files
Merge pull request #25 from NCIC-AlphaSparse/main
gpu ci runner
2 parents d924ec7 + 58d747a commit 1254fc6

6 files changed

Lines changed: 107 additions & 50 deletions

File tree

.github/workflows/gpu-benchmark.yml

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,41 +35,59 @@ on:
3535
jobs:
3636
benchmark:
3737
name: Run GPU benchmark
38-
runs-on:
39-
- self-hosted
40-
- linux
41-
- gpu
42-
timeout-minutes: 90
38+
runs-on: test-flagsparse
39+
timeout-minutes: 360
4340

4441
steps:
4542
- name: Check out repository
4643
uses: actions/checkout@v4
4744

48-
- name: Set up Python
49-
uses: actions/setup-python@v5
50-
with:
51-
python-version: "3.12"
52-
cache: pip
53-
cache-dependency-path: tools/ci/requirements-triton-smoke.lock.txt
45+
- name: Initialize artifact paths
46+
run: mkdir -p benchmark_results
47+
48+
- name: Verify runner Python
49+
run: python3.12 --version
50+
51+
- name: Verify benchmark dependencies
52+
run: |
53+
python3.12 -m pip show build pytest torch
54+
python3.12 - <<'PY'
55+
import build
56+
import pytest
57+
import torch
58+
59+
print("build", getattr(build, "__version__", "unknown"))
60+
print("pytest", pytest.__version__)
61+
print("torch", torch.__version__)
62+
PY
63+
64+
- name: Install FlagTree Triton
65+
shell: bash
66+
run: |
67+
python3.12 -m pip uninstall -y triton
68+
python3.12 -m pip install --upgrade flagtree===0.6.0rc2 \
69+
--index-url=https://resource.flagos.net/repository/flagos-pypi-hosted/simple
70+
python3.12 - <<'PY'
71+
import triton
5472
55-
- name: Install benchmark dependencies
56-
run: python -m pip install --upgrade -r tools/ci/requirements-triton-smoke.lock.txt
73+
print("triton", getattr(triton, "__version__", "unknown"))
74+
PY
5775
5876
- name: Validate CUDA environment
5977
run: |
6078
nvidia-smi
61-
python tools/ci/check_gpu_environment.py \
79+
python3.12 tools/ci/check_gpu_environment.py \
6280
--require-cuda \
6381
--metadata benchmark_results/gpu_metadata.json
6482
6583
- name: Build source and wheel distributions
66-
run: python -m build
84+
run: python3.12 -m build
6785

6886
- name: Install package
69-
run: python -m pip install --force-reinstall --no-deps dist/*.whl
87+
run: python3.12 -m pip install --force-reinstall --no-deps dist/*.whl
7088

7189
- name: Validate installed wheel import
72-
run: python tools/ci/check_installed_wheel.py --expected-version 1.0.0
90+
run: python3.12 tools/ci/check_installed_wheel.py --expected-version 1.0.0
7391

7492
- name: Run GPU performance benchmarks
7593
shell: bash
@@ -88,7 +106,7 @@ jobs:
88106
if [ -n "${{ inputs.benchmark_args }}" ]; then
89107
args+=(--benchmark-args "${{ inputs.benchmark_args }}")
90108
fi
91-
python "${args[@]}"
109+
python3.12 "${args[@]}"
92110
93111
- name: Upload benchmark artifacts
94112
if: always()

.github/workflows/gpu-ci.yml

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,41 +22,61 @@ on:
2222
jobs:
2323
accuracy-smoke:
2424
name: GPU accuracy smoke
25-
runs-on:
26-
- self-hosted
27-
- linux
28-
- gpu
25+
runs-on: test-flagsparse
2926
timeout-minutes: 90
3027

3128
steps:
3229
- name: Check out repository
3330
uses: actions/checkout@v4
3431

35-
- name: Set up Python
36-
uses: actions/setup-python@v5
37-
with:
38-
python-version: "3.12"
39-
cache: pip
40-
cache-dependency-path: tools/ci/requirements-triton-smoke.lock.txt
32+
- name: Initialize artifact paths
33+
run: |
34+
mkdir -p pytest_results
35+
printf '{}\n' > gpu_ci_metadata.json
36+
37+
- name: Verify runner Python
38+
run: python3.12 --version
39+
40+
- name: Verify GPU test dependencies
41+
run: |
42+
python3.12 -m pip show build pytest torch
43+
python3.12 - <<'PY'
44+
import build
45+
import pytest
46+
import torch
47+
48+
print("build", getattr(build, "__version__", "unknown"))
49+
print("pytest", pytest.__version__)
50+
print("torch", torch.__version__)
51+
PY
52+
53+
- name: Install FlagTree Triton
54+
shell: bash
55+
run: |
56+
python3.12 -m pip uninstall -y triton
57+
python3.12 -m pip install --upgrade flagtree===0.6.0rc2 \
58+
--index-url=https://resource.flagos.net/repository/flagos-pypi-hosted/simple
59+
python3.12 - <<'PY'
60+
import triton
4161
42-
- name: Install GPU test dependencies
43-
run: python -m pip install --upgrade -r tools/ci/requirements-triton-smoke.lock.txt
62+
print("triton", getattr(triton, "__version__", "unknown"))
63+
PY
4464
4565
- name: Validate CUDA environment
4666
run: |
4767
nvidia-smi
48-
python tools/ci/check_gpu_environment.py \
68+
python3.12 tools/ci/check_gpu_environment.py \
4969
--require-cuda \
5070
--metadata gpu_ci_metadata.json
5171
5272
- name: Build source and wheel distributions
53-
run: python -m build
73+
run: python3.12 -m build
5474

5575
- name: Install package
56-
run: python -m pip install --force-reinstall --no-deps dist/*.whl
76+
run: python3.12 -m pip install --force-reinstall --no-deps dist/*.whl
5777

5878
- name: Validate installed wheel import
59-
run: python tools/ci/check_installed_wheel.py --expected-version 1.0.0
79+
run: python3.12 tools/ci/check_installed_wheel.py --expected-version 1.0.0
6080

6181
- name: Run GPU accuracy tests
6282
shell: bash
@@ -70,7 +90,7 @@ jobs:
7090
if [ -n "${{ inputs.ops }}" ]; then
7191
args+=(--ops "${{ inputs.ops }}")
7292
fi
73-
python "${args[@]}"
93+
python3.12 "${args[@]}"
7494
7595
- name: Upload GPU CI artifacts
7696
if: always()

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ outputs compare against CPU int32 references.
148148
- `.github/workflows/nightly-cpu.yml` is a `main`-branch-only nightly CPU check that repeats the package, lint, and shared-runtime smoke tests.
149149
- `.github/workflows/release.yml` builds source and wheel artifacts, then attaches them to GitHub Releases on `v*` tags.
150150
- `.github/workflows/triton-smoke.yml` is a manual opt-in job for triton-dependent smoke checks.
151-
- `.github/workflows/gpu-ci.yml` is a manual GPU accuracy smoke workflow for a self-hosted runner labeled `self-hosted`, `linux`, and `gpu`.
152-
- `.github/workflows/gpu-benchmark.yml` adds an Actions button for synthetic GPU benchmark runs on a self-hosted runner labeled `self-hosted`, `linux`, and `gpu`.
151+
- `.github/workflows/gpu-ci.yml` is a manual GPU accuracy smoke workflow that runs on the `test-flagsparse` Actions Runner Controller scale set.
152+
- `.github/workflows/gpu-benchmark.yml` adds an Actions button for synthetic GPU benchmark runs on the `test-flagsparse` Actions Runner Controller scale set.
153153
- `.github/workflows/release-drafter.yml` keeps draft release notes current from merged PRs.
154154
- `make help` lists the local entry points.
155155
- `make ci` / `make check` run the same CPU-only pipeline used by CI.

tests/ci/test_gpu_ci_policy.py

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,53 @@ def _read(path: Path) -> str:
1818
def test_gpu_accuracy_workflow_is_self_hosted_and_manual():
1919
text = _read(WORKFLOWS_DIR / "gpu-ci.yml")
2020
assert "workflow_dispatch:" in text
21-
for label in ["self-hosted", "linux", "gpu"]:
22-
assert f"- {label}" in text
23-
assert 'python-version: "3.12"' in text
24-
assert "tools/ci/requirements-triton-smoke.lock.txt" in text
21+
# Runner scale sets (ARC) must be referenced by name alone in `runs-on`;
22+
# combining it with labels like self-hosted/linux breaks job matching.
23+
assert "runs-on: test-flagsparse" in text
24+
assert "actions/setup-python" not in text
25+
assert "python3.12 --version" in text
26+
assert "$GITHUB_PATH" not in text
27+
assert (
28+
"pip install --upgrade -r tools/ci/requirements-triton-smoke.lock.txt"
29+
not in text
30+
)
31+
assert "python3.12 -m pip show build pytest torch" in text
32+
assert "python3.12 -m pip uninstall -y triton" in text
33+
assert "flagtree===0.6.0rc2" in text
34+
assert "mkdir -p pytest_results" in text
35+
assert "gpu_ci_metadata.json" in text
2536

2637

2738
def test_gpu_accuracy_workflow_checks_cuda_before_tests():
2839
text = _read(WORKFLOWS_DIR / "gpu-ci.yml")
2940
assert "nvidia-smi" in text
3041
assert "tools/ci/check_gpu_environment.py" in text
3142
assert "--require-cuda" in text
32-
assert "pytest" in text
33-
assert "tests/pytest" in text
43+
assert "run_flagsparse_accuracy.py" in text
3444

3545

3646
def test_gpu_benchmark_workflow_uploads_artifacts():
3747
text = _read(WORKFLOWS_DIR / "gpu-benchmark.yml")
38-
assert "self-hosted" in text
39-
assert "gpu" in text
40-
assert "tools/ci/run_gpu_benchmark.py" in text
48+
assert "runs-on: test-flagsparse" in text
49+
assert (
50+
"pip install --upgrade -r tools/ci/requirements-triton-smoke.lock.txt"
51+
not in text
52+
)
53+
assert "python3.12 -m pip show build pytest torch" in text
54+
assert "python3.12 -m pip uninstall -y triton" in text
55+
assert "flagtree===0.6.0rc2" in text
56+
assert "mkdir -p benchmark_results" in text
57+
assert "run_flagsparse_performance.py" in text
4158
assert "matrix_dir:" in text
42-
for suite_name in ["alpha-spmm-alg1", "spmm-opt-alg2", "spgemm", "sddmm"]:
43-
assert suite_name in text
4459
assert "actions/upload-artifact@v4" in text
4560

4661

62+
def test_gpu_dependency_bundle_leaves_triton_to_flagtree():
63+
text = _read(TOOLS_DIR / "requirements-triton-smoke.lock.txt")
64+
assert "torch==2.9.0" in text
65+
assert "triton==" not in text
66+
67+
4768
def test_gpu_environment_check_can_run_without_gpu():
4869
text = _read(TOOLS_DIR / "check_gpu_environment.py")
4970
assert "--require-cuda" in text
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
-r requirements-ci.lock.txt
22
torch==2.9.0
3-
triton==3.6.0
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
-r requirements-ci.txt
22
torch==2.9.0
3-
triton==3.6.0

0 commit comments

Comments
 (0)