Skip to content

ci: add Lightning registry fallback for gated tokenizer tests#2271

Open
bhimrazy wants to merge 6 commits into
Lightning-AI:mainfrom
bhimrazy:ci/tokenizer-registry-fallback
Open

ci: add Lightning registry fallback for gated tokenizer tests#2271
bhimrazy wants to merge 6 commits into
Lightning-AI:mainfrom
bhimrazy:ci/tokenizer-registry-fallback

Conversation

@bhimrazy

@bhimrazy bhimrazy commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Follows up on #2268 (Phase 1): restores gated-tokenizer test coverage by falling back to the public Lightning Model Registry mirror (lightning-ai/oss-litgpt) when HF_TOKEN is absent. Public mirrors download anonymously via guest login — no secrets needed.

Changes:

  • tests/test_tokenizer.py — on a gated HF failure, falls back to the registry mirror (name derived from the HF repo slug) and loads the tokenizer from local files. Off by default; enabled with LITGPT_TOKENIZER_REGISTRY_FALLBACK=1.
  • .lightning/workflows/tests.yaml — non-compiler leg runs tests/test_tokenizer.py with RUN_ONLY_CUDA_TESTS=0 and the fallback enabled after the main pytest run.
  • pyproject.toml — adds litmodels>=0.1.8 to the test extra.

When HF_TOKEN is absent, gated repos now resolve from the public
Lightning Model Registry mirror (lightning-ai/oss-litgpt) instead of
skipping. The non-compiler leg of the Lightning workflow runs the
tokenizer sweep explicitly with RUN_ONLY_CUDA_TESTS=0 and
LITGPT_TOKENIZER_REGISTRY_FALLBACK=1 after the main pytest run.

litmodels is added to the test extra. The fallback is off by default
so GitHub Actions CPU tests are unchanged.
bhimrazy added 3 commits June 24, 2026 07:44
The mirror download is swallowed by a bare except, so gated repos skip
silently in CI even with the fallback enabled. Print the mirror name,
the result, and any exception, and run the tokenizer step with -s -rs
so the output and skip reasons are visible in the logs.
@bhimrazy
bhimrazy force-pushed the ci/tokenizer-registry-fallback branch from 25b2a7b to 6137701 Compare June 24, 2026 08:44
@bhimrazy

Copy link
Copy Markdown
Collaborator Author

Note: Although the tests appear to have passed, they were actually skipped in the Lit Job CI due to missing keys.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant