Repository navigation
[None][feat] trtllm_modeling_v2: Hy4-Flash (tencent/Hy4-flash-FP8) target on sm_103 - #22769
Draft
Wanli-Jiang wants to merge 7 commits into
Draft
Wanli-Jiang wants to merge 7 commits into
Wanli-Jiang wants to merge 7 commits into
Conversation
…rget on sm_103 Adds the modeling_v2 family hyv4_flash_for_conditional_generation for HYV4FlashForConditionalGeneration and its sm_103 target hf_003107f_orig__sm_103__unified, as the trtllm_modeling_v2 flow delivered it on GB300, rebased onto main: - the family: routing for the tp4, tep4, dep4 and tep8 layouts, the declared DSA cache manager with the draft-source picks state, and the Engram host tables; - the target: the text core, the DFly2 drafter and speculative worker, the vision tower, and the target's op entries with their tests; - shared code: windowed MLA context and decode at the checkpoint's 192/64/256 widths with FP8 quantization at those widths, MLA context BMM2-N from v_head_dim, windowed MLA context packed in bounded groups; the HY4-Flash config type, checkpoint resolution and layer masks; the embedded DFly2 draft config read from the checkpoint; the checkpoint's own processor; lazy safetensors streaming for the checkpoint; startup checks counting a modeling_v2 family route as a registered architecture; - tests: unit and accuracy tests, test-db entries, and the greedy GSM8K reference (89.69). Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
…OT/Hy4-flash-FP8 everywhere The processor and config tests looked for LLM_MODELS_ROOT/tencent/Hy4-flash-FP8 and read HYV4_FLASH_CHECKPOINT, while the target tests and the accuracy tests use Hy4-flash-FP8 and HYV4_FLASH_CKPT. One name and one override now. Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
…t end cannot resolve The checkpoint keeps its quantization block in text_config, which ModelLoader._update_from_hf_quant_config does not read, so llm.args.quant_config.quant_algo stays None and the tests' FP8_BLOCK_SCALES assertion failed before scoring. The workers' ModelConfig resolves it (test_modeling_v2_hyv4_flash_config.py); the tests now set the reference key, as the disaggregated case already did. Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
The 89.69 rows are flexible-extract scores, but the harness compared its default, the mean of strict-match and flexible-extract. Strict-match reads only a final '#### N' line, which this checkpoint seldom writes: greedy at tep4 on GB300, flexible-extract 90.14 and strict-match 57.09, so the mean (73.62) failed the 86.49 threshold. The tests now select flexible-extract, as the deepseek_v3 modeling_v2 tests do. Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
…t to hy4_flash_fp8__sm_103__default The names came from the flow's derivation: the family kept ForConditionalGeneration, and the target took the checkpoint's revision directory (hf-003107f_orig) and a nonstandard 'unified' layout segment. 'default' is the README's name for a target that derives its sharding from the Mapping. Also drop the telemetry allowlist entry. Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
Behavior-preserving: drop narrative comments and notes, dead code and debug switches, four op entries the target never calls (sparse_mla_decode, vision_rope_2d, mnnvl_allreduce__r22, noaux_tc_op__r17), and tests beyond each entry's certified cells and the component checks a regression would silently break. One DFly2 accuracy case replaces three that built the same engine; the disaggregated case, which needs eight GPUs on one host and so ran on no CI stage, is gone. The MLA geometry test is listed on l0_b300. Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
… the request owns DflyBlockPrepare marked a request inactive when it accepted no draft: its input counts drafts, not sampled tokens as in the vLLM kernel it follows, so a zero-accept step left the next block without history and the request rarely recovered (acceptance length 1.38 on 32 GSM8K prompts at tep4). Every block now drafts unless it runs past max_model_len or onto a page the request does not own. The pages come from the table the block's KV write uses, since DSA's block_table ends at the step's own KV, and Hyv4FlashCacheManager reserves the block (history + tokens_per_gen_step + width) in every allocation. Acceptance length rises to 3.86 on the same prompts. Also restore the processor registration test_vision.py needs. Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@coderabbitai summary
Description
Adds the
trtllm_modeling_v2familyhyv4_flash(HYV4FlashForConditionalGeneration,tencent/Hy4-flash-FP8) and its sm_103 targethy4_flash_fp8__sm_103__default, which servestp4, tep4, dep4 and tep8, DFly2 speculative decoding (the checkpoint's own 5-draft drafter),
image inputs, FP8 KV, chunked prefill, block reuse and Engram host tables. The
trtllm_modeling_v2agent flow wrote it on GB300; this PR is that change on main, trimmed, withthe fixes below.
models/hyv4_flash/): routing, the DSA cache manager (grouped indexer pool, DFly2picks state and block reservation), Engram host tables.
models/hyv4_flash/hy4_flash_fp8__sm_103__default/): text core, DFly2 drafter andworker, vision tower, op entries with their tests.
mlaKernels.cu/.h,attentionOp.cpp,fmhaDispatcher.cpp/.h): context BMM2-N fromv_head_dim(this checkpoint has qk_nope 192, V 256); windowed (512) MLA context repacked intopacked QKV in bounded groups, because no separate-Q/K/V H256 context kernel has the sliding
mask; windowed decode passes the window instead of reading aged-out keys; FP8 context Q
quantize when K/V are already FP8.
configs/hyv4_flash.py+model_config.py+pyexecutor/config_utils.py: thehy_v4_flashconfig types (transformers has none yet), text-config resolution, DSA config forthe sparse layers, DFly2 geometry from the checkpoint's
dfly_*keys.llmapi/llm_args.py: an unset DFlashspeculative_modelreads the draft from the targetcheckpoint.
models/modeling_hyv4_flash.py+_arch_index.py: the checkpoint's image/video processor,ported from transformers (PR #50903), and its multimodal placeholders.
checkpoints/hf/weight_loader.py: lazy safetensors forhy_v4_flash.llmapi/startup_checks.py: a modeling_v2 route counts as a registered architecture.test_mla_hyv4_flash_geometry.py, GSM8K accuracytests, test-db entries, and the GSM8K reference (89.69, greedy, flexible-extract).
The flow's run started from main
b6709db38bwith #22329, #22617 (both on main since) and #22344(agent-flow only, not needed here). Rebasing onto
33d42fadb9conflicted inl0_dgx_b300.yml(both kept) and
mlaKernels.cu(main's generalized non-absorption FP8 quantize launch kept).Changes on top of the flow's tree:
6edeea876d).DflyBlockPreparemarked a request inactive after a step thataccepted no draft (its input counts drafts; the vLLM kernel it follows counts sampled tokens),
so the next block had no history and the request rarely recovered: acceptance length 1.38.
Every block now drafts unless it would pass
max_model_lenor land on a page the request doesnot own; its pages come from the table the block's KV write uses, and the cache manager
reserves the block in every allocation. Acceptance length 3.86 on the same prompts.
temperature 0.9 scored 85.29), flexible-extract scoring (strict-match reads only
#### N,which this checkpoint seldom writes), and the reference quant key set by the test because the
front end does not read the quantization block under
text_config.hyv4_flash_for_conditional_generation/hf_003107f_orig__sm_103__unified; nowhyv4_flash/hy4_flash_fp8__sm_103__default.Every test resolves the checkpoint as
HYV4_FLASH_CKPTor$LLM_MODELS_ROOT/Hy4-flash-FP8.never called, and tests beyond each entry's certified cells and the component checks a
regression would silently break; pre-commit clean. The disaggregated-serving GSM8K case was
removed: it needs eight GPUs on one host, which no CI stage has.
Not claimed: NVFP4 KV, sequences past
max_seq_len5120, video inputs, DFly2/multimodal/hostoffload/KV variants at tp4 or dep4.
Test Coverage
GB300 (4 GPUs per node), the image main pins, a native build of this branch:
test_attention_mla.py,test_startup_checks.py, modeling_v2 contract/CI-selection/stale-claim checks (47 files)6edeea876dtests/unittest/llmapi/test_llm_args.py92325b6f42test_gsm8k[tep4],[tp4],[dep4]92325b6f42test_kv_fp8_gsm8k,test_chunked_gsm8k,test_reuse_gsm8k(variant vs core, same test)92325b6f42test_gsm8k[tep4],test_dflash_gsm8kwith the DFly2 fix6edeea876d's codeGSM8K: 1319 samples, chat template with few-shot turns,
no_think, greedy, 4096 / 1024 tokens,flexible-extract, against 89.69 (threshold 86.49). Accuracy cases run as rank 0 of
mpirun -n 1: launched directly in a pyxis step, the LLM API'sMPI_Comm_Spawnfailed.Not run at this head:
test_gsm8k[tep8](two nodes) and the two-node comm matrices. The flow'srun validated tep8 (89.69) and the disaggregated deployment (2 x TEP2 context + 1 x TEP4 DFly2
generation, 89.99) on the older base.
For CI: the checkpoint must be at
$LLM_MODELS_ROOT/Hy4-flash-FP8.PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
If PR introduces API changes, an appropriate PR label is added - either
api-compatibleorapi-breaking. Forapi-breaking, includeBREAKINGin the PR title.Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.
GitHub Bot Help
To see a list of available CI bot commands, please comment
/bot help.Drafted with an AI coding agent (omp); reviewed against the commits and test runs above.