From 5cf96f932819801205e7e9ced1e5356194aaa04f Mon Sep 17 00:00:00 2001 From: Julius Berner Date: Wed, 3 Jun 2026 15:23:45 -0700 Subject: [PATCH 1/5] Add ci --- .github/workflows/ci.yml | 105 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e52e41b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,105 @@ +name: FastGen CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + WANDB_MODE: disabled + +jobs: + lint: + runs-on: [self-hosted, FG_Runner] + + container: + # Pointing to the new GitHub Container Registry image + image: ghcr.io/juliusberner/fastgen:0.0.3c + options: --entrypoint "" + # Automatic authentication using GitHub's built-in token + 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: [self-hosted, FG_Runner] + + container: + image: ghcr.io/juliusberner/fastgen:0.0.3c + options: --entrypoint "" + 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: [self-hosted, FG_Runner] + + container: + image: ghcr.io/juliusberner/fastgen:0.0.3c + options: --entrypoint "" + 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 \ No newline at end of file From 98856a89b472945cd156eecff6333cd3b2f6355a Mon Sep 17 00:00:00 2001 From: Julius Berner Date: Wed, 3 Jun 2026 15:54:11 -0700 Subject: [PATCH 2/5] Update spec --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e52e41b..2071bb6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: container: # Pointing to the new GitHub Container Registry image image: ghcr.io/juliusberner/fastgen:0.0.3c - options: --entrypoint "" + options: --entrypoint "" --gpus all --shm-size=8g # Automatic authentication using GitHub's built-in token credentials: username: ${{ github.actor }} @@ -51,7 +51,7 @@ jobs: container: image: ghcr.io/juliusberner/fastgen:0.0.3c - options: --entrypoint "" + options: --entrypoint "" --gpus all --shm-size=8g credentials: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} @@ -82,7 +82,7 @@ jobs: container: image: ghcr.io/juliusberner/fastgen:0.0.3c - options: --entrypoint "" + options: --entrypoint "" --gpus all --shm-size=8g credentials: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} From 5f6aa421d4a9fb125e71ca7fd21b79ee9e86e7f7 Mon Sep 17 00:00:00 2001 From: Julius Berner Date: Wed, 3 Jun 2026 17:45:48 -0700 Subject: [PATCH 3/5] Skip HF auth --- tests/test_network_fsdp.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_network_fsdp.py b/tests/test_network_fsdp.py index 25de5c0..6ddea54 100644 --- a/tests/test_network_fsdp.py +++ b/tests/test_network_fsdp.py @@ -819,8 +819,10 @@ def test_fsdp_flux(): "black-forest-labs/FLUX.1-dev", subfolder="transformer", ) - except HTTPError as e: - if "not a valid model identifier" in str(e) or "token" in str(e).lower() or "gated" in str(e).lower(): + except (HTTPError, OSError) as e: + err_msg = str(e).lower() + access_markers = ("not a valid model identifier", "token", "gated", "401", "403", "unauthorized", "restricted") + if any(marker in err_msg for marker in access_markers): pytest.skip(f"Test skipped: Flux model not accessible (requires HuggingFace authentication): {e}") raise From a6db7dd68d2415a2b78db118040e5e65f7f0aaf2 Mon Sep 17 00:00:00 2001 From: Julius Berner Date: Sat, 6 Jun 2026 08:41:04 -0700 Subject: [PATCH 4/5] Fix FLUX skip --- tests/test_network.py | 4 ++-- tests/test_network_fsdp.py | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/test_network.py b/tests/test_network.py index e8a7469..f14cb4b 100644 --- a/tests/test_network.py +++ b/tests/test_network.py @@ -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() diff --git a/tests/test_network_fsdp.py b/tests/test_network_fsdp.py index 6ddea54..7dc6e86 100644 --- a/tests/test_network_fsdp.py +++ b/tests/test_network_fsdp.py @@ -819,10 +819,8 @@ def test_fsdp_flux(): "black-forest-labs/FLUX.1-dev", subfolder="transformer", ) - except (HTTPError, OSError) as e: - err_msg = str(e).lower() - access_markers = ("not a valid model identifier", "token", "gated", "401", "403", "unauthorized", "restricted") - if any(marker in err_msg for marker in access_markers): + 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 From 687f90b8054e6008966e41717a5467c65201b8d7 Mon Sep 17 00:00:00 2001 From: Julius Berner Date: Sat, 6 Jun 2026 10:51:20 -0700 Subject: [PATCH 5/5] Update CI --- .github/workflows/ci.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2071bb6..8f62929 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,13 +11,11 @@ env: jobs: lint: - runs-on: [self-hosted, FG_Runner] + runs-on: [FG_Runner] container: - # Pointing to the new GitHub Container Registry image image: ghcr.io/juliusberner/fastgen:0.0.3c options: --entrypoint "" --gpus all --shm-size=8g - # Automatic authentication using GitHub's built-in token credentials: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} @@ -47,7 +45,7 @@ jobs: test: needs: lint - runs-on: [self-hosted, FG_Runner] + runs-on: [FG_Runner] container: image: ghcr.io/juliusberner/fastgen:0.0.3c @@ -78,7 +76,7 @@ jobs: install_fastgen_package: needs: test - runs-on: [self-hosted, FG_Runner] + runs-on: [FG_Runner] container: image: ghcr.io/juliusberner/fastgen:0.0.3c