Closed
Conversation
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
b3b291a to
ba31a6a
Compare
Add an optional `moe_buf` parameter through the moe_sorting and fused_moe call chain. When provided, the sorting kernel writes directly into the caller's buffer instead of allocating a new one, eliminating a redundant copy on the output path. Made-with: Cursor
Made-with: Cursor
ba31a6a to
60a459c
Compare
nholmber
added a commit
to nholmber/vllm
that referenced
this pull request
Apr 20, 2026
Plumb `moe_buf` through the vLLM AITER fused MoE interface so the kernel writes directly into the caller's pre-allocated output buffer. This avoids a device-to-device copy of the full MoE output on every forward pass. Requires AITER with ROCm/aiter#2687 merged. When `moe_buf` is `None` (older AITER), the existing allocation + copy behavior is preserved. Co-authored-by: Tres Popp <tres.popp@amd.com> Signed-off-by: nholmber <nholmber@users.noreply.github.com>
3 tasks
Contributor
Author
|
A concern was raised around why the fix can't be done on the caller side. The reason output buffers are desired is because in non HIPGraph cases, they don't want ~3 different temporary buffer allocations for intermediate workspaces and the output but a single allocation to limit overhead. |
Collaborator
|
we have internal logic and wlll use it for different way, like fuse quant or not fuse quant, the size and datatype for this buffer will change, this is can't for outside |
3 tasks
sunway513
added a commit
that referenced
this pull request
May 4, 2026
…e.py - Restore import to match main: use `from aiter import fused_dynamic_mxfp4_quant_moe_sort, mxfp4_moe_sort_fwd` instead of importing from internal triton path and fp4_utils - Replace all fp4_utils.moe_mxfp4_sort() calls with mxfp4_moe_sort_fwd() using correct parameter names (cols= instead of block_size=) - Remove all moe_buf preallocated buffer additions (PR #2687 rejected): parameter defaults, if-guards, and pass-throughs in _moe_sorting_impl, moe_sorting, fused_moe, fused_moe_fake, and fused_moe_ - Fix moe_sorting_dispatch_policy type annotation: bool -> int in fused_moe_fake and fused_moe_ - Remove moe_buf pass-through test from test_moe_sorting.py - Preserve legitimate fp4_utils usage (mxfp4_to_f32, e8m0_to_f32) with local imports in stage1/stage2 fallback functions
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
In locations like vLLM, they have abstracted the calling code to accept preallocated workspaces to use as output buffers.
Technical Details
Allow an output buffer here as an optional argument and otherwise allocate a new buffer.
Test Plan
Correctness testing is extended to also check that values are correct and the output buffer was used.