Skip to content

feat(tito): add DeepSeek V3.2 speculative session verification#1628

Open
guapisolo wants to merge 3 commits into
mainfrom
fix/dsv32-thinking-parser-mode
Open

feat(tito): add DeepSeek V3.2 speculative session verification#1628
guapisolo wants to merge 3 commits into
mainfrom
fix/dsv32-thinking-parser-mode

Conversation

@guapisolo

Copy link
Copy Markdown
Collaborator

Summary

Add TP8/EP8 DeepSeek V3.2 TITO session verification with fixed EAGLE launch settings.

Motivation

Add a manual TP8/EP8 session test and expose the fixed EAGLE serving recipe through ModelConfig.

Keep SGLang TP/DP/PP/EP namespace fields on Miles' short-name contract, and forward the effective V3.2 thinking mode so SGLang separates reasoning before TITO comparison.

Usage

Run the manual verifier against a local checkpoint:

DEEPSEEK_V32_MODEL=/cluster-storage/models/deepseek-ai/DeepSeek-V3.2 python -m pytest tests/manual/tito/deepseek_v32.py -q -s

The test launches one session verifier with tp=8, ep=8, and EAGLE steps/top-k/draft-tokens set to 2/1/3.

Design Notes

  • Key choices: ModelConfig.enable_spec conditionally emits the fixed EAGLE recipe.
  • Key choices: add_sglang_arguments maps parallel-size aliases to Miles' short Namespace fields.
  • Key choices: DeepSeekV32TITOTokenizer forwards the resolved thinking mode as chat_template_kwargs["thinking"].
  • Alternatives considered: The official SGLang encoder stays unchanged because the mismatch is request-mode propagation.

Verification

  • Tests added: test_sglang_parallel_sizes_use_short_namespace_fields covers parallel-size aliases.
  • Tests added: test_namespace_to_train_args_enables_eagle_speculative_decoding covers EAGLE serialization.
  • Tests added: test_deepseek_v32_forwards_effective_thinking_mode covers thinking-mode precedence.
  • Existing test suite: 320 related tests pass on the clean main-based branch.
  • Manual E2E: V3.2 without speculative decoding completed 64/64 samples with every TITO mismatch category at zero.
  • Manual E2E: V4 with EAGLE completed 64/64 samples with every TITO mismatch category at zero.
  • Known blocker: V3.2 EAGLE currently stops in SGLang's embedded NextN loader because DeepseekV3ForCausalLMNextN lacks fuse_qkv_a_proj.

Review Focus

  • Scrutinize _SGLANG_PARALLEL_SIZE_DESTS alias-to-Namespace mapping.
  • Scrutinize DeepSeekV32TITOTokenizer effective-mode precedence.
  • Scrutinize namespace_to_train_args fixed EAGLE option serialization.

Add a manual TP8/EP8 session test and expose the fixed EAGLE serving recipe through ModelConfig.

Keep SGLang TP/DP/PP/EP namespace fields on Miles' short-name contract, and forward the effective V3.2 thinking mode so SGLang separates reasoning before TITO comparison.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for speculative decoding in sglang-based session verification, updates sglang parallel size argument handling to use shorter destination names (such as sglang_ep_size), and implements thinking mode forwarding for DeepSeek V3.2. The reviewer suggests avoiding hardcoded speculative decoding parameters in namespace_to_train_args and instead retrieving them dynamically from the namespace or model configuration.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +172 to +180
if ns.enable_spec:
parts.extend(
[
"--sglang-speculative-algorithm EAGLE",
"--sglang-speculative-num-steps 2",
"--sglang-speculative-eagle-topk 1",
"--sglang-speculative-num-draft-tokens 3",
]
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Avoid hardcoding speculative decoding parameters (such as algorithm, num_steps, eagle_topk, and num_draft_tokens) directly inside namespace_to_train_args. Per the general rules, model serving parameters should be retrieved from the model configuration or the argparse.Namespace to allow different models to use different speculative serving configurations.

Suggested change
if ns.enable_spec:
parts.extend(
[
"--sglang-speculative-algorithm EAGLE",
"--sglang-speculative-num-steps 2",
"--sglang-speculative-eagle-topk 1",
"--sglang-speculative-num-draft-tokens 3",
]
)
if ns.enable_spec:
spec_algo = getattr(ns, "speculative_algorithm", "EAGLE")
spec_steps = getattr(ns, "speculative_num_steps", 2)
spec_topk = getattr(ns, "speculative_eagle_topk", 1)
spec_tokens = getattr(ns, "speculative_num_draft_tokens", 3)
parts.extend(
[
f"--sglang-speculative-algorithm {spec_algo}",
f"--sglang-speculative-num-steps {spec_steps}",
f"--sglang-speculative-eagle-topk {spec_topk}",
f"--sglang-speculative-num-draft-tokens {spec_tokens}",
]
)
References
  1. Model parameters, such as index_topk, should be retrieved from the model configuration rather than being hardcoded.

Remove the old-to-new mapping table and select tp_size, dp_size, pp_size, or ep_size directly from SGLang's registered aliases without changing the CLI surface.
Document that argparse derives its destination from the first alias, which is why Miles selects SGLang's short parallel-size field names.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant