Repository navigation
98 lines (91 loc) · 3.77 KB
/
Copy pathci.yml
File metadata and controls
98 lines (91 loc) · 3.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: CI
on:
push:
branches: [dev, main]
pull_request:
jobs:
lint:
name: ruff (lint)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- run: pip install ruff==0.15.21
- run: ruff check src tests
base-install:
name: base install (dataset registry only)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
# The base install must stay lightweight (pyyaml only) and the dataset
# registry importable without the benchmark stack — bitmind-subnet
# depends on this contract. This job fails if anyone adds an eager
# heavy import to the registry path or a heavy dep to base deps.
- run: pip install . pytest
# Checkpoint recovery is CPU-only and must not require the ML extras.
- run: pytest tests/unit/test_checkpoint.py
- run: |
python - <<'EOF'
from gasbench.dataset.config import load_benchmark_datasets_from_yaml
data = load_benchmark_datasets_from_yaml()
assert data.get("image") and data.get("video"), "registry came back empty"
print({k: len(v) for k, v in data.items()})
import gasbench
try:
gasbench.run_benchmark
raise SystemExit("benchmark stack importable in base install — heavy dep leaked into base")
except ImportError as e:
assert "gasbench[gpu]" in str(e)
import importlib.metadata as im
dists = sorted(d.metadata["Name"].lower() for d in im.distributions())
heavy = {"torch", "onnxruntime", "onnxruntime-gpu", "transformers", "timm", "modelscope"}
leaked = heavy & set(dists)
assert not leaked, f"heavy deps in base install: {leaked}"
print("base install contract holds:", dists)
EOF
# Recorder recovery shares the existing metrics and parquet paths, without
# loading torch or the inference backends (same lazy-import policy).
- run: pip install numpy pandas pyarrow
- run: pytest tests/unit/test_recorder_checkpoint.py
benchmark-resume:
name: benchmark interruption recovery (CPU)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
# Use the project's versions, with CPU wheels for the inference tests.
- run: |
python - <<'EOF'
import subprocess, sys, tomllib
with open("pyproject.toml", "rb") as f:
requirements = tomllib.load(f)["project"]["optional-dependencies"]["gpu"]
cpu = [r for r in requirements if r.split("==")[0] in {"torch", "torchvision", "torchaudio"}]
subprocess.check_call([sys.executable, "-m", "pip", "install", *cpu,
"--index-url", "https://download.pytorch.org/whl/cpu"])
EOF
- run: pip install '.[gpu]' pytest
- name: Install audio decoder for the worker integration test
run: sudo apt-get update && sudo apt-get install -y ffmpeg
# Run all offline tests; the slow network smoke checks remain opt-in.
- run: pytest
typecheck:
name: mypy (advisory)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- run: pip install mypy
# Advisory: the codebase is partially typed. Print findings but never
# fail the build (green check) until type coverage improves. Tighten by
# dropping the `|| true` once the baseline is cleaned up.
- run: mypy src/gasbench --ignore-missing-imports || true