Add HYV3 causal LM support - #2318
Open
ASheng1019 wants to merge 1 commit into
Open
Conversation
Code Metrics Report━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Language Files Lines Code Comments Blanks ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ C Header 23 4454 3116 790 548 CSS 3 282 252 6 24 CUDA 121 25439 20835 1707 2897 Dockerfile 1 35 19 9 7 HTML 2 27 27 0 0 JavaScript 3 578 563 12 3 Jinja2 7 694 656 5 33 JSON 27 17989 17986 0 3 Makefile 1 18 16 0 2 MDX 36 6285 0 4616 1669 Metal Shading Lan| 37 14394 11386 1136 1872 PowerShell 1 657 571 31 55 Python 151 12539 10418 480 1641 Shell 3 1071 852 115 104 Plain Text 53 10687 0 9209 1478 TOML 28 1389 1209 39 141 TypeScript 11 1649 1410 66 173 YAML 3 25 23 2 0 ───────────────────────────────────────────────────────────────────────────────── Jupyter Notebooks 3 122 83 23 16 |- Markdown 1 60 30 22 8 |- Python 1 122 113 1 8 (Total) 304 226 46 32 ───────────────────────────────────────────────────────────────────────────────── Markdown 273 12055 0 8981 3074 |- BASH 24 300 221 47 32 |- Dockerfile 2 14 12 0 2 |- JSON 6 289 289 0 0 |- PowerShell 1 1 1 0 0 |- Python 135 7349 6120 306 923 |- Rust 62 3840 2849 394 597 |- TOML 7 92 78 0 14 (Total) 23940 9570 9728 4642 ───────────────────────────────────────────────────────────────────────────────── Rust 701 331371 296672 5815 28884 |- Markdown 418 9947 452 8304 1191 (Total) 341318 297124 14119 30075 ───────────────────────────────────────────────────────────────────────────────── Svelte 19 1969 1826 51 92 |- CSS 1 4 4 0 0 |- JavaScript 19 921 767 25 129 (Total) 2894 2597 76 221 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Total 1507 466668 378856 42192 45620 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
- Implement HYV3 / Hy-MT2 causal LM inference with Q/K RMSNorm, sigmoid MoE routing, expert bias, shared expert, and fp32 lm_head handling - Register HYV3 as a normal text architecture across the loader, docs, and Python surfaces - Add native HYV3 tool-call parsing and chat-template detection - Document Hy3 / Hy-MT2 support and Hy3 MTP / FP8 limitations - Validate Hy-MT2-30B-A3B on CUDA with cudnn + flash-attn
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.
Hi @EricLBuehler! This adds HYV3 support for the Tencent HyV3 / Hy-MT2 family.
The loader now supports the main causal LM path used by
tencent/Hy-MT2-30B-A3B, including Q/K RMSNorm, sigmoid MoE routing with expert-bias top-k selection, the shared expert path, HYV3 RoPE config formats, fp32 lm_head projection when requested by the checkpoint, and HYV3 native tool calls.I tested
tencent/Hy-MT2-30B-A3Blocally on a GB10 with CUDA. Text quality looked normal on translation / instruction prompts, and tool calling produced OpenAI-compatibletool_callsfrom the model's native HYV3 tag format.With a CUDA build using
cudnn + flash-attn, one smoke run produced:0.83s90 tokens,109.36 tok/s51 tokens,27.17 tok/sA forced tool-call smoke test on the same model completed successfully as well:
3.98s210 tokens,249.70 tok/s81 tokens,25.80 tok/sThe same architecture should theoretically load the BF16
tencent/Hy3main causal LM path as well: its config and weight index match the HYV3 main 80-layer backbone. I could not validate that end-to-end because Hy3 is too large for the GB10 setup I have.Two known Hy3 gaps:
tencent/Hy3-FP8is not supported as-published yet because it needs FP8 checkpoint scale tensor support.Would you be able to help validate
tencent/Hy3BF16 on hardware large enough for the main causal LM path?