refactor(ops): migrate topksoftmax to canonical InfiniOps API - #1472
Closed
voltjia wants to merge 1 commit into
Closed
refactor(ops): migrate topksoftmax to canonical InfiniOps API#1472voltjia wants to merge 1 commit into
voltjia wants to merge 1 commit into
Conversation
Collaborator
Author
|
Superseded by #1480, which consolidates the canonical InfiniOps adapter migrations while preserving each logical change as a separate commit. |
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
TopkSoftmaxInfinilmto canonicalTopkSoftmaxtoken_expert_indicesoutput as plan-owned internal storagenormbehavior unchangedAPI alignment
TopkSoftmaxInfinilm::Call(handle, config, gating_output, topk, renormalize, topk_weights, topk_indices)TopkSoftmax::Call(handle, config, gating_output, bias, is_padding, renormalize, topk_weights, topk_indices, token_expert_indices)topk_softmax(topk_weights, topk_ids, token_expert_indices, gating_output, renormalize=False, e_score_correction_bias=None, is_padding=None). InfiniOps groups inputs, attributes, and explicit outputs;biasmaps toe_score_correction_bias, andtopk_indicesmaps totopk_ids.The existing InfiniCore public API does not expose bias, padding, or the auxiliary token-to-expert output. This adapter passes null optional inputs and allocates the required third output in plan-owned storage. Its shape retains the caller's existing
topkselection, while the canonical operator derivestopkfrom the output shape.Dependency
This PR is based on
refactor/migrate-paged-caching-infiniops/ #1467 and advances the InfiniOps gitlink frome733e325to1a712d0c, the head of InfiniOps #891, which extends the canonical provider to the CUDA-compatible backends used by InfiniCore.Against #1467, this PR changes one adapter file and the InfiniOps gitlink.
Validation
Validated commit
3199b309remotely onssh nvidiawithaccelerator-dev/nvidia:latest, using the exact InfiniOps #891 head1a712d0cin a temporary integration merge:_infinicorewith the canonicaltopk_softmaxprovider in the wrapper allowlistpython3 test/infinicore/ops/topksoftmax.py --nvidia: 24/24 passedclang-format 16.0.6 --dry-run --Werrorpassed for the changed C++ filegit diff --checkpassed