Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: FastGen CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
WANDB_MODE: disabled

jobs:
lint:
runs-on: [FG_Runner]

container:
image: ghcr.io/juliusberner/fastgen:0.0.3c
options: --entrypoint "" --gpus all --shm-size=8g
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Restore/Save Cache
uses: actions/cache@v4
with:
path: |
.cache/pip
.mypy_cache
key: ${{ runner.os }}-pip-mypy-${{ github.sha }}
restore-keys: |
${{ runner.os }}-pip-mypy-

- name: Install linters
run: make install-linters

- name: Run lint
run: make lint

- name: Run mypy
run: make mypy

test:
needs: lint
runs-on: [FG_Runner]

container:
image: ghcr.io/juliusberner/fastgen:0.0.3c
options: --entrypoint "" --gpus all --shm-size=8g
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Restore/Save Cache
uses: actions/cache@v4
with:
path: |
.cache/pip
.mypy_cache
key: ${{ runner.os }}-pip-mypy-${{ github.sha }}
restore-keys: |
${{ runner.os }}-pip-mypy-

- name: Increase file descriptor limit
run: ulimit -n 4096 || echo "Could not increase file descriptor limit"

- name: Run Pytest
run: make pytest

install_fastgen_package:
needs: test
runs-on: [FG_Runner]

container:
image: ghcr.io/juliusberner/fastgen:0.0.3c
options: --entrypoint "" --gpus all --shm-size=8g
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Restore/Save Cache
uses: actions/cache@v4
with:
path: |
.cache/pip
.mypy_cache
key: ${{ runner.os }}-pip-mypy-${{ github.sha }}
restore-keys: |
${{ runner.os }}-pip-mypy-

- name: Install fastgen
run: make install-fastgen
4 changes: 2 additions & 2 deletions tests/test_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,8 @@ def test_network_flux():
# Try to instantiate Flux model - skip if not accessible (gated model)
try:
teacher = instantiate(teacher_config)
except OSError as e:
if "not a valid model identifier" in str(e) or "token" in str(e):
except Exception as e:
if "not a valid model identifier" in str(e) or "token" in str(e).lower() or "gated" in str(e).lower():
pytest.skip(f"Test skipped: Flux model not accessible (requires HuggingFace authentication): {e}")
raise
teacher.init_preprocessors()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_network_fsdp.py
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ def test_fsdp_flux():
"black-forest-labs/FLUX.1-dev",
subfolder="transformer",
)
except HTTPError as e:
except Exception as e:
if "not a valid model identifier" in str(e) or "token" in str(e).lower() or "gated" in str(e).lower():
pytest.skip(f"Test skipped: Flux model not accessible (requires HuggingFace authentication): {e}")
raise
Expand Down
Loading