Skip to content

test(integration): per-model examples + GPU real-checkpoint smoke tests - #145

Merged
drunkcoding merged 1 commit into
devfrom
feat/model-examples-regression
Aug 10, 2026
Merged

test(integration): per-model examples + GPU real-checkpoint smoke tests#145
drunkcoding merged 1 commit into
devfrom
feat/model-examples-regression

Conversation

@drunkcoding

Copy link
Copy Markdown
Contributor

What

Adds per-model runnable examples and real-checkpoint GPU smoke regression tests for the supported models, so the offload + generate() path has coverage per model before dev is promoted to main.

Examples (examples/)

deepseek_v2_chat_example.py (also fixes a dangling README reference), mixtral_example.py, qwen3_example.py, qwen3_5_example.py, glm_example.py, dbrx_example.py, jamba_example.py, olmoe_example.py, nllb_example.py.

Each follows the examples/readme_example.py template (MoE(ckpt, {offload_path, device_memory_ratio}) → tokenizer → generate), with per-model quirks: GLM-5.2 uses device_memory_ratio=0.5; NLLB uses the encoder-decoder translation path (src_lang, forced_bos_token_id); trust_remote_code set per model. GPT-OSS already has dflash_gpt_oss_example.py.

Regression tests (tests/python/integration/)

  • test_model_smoke.py — parametrized over the 8 decoder MoEs (deepseek_v2, mixtral, qwen3, qwen3.5, gpt_oss, dbrx, jamba, olmoe): load real checkpoint → generate(max_new_tokens=16) → assert output grew + non-empty decode.
  • test_nllb_smoke.py — dedicated NLLB-MoE translation smoke.
  • GLM-5.2 already has test_glm_smoke.py.

Gating (won't touch CI): every test is @pytest.mark.gpu and guarded by its own MOE_<MODEL>_SMOKE=1 env var and a torch.cuda.is_available() skip. Heavy imports (torch/transformers/moe_infinity) are inside the tests. CI runs -m "not gpu" and doesn't collect tests/python/integration, so these skip cleanly and never block CI. Run locally with e.g. MOE_MIXTRAL_SMOKE=1 pytest tests/python/integration/test_model_smoke.py -k mixtral.

Verification

  • py_compile all 11 files: pass
  • ruff check: All checks passed
  • pytest --collect-only: 9 tests collect, skip cleanly with no GPU/env
  • Scope limited to examples/ + tests/python/integration/

Add runnable examples (deepseek-v2, mixtral, qwen3, qwen3.5, glm-5.2, dbrx, jamba, olmoe, nllb) and gpu-marked, MOE_<MODEL>_SMOKE-gated real-checkpoint smoke regression tests (8 decoder MoEs parametrized + NLLB). Skip cleanly without GPU/env; excluded from CPU CI via 'gpu' marker. deepseek_v2_chat_example.py also fills a dangling README reference.
@drunkcoding
drunkcoding force-pushed the feat/model-examples-regression branch from 54ae16a to ab9833e Compare August 10, 2026 16:56
@drunkcoding
drunkcoding merged commit 457c3c4 into dev Aug 10, 2026
6 of 8 checks passed
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