Repository navigation
[Hardware][MUSA] Enable MiniMax H3 fused kernels - #1
Closed
yeahdongcn wants to merge 1 commit into
Closed
yeahdongcn wants to merge 1 commit into
yeahdongcn wants to merge 1 commit into
Conversation
Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
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.
Purpose
Enable the MiniMax H3 fused SwiGLU and modulation paths on MUSA without changing the shared CUDA implementation or assuming that unverified accelerator backends can run the Triton kernels.
This is a review branch in
yeahdongcn/vllm-omni. It is intentionally opened as a draft while the final MUSA end-to-end A/B is running. After review, the same branch can be used for an upstream PR.The branch:
SiluAndMul.forward_musa()that calls the registered MUSAtorch.ops._C.silu_and_mulimplementation;adaln.chunk(6, dim=-1)layout used by the real H3 model while checking platform, device, and unit last-dimension stride;HAS_TRITONimport contract so environments without Triton can import the module and use the native fallback;Related upstream PR: vllm-project#6364. That PR changes
forward_cuda; this branch instead keeps the common CUDA method unchanged and provides a separate MUSA dispatch path.Test Plan
forward_cudawithout the device check, explicitforward_musa, and the vLLM-MUSA JIT path on S5000.vLLM Version:
0.1.dev1+gee0da84ab.d20260818.empty(vLLM-MUSA0.1.24)vLLM-Omni Commit:
4ddb22c4b2ed930d6565b2784736a0836ba78616Test Result
Completed:
ruff format/ruff check: passed.python -m compileall: passed.git diff --check: passed.h3-fullimage build from the exact v0.24 overlay source: passed, including the dependency-freeze and package-metadata gates._C.silu_and_mulpath and explicitforward_musahave matching behavior. In eager mode the fused path was 2.4-2.7x faster for the measured H3 shapes; undertorch.compileit was approximately neutral for small/medium shapes and about 25% faster at 16,384 rows. The optional MUSA JIT path was not selected because it regressed the small/medium compiled cases.159.186 s,159.172 s, and158.996 swall time; all outputs are valid 1,344x768 H.264/AAC videos with 107 frames.Pending before the draft is ready:
BEFORE SUBMITTING: read CONTRIBUTING.md and run the precheck-pr skill with the code agent for a self-check against project conventions.
(anything written below this line will be removed by GitHub Actions)