Skip to content

[Draft] Add PyTorch engine support for Hy3 BF16 and static FP8 (NO MTP)#4763

Draft
yidingcheng0206 wants to merge 2 commits into
InternLM:mainfrom
yidingcheng0206:feat/hy3-support
Draft

[Draft] Add PyTorch engine support for Hy3 BF16 and static FP8 (NO MTP)#4763
yidingcheng0206 wants to merge 2 commits into
InternLM:mainfrom
yidingcheng0206:feat/hy3-support

Conversation

@yidingcheng0206

Copy link
Copy Markdown
Collaborator

Summary

  • Add PyTorch engine support for Hy3 BF16 inference.
  • Add static per-tensor FP8 Linear and fused MoE support.
  • Add Hy3 BF16 and FP8 checkpoint weight loading.
  • Add TP-compatible packed QKV, dense MLP, shared MLP and routed expert loading.
  • Add model construction, weight loading and static FP8 kernel tests.

Implementation

This PR is organized into two commits:

  1. Add generic static per-tensor FP8 Linear and fused MoE infrastructure.
  2. Add the Hy3 model implementation, module registration and model tests.

Validation

  • ruff check: passed
  • git diff --check: passed
  • Hy3 tests: 9 passed
  • Static FP8 fused MoE kernel tests: 2 passed
  • Total: 11 passed

Serving validation:

  • Hy3 BF16 TP8 serving passed on 8 NVIDIA H200 GPUs.
  • Hy3 FP8 TP8 serving passed on 8 NVIDIA H200 GPUs.
  • BF16 memory usage: approximately 77.5 GiB per GPU.
  • FP8 memory usage: approximately 44.7 GiB per GPU.
  • Non-MTP checkpoint weight mapping coverage was verified.

Limitations

  • MTP is not supported yet.
  • Static FP8 MoE currently supports TP but not EP.
  • Full benchmark accuracy alignment is still in progress.
  • The minimum required Transformers version needs further discussion.

Checklist

  • BF16 model construction and weight loading
  • Static FP8 Linear
  • Static FP8 fused MoE
  • TP8 serving smoke test
  • Unit and kernel tests
  • MTP support
  • Full accuracy benchmark alignment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

if hy3 shares the same configuration behaviour as default, the config builder is not necessary.

)

world_size, _ = get_tp_world_rank()
self._all_reduce = world_size > 1

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We have build_moe_all_reduce logical in moe module, read qwen3_5_moe.py as reference.

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.

2 participants