Skip to content

[None][feat] Add XingChen4 model support - #18578

Draft
wanghui002 wants to merge 1 commit into
NVIDIA:mainfrom
wanghui002:feat/xingchen4
Draft

[None][feat] Add XingChen4 model support#18578
wanghui002 wants to merge 1 commit into
NVIDIA:mainfrom
wanghui002:feat/xingchen4

Conversation

@wanghui002

Copy link
Copy Markdown

Background

Onboard XingChen4ForCausalLM — a DeepSeek-V3-style model with MLA + MoE and a multi-Head Hyper-Connection (mHC) residual mixing mechanism — to the TRT-LLM PyTorch backend.

Changes

  • Register XingChen4ForCausalLM in the model architecture index, config registry, and pyexecutor config utils (aliased to DeepseekV3Config)
  • Add modeling_xingchen4.py: mHC-wrapped decoder layer and dedicated weight loader for hc_fn/hc_base/hc_scale checkpoint tensors
  • Route xingchen4 through DeepseekV3MTP for speculative decoding in modeling_speculative.py
  • Add XingChen4ReasoningParser (DeepSeek-R1-style with leading <think> strip, delegating to DeepSeekR1Parser or IdentityReasoningParser)
  • Add XingChen4ToolParser (<tool_call> / <param_key> block format, streaming-safe)
  • Add unit tests for the new reasoning parser (5 new test cases)

Testing

  • pre-commit run passes all hooks (isort, yapf, ruff, ruff-format, codespell, DCO check, etc.)
  • pytest tests/unittest/llmapi/test_reasoning_parser.py: 213/213 passed
  • API stability (signature + docstring): 20/20 passed

PR Checklist

  • PR description clearly explains what and why.
  • PR Follows TRT-LLM CODING GUIDELINES to the best of my knowledge.
  • Test cases are provided for new code paths.
  • Any new dependencies have been scanned for license and vulnerabilities.
  • CODEOWNERS updated if ownership changes (N/A).
  • Documentation updated as needed (N/A).

Onboard XingChen4ForCausalLM (DeepSeek-V3-style MLA + MoE with mHC
residual mixing) to the PyTorch backend:

- Register XingChen4 model architecture and config alias to DeepseekV3Config
- Add modeling_xingchen4 with mHC-wrapped decoder layer and dedicated
  weight loader for hc_fn/hc_base/hc_scale checkpoint tensors
- Route xingchen4 through DeepseekV3MTP for speculative decoding
- Add XingChen4 reasoning parser (DeepSeek-R1-style with leading <think>
  strip) and tool parser (<tool_call> / <param_key> block format)
- Add unit tests for the new reasoning parser

Signed-off-by: wanghui002 <wanghui002@users.noreply.github.com>
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