feat(nvidia): add moe_sum operator#803
Draft
voltjia wants to merge 1 commit into
Draft
Conversation
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.
Summary
moe_sumoperator and generated Python binding.topk_ids/expert_maprouting filters, non-negative strided inputs, non-default streams, and multi-GPU device guards.Motivation
moe_sumis a representative vLLM MoE primitive needed while moving third-party serving kernels behind InfiniOps. The public name and parameter semantics follow vLLM's stable custom-op schema; InfiniOps keeps its repository-wide convention of input tensors first and the mutable output last.Alignment reference (pinned to vLLM commit
2f75e7f):moe_sum(input, output)moe_sum(input, topk_ids, expert_map, output)moe_sum(Tensor input, Tensor! output, Tensor? topk_ids=None, Tensor? expert_map=None) -> ()N/A - no linked issue.
Type of Change
feat- new feature / new operator / new platformfix- bug fixperf- performance improvement (no behavioral change)refactor- code restructuring without behavior changetest- adding or fixing tests onlydocs- documentation onlybuild/ci- build system or CI configurationchore- tooling, formatting, or other non-code changesPlatforms Affected
WITH_CPU)WITH_NVIDIA)WITH_ILUVATAR)WITH_METAX)WITH_CAMBRICON)WITH_MOORE)WITH_ASCEND)WITH_TORCH)Smoke Test Result
Commit
264501126626b7f3dbf0a05c9cc3ec33dc8a4852was exported as a clean Git archive and tested onssh nvidiausingaccelerator-dev/nvidia:latest(sha256:dd94fce2f83a...), NVIDIA A100-SXM4-80GB, and PyTorch2.10.0a0+b4e4ee8.Test Results on Supported Platforms
moe_sum: 31 passed, 6 skipped; full suite intentionally not runFocused coverage
The focused suite covers both schema overloads, FP32/FP16/BF16 accumulation, int32/int64 routing IDs, negative and remote expert filtering, positive non-contiguous strides, non-default streams, multi-GPU device selection, and safe descriptor reuse. Descriptor reuse permits fresh data pointers with identical metadata and rejects changed shape, stride, dtype, device, or optional-argument presence before launch.
Benchmark / Performance Impact
N/A - this PR establishes the aligned interface and correctness baseline; it makes no performance claim.
Notes for Reviewers
moe_align_block_sizeis being proposed independently.