[Opus MoE] Unify A8W4 metadata and runtime dispatch - #4755
Open
yifehuan wants to merge 1 commit into
Open
Conversation
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
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.
Motivation
Opus MoE A8W4 metadata and runtime integration were previously split across multiple layers:
opus_moe_common.pydynamically loaded runtime metadata throughimportlib, reversing the intended dependency direction.This PR consolidates these responsibilities into a single-direction dependency structure and makes each complete
kernelName2select one immutable Stage2 launch plan.This is a structural follow-up to the runtime-K Stage2 work in #4723.
Technical Details
Consolidated torch-free Stage1 and Stage2 metadata into
csrc/opus_moe/opus_moe_common.py.importlib-based reverse dependency.Consolidated Stage2 runtime integration into
aiter/ops/opus/moe_stage2_a8w4.py.opus_moe_stage2_a8w4_fwd()entry point used by both fused MoE and the tuner.Made Stage2 launch selection immutable.
OpusA8W4LaunchConfignow stores only oneOpusA8W4Stage2Instance.kernelName2and the selected launch instance refer to the same plan.Moved the Opus Stage1 fused wrapper into
moe_stage1_a8w4.py.fused_moe.pynow selects Opus runtime adapters without owning their backend-specific argument handling.Updated
gemm_moe_tune.py.csrc.opus_moe.opus_moe_commonmodule.Updated Opus MoE documentation and codegen source references.
The generated kernel manifests and device translation units are unchanged apart from the metadata source-path comment. No GPU pipeline or kernel implementation is modified by this PR.
Test Plan
module_moe_opusas a multi-architecture module with:gfx942gfx950dsv4_fp8fp4_tuned_fmoe.csvkimik3_a8w4_tuned_fmoe.csvop_tests/test_moe_2stage.pycoverage for both model configurations.Test Result
module_moe_opus.sobuilt successfully.--offload-arch=gfx942and--offload-arch=gfx950.test_moe_2stage.py:Submission Checklist