Skip to content

Support Hy4-preview - #36805

Merged
Fridge003 merged 34 commits into
mainfrom
xinyuan/hy4-preview-support
Sep 5, 2026
Merged

Fridge003 merged 34 commits into
mainfrom
xinyuan/hy4-preview-support

Conversation

@JustinTong0323

@JustinTong0323 JustinTong0323 commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds support for the hy_v4 architecture (Hy4-preview, text-only): MLA with DSA sparse attention, iHC, gated MLA, learned attention sinks, sigmoid-gated MoE, and MTP/NextN speculative drafting, together with MXFP8 quantization support.

What is included

Validation

Limitations


CI States

Latest PR Test (Base): 🚫 Run #33934945618
Latest PR Test (Extra): 🚫 Run #33934945447
Latest PR Test (AMD ROCm 7.2): 🚫 Run #33934945566

JustinTong0323 and others added 4 commits August 28, 2026 09:44
Model and quantization: add the hy_v4 architecture (text-only) — MLA with
DSA sparse attention, iHC, gated MLA, learned attention sinks,
sigmoid-gated MoE, and MTP/NextN drafting — plus MXFP8 (ModelOpt, UE8M0
group-32) weight loading with MTP-exclusion remapping and deep_gemm as the
default MoE/FP8 GEMM backend. Unsupported PP/CP/DCP configurations raise at
construction time instead of failing later.

Attention and state: DSA backend and MLA forward changes for learned sinks,
the HYV4 iHC layernorm kernel, radix-attention integration, and the
DSV4-only resolve_spec_hidden_size fix.

Protocol: Hunyuan tool-call/reasoning parser auto-detection (suffix
structural tokens, arg_key/arg_value extraction, schema type coercion) and
chat-template auto-detection.

Co-authored-by: BBuf <1182563586@qq.com>
Co-authored-by: alphabetc1 <2508695655@qq.com>
Hy4 dropped <tool_sep> from its vocab and emits adjacent <tool_call>
blocks without separators, so the Hy3 structure_info literals never match
its output. Detect the dialect from the tokenizer vocab and emit
separator-free begin/end for Hy4.

Required/named tool_choice fell through to a json_schema grammar that
forces plain JSON the model was not trained to produce in this format;
mark the detector as parsing required tool choice natively so those
requests use the model's structural tool-call format instead.
… layouts

Hy4 sets swiglu_limit=10.0, and the masked DeepGEMM activation path only
exists as the DSV4 JIT kernel, which requires D // 8 >= num_experts and
group 128. With the layout heuristic on auto, Hy4 at TP8 (D=256) or any
MXFP8 group-32 config selects the masked layout and dies in the DSV4
activation assert. Force the compact layout whenever the masked branch
would be entered with a shape or quant group the kernel cannot serve;
DSV4's legal masked configuration (D=2048, E=256, group 128) is
unaffected and pinned by a test.
Upstream ParallelContext now answers config leaves directly
(get_parallel().enable_dp_lm_head, as in nemotron_h.py); the
.config.<leaf> spelling from the older runtime-context API raises
AttributeError at model construction.
Remove test cases that do not uniquely guard a realistic silent
failure: mock self-assertions, happy-path mirrors covered by
conversion/golden tests, predicate restatements, and duplicated
parameter grids. Drop test_deep_gemm_masked_layout_guard.py and its
CPU CI registration; the CUDA compact-vs-masked end-to-end test
covers the observable path.
@Fridge003 Fridge003 added the release-highlight Candidate PR for release note highlight label Sep 3, 2026
# Conflicts:
#	python/sglang/srt/entrypoints/openai/serving_chat.py
#	test/registered/unit/entrypoints/openai/test_serving_chat.py
JustinTong0323 and others added 6 commits September 4, 2026 08:12
handle_legacy_cp_arguments was split upstream into
handle_platform_cp_compatibility and
handle_legacy_cp_runtime_compatibility; the restored test still
referenced the removed name and failed at collection.
# Conflicts:
#	python/sglang/srt/configs/model_config.py
is_sm100_supported was removed from quantization/fp8.py; gate the
layout test on get_platform().is_sm100 like the production check.
@Fridge003

Copy link
Copy Markdown
Collaborator

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.

3 participants