[BugFix] call ops.top_k_per_row_prefill in int8 indexer prefill#283
Open
Zymonody7 wants to merge 1 commit into
Open
[BugFix] call ops.top_k_per_row_prefill in int8 indexer prefill#283Zymonody7 wants to merge 1 commit into
Zymonody7 wants to merge 1 commit into
Conversation
torch.ops.top_k_per_row_prefill resolves to an op namespace, which is not callable, so the int8 sparse-attn-indexer prefill path raised TypeError. Match the bf16/fp8 paths and the decode path below, all of which use ops.top_k_per_row_prefill.
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the sparse_attn_indexer_int8 function in vllm_metax/customized/layers/sparse_attn_indexer/int8.py to call ops.top_k_per_row_prefill directly instead of using torch.ops.top_k_per_row_prefill. There are no review comments, and I have no additional feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
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.
torch.ops.top_k_per_row_prefill resolves to an op namespace, which is not callable, so the int8 sparse-attn-indexer prefill path raised TypeError. Match the bf16/fp8 paths and the decode path below, all of which use ops.top_k_per_row_prefill.
Purpose
Fix a crash in the int8 sparse-attn-indexer prefill path.
int8.py:183callstorch.ops.top_k_per_row_prefill(...), which resolves to anop namespace (not callable), so any model with FP8/int8 sparse attn indexer
(e.g. DeepSeek-V3.2) raises
TypeError: '_OpNamespace' object is not callablewhen the prefill path runs.
One-line fix: use
ops.top_k_per_row_prefill(...)fromvllm._custom_ops(already imported at line 8), matching the bf16 path (
bf16.py:181), the fp8path (
fp8.py:216) and the decode path in the same file (int8.py:254).Test Plan
Minimal repro of the broken call form (no GPU needed):
python -c "import torch; torch.ops.top_k_per_row_prefill(1)"to confirm this is the only raw-namespace call site of this class.
Test Result
TypeError: '_OpNamespace' object is not callable_C.top_k_per_row_prefillop as the bf16/fp8 paths.(Optional) Documentation Update
None.
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.