Skip to content

Commit c40fbea

Browse files
authored
Add ci (#29)
* Add ci * Update spec * Skip HF auth * Fix FLUX skip * Update CI
1 parent 82a8fbf commit c40fbea

3 files changed

Lines changed: 106 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: FastGen CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
env:
10+
WANDB_MODE: disabled
11+
12+
jobs:
13+
lint:
14+
runs-on: [FG_Runner]
15+
16+
container:
17+
image: ghcr.io/juliusberner/fastgen:0.0.3c
18+
options: --entrypoint "" --gpus all --shm-size=8g
19+
credentials:
20+
username: ${{ github.actor }}
21+
password: ${{ secrets.GITHUB_TOKEN }}
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
27+
- name: Restore/Save Cache
28+
uses: actions/cache@v4
29+
with:
30+
path: |
31+
.cache/pip
32+
.mypy_cache
33+
key: ${{ runner.os }}-pip-mypy-${{ github.sha }}
34+
restore-keys: |
35+
${{ runner.os }}-pip-mypy-
36+
37+
- name: Install linters
38+
run: make install-linters
39+
40+
- name: Run lint
41+
run: make lint
42+
43+
- name: Run mypy
44+
run: make mypy
45+
46+
test:
47+
needs: lint
48+
runs-on: [FG_Runner]
49+
50+
container:
51+
image: ghcr.io/juliusberner/fastgen:0.0.3c
52+
options: --entrypoint "" --gpus all --shm-size=8g
53+
credentials:
54+
username: ${{ github.actor }}
55+
password: ${{ secrets.GITHUB_TOKEN }}
56+
57+
steps:
58+
- name: Checkout repository
59+
uses: actions/checkout@v4
60+
61+
- name: Restore/Save Cache
62+
uses: actions/cache@v4
63+
with:
64+
path: |
65+
.cache/pip
66+
.mypy_cache
67+
key: ${{ runner.os }}-pip-mypy-${{ github.sha }}
68+
restore-keys: |
69+
${{ runner.os }}-pip-mypy-
70+
71+
- name: Increase file descriptor limit
72+
run: ulimit -n 4096 || echo "Could not increase file descriptor limit"
73+
74+
- name: Run Pytest
75+
run: make pytest
76+
77+
install_fastgen_package:
78+
needs: test
79+
runs-on: [FG_Runner]
80+
81+
container:
82+
image: ghcr.io/juliusberner/fastgen:0.0.3c
83+
options: --entrypoint "" --gpus all --shm-size=8g
84+
credentials:
85+
username: ${{ github.actor }}
86+
password: ${{ secrets.GITHUB_TOKEN }}
87+
88+
steps:
89+
- name: Checkout repository
90+
uses: actions/checkout@v4
91+
92+
- name: Restore/Save Cache
93+
uses: actions/cache@v4
94+
with:
95+
path: |
96+
.cache/pip
97+
.mypy_cache
98+
key: ${{ runner.os }}-pip-mypy-${{ github.sha }}
99+
restore-keys: |
100+
${{ runner.os }}-pip-mypy-
101+
102+
- name: Install fastgen
103+
run: make install-fastgen

tests/test_network.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,8 @@ def test_network_flux():
482482
# Try to instantiate Flux model - skip if not accessible (gated model)
483483
try:
484484
teacher = instantiate(teacher_config)
485-
except OSError as e:
486-
if "not a valid model identifier" in str(e) or "token" in str(e):
485+
except Exception as e:
486+
if "not a valid model identifier" in str(e) or "token" in str(e).lower() or "gated" in str(e).lower():
487487
pytest.skip(f"Test skipped: Flux model not accessible (requires HuggingFace authentication): {e}")
488488
raise
489489
teacher.init_preprocessors()

tests/test_network_fsdp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ def test_fsdp_flux():
819819
"black-forest-labs/FLUX.1-dev",
820820
subfolder="transformer",
821821
)
822-
except HTTPError as e:
822+
except Exception as e:
823823
if "not a valid model identifier" in str(e) or "token" in str(e).lower() or "gated" in str(e).lower():
824824
pytest.skip(f"Test skipped: Flux model not accessible (requires HuggingFace authentication): {e}")
825825
raise

0 commit comments

Comments
 (0)