Repository navigation
[tests] Add DeepSeek V4 integration smoke - #4490
Conversation
|
could you take a look at the CI failure |
|
The Fake-PG failure is only |
|
now a different error |
|
|
|
@YeonwooSung thanks for investigation, please do it in this PR |
|
Have fixed the issues in the previous CI. WIll wait for the next CI run :) |
|
see results |
Cover the debug models that already have CPU tests but no models-suite entry. V4 uses the README 4-GPU FSDP2+TP2+EP2 layout without CP. Qwen3.8 reuses the Qwen3.5 MoE FSDP4+TP2+EP4 topology and keeps PP off so the case stays Fake-PG compatible.
Qwen3.8 shares the Qwen3.5 architecture and the same FSDP4+TP2+EP4 Fake-PG job. Remove that extra case and the topology unit test. Leave the V4 FSDP2+TP2+EP2 smoke, which is a different model.
Keep V4's always-a-list shape. torch.nn.ModuleList fails verify_module_protocol even when empty.
Hash layers index tid2eid with input_ids_T. Under default TP+SP+EP the MoE activation is already sharded on T, but token IDs stayed TP-replicated, so Fake-PG smoke failed with scores[256, 4] vs hash ids[512, 3]. Give 1D token IDs a sequence-parallel placement and redistribute to it only on the SP+EP path, where x is not all-gathered. Other combinations keep the full TP-replicated ids to match x.
de14af6 to
14c711d
Compare
|
Looked at the latest Fake-PG failure. This one is past both earlier issues: The This branch was based on an older If the non-finite persists after the rebase, it points to a V4-specific training-numerics issue this smoke is the first to exercise end-to-end (V3 debug trains fine on the same runner), and I would rather report/track that than shrink the topology to hide it. Will watch the run. |
The deepseek_v4_fsdp+tp+ep smoke fails under Fake PG: its sequence-parallel collectives return activations that alias their inputs, corrupting a saved-for-backward tensor and exploding grad_norm to non-finite at step 1. The same FSDP2+TP2+EP2 config trains cleanly on a real 4-GPU PG (loss 8.0 -> 3.7, grad_norm ~2-4 over 10 steps). Mark the case use_real_pg=True so it runs in the 8-GPU real-PG suite and is skipped by the 1-GPU Fake PG job, mirroring the existing varlen_attn+per_op_sac workaround (pytorch#4149). Keep it coverage-only (no numerical golden). Update the Fake-PG compatibility guard, the selection unit test, and the test README accordingly.
|
Reproduced the failure on a single L4 and debugged it down to root cause, then moved the case to a real PG. The path:
Given that, I marked the case |
|
I prepared the MTP SPMD layout fix as a follow-up to this PR.
|
|
Thanks for the fix! I looked at both commits. They target the MTP SPMD layouts, which apply to |
V4 does build and run under Fake PG (grad_norm just explodes to non-finite), unlike the genuinely non-runnable checkpoint/PP/varlen cases. use_real_pg=True already routes it to the real-PG suite, so the extra incompatibility entry was redundant and semantically wrong.
Why
DeepSeek V4 (
#3634) already has debug recipes and CPU unit tests, but it does not appear intests/integration_tests/models.py. The models suite never exercises V4 sparse attention / mHC / hash routing end to end.What
update_from_configrejects CP). Matches the smoke command in the V4 README. Skip ROCm; no golden.test_models_select_fake_and_real_pg_casesand document it intests/README.md.An earlier revision also added a Qwen3.8 twin of the existing Qwen3.5 FSDP4+TP2+EP4 case. That is dropped: Qwen3.8 shares the Qwen3.5 architecture, so the extra job did not add coverage.
Test plan
pytest tests/unit_tests/cpu/test_integration_test_definitions.py -k fake_and_realdeepseek_v4_fsdp+tp+ep