Skip to content

[test] Add regression test for validate_deepseek_v4_cp hook ordering (#32553; fix landed via #33532) - #32557

Open
layahaasini wants to merge 1 commit into
sgl-project:mainfrom
layahaasini:fix/deepseek-v4-prefill-cp
Open

layahaasini wants to merge 1 commit into
sgl-project:mainfrom
layahaasini:fix/deepseek-v4-prefill-cp

Conversation

@layahaasini

@layahaasini layahaasini commented Jul 27, 2026

Copy link
Copy Markdown

Motivation

Relevant to #32553 — the crash was fixed on main by #33532; this PR adds the regression coverage that fix landed without.

--enable-prefill-cp --cp-strategy interleave crashed at startup on DeepSeek-V4-Flash. Root cause was ordering in ServerArgs.__post_init__: the first _handle_legacy_cp_arguments() pass runs before model-specific defaults and mirrors the canonical flags to the generic legacy alias, validate_deepseek_v4_cp then set the DSA alias without clearing the generic one, and _handle_context_parallelism() raised the mutual-exclusion ValueError. This PR originally carried the same fix; after #33532 merged I rebased and dropped it, so the diff is now test-only.

Modifications

test/registered/unit/server_args/test_server_args.py (+26/-0): adds test_canonical_cp_survives_deepseek_v4_hook_ordering, which replays the __post_init__ handler ordering through validate_deepseek_v4_cp and asserts the canonical CP flags survive. The existing CP tests cover the alias mirroring but never exercise the DSV4 hook path.

Verified on the rebased head: pytest test/registered/unit/server_args/test_server_args.py -k canonical_cp → 1 passed against current main, and fails with the issue's ValueError if #33532's hook change is reverted.

Checklist


CI States

Latest PR Test (Base): ❌ Run #31552763963
Latest PR Test (Extra): ❌ Run #31552763913

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@layahaasini
layahaasini force-pushed the fix/deepseek-v4-prefill-cp branch from f0f8089 to bc9d79e Compare July 27, 2026 17:47

@mmangkad mmangkad left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@layahaasini
layahaasini force-pushed the fix/deepseek-v4-prefill-cp branch from bc9d79e to 53d9f11 Compare August 10, 2026 20:24
@layahaasini layahaasini changed the title [Fix] Clear generic legacy CP alias in DeepSeek V4 hook (fixes crash with --enable-prefill-cp) [test] Add regression test for validate_deepseek_v4_cp hook ordering (#32553; fix landed via #33532) Aug 10, 2026
…2553)

The early legacy-CP mirror in ServerArgs.__post_init__ runs before the
model arch is known, so --enable-prefill-cp --cp-strategy interleave was
mirrored to the generic legacy alias (enable_prefill_context_parallel).
The DSV4 hook then set enable_dsa_prefill_context_parallel without
clearing the generic one, the re-apply mirror bailed on its both-set
guard, and _handle_context_parallelism raised its mutual-exclusion
ValueError at startup. Clear the generic alias when the hook selects the
DSA alias.
@layahaasini
layahaasini force-pushed the fix/deepseek-v4-prefill-cp branch from 53d9f11 to 70b7d00 Compare August 12, 2026 01:11
@layahaasini

Copy link
Copy Markdown
Author

The fix landed via #33532, so this is now test-only: the regression test for the validate_deepseek_v4_cp ordering path from #32553.

Rebased on main, test file unchanged from what was approved. I verified it passes against current main and fails if #33532's hook change is reverted.

@mmangkad @Fridge003 could one of you please /tag-and-rerun-ci? Thanks!

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants