Repository navigation
Conversation
… contract A new HIP group, deepseek_v41/topk512.hip: tf_dsv41_topk512, the arithmetic of Metal's topk512.metal on a 1,024-thread block a row: an 11/11/10-bit radix select of order-preserving keys over 2,048 LDS bins, then a stable pass that writes the kept indices ascending (wave32 shuffles where Metal has simdgroup scans). NaN ranks as -inf, -0 as +0, ties go to the lower index, and row r keeps min(512, visible[r]) indices, then -1. Nothing launches it outside its tests yet. Kernel tests: each row against a stable sort at widths 1 to 131,072 over spread values, heavy ties, masked -inf rows and NaN, +-0 and +-inf, with visible counts whole, none, half and one, 512, 513, negative and past the width; a row's output the same alone as among other rows, and the scores left as they were. Contract: Metal's served shapes, rows and rule, each row against the CPU's stable sort; its four controls (NaN above +inf red at nonfinite, ties to the higher index and the last score dropped red at shapes, a write into its input red at repeat); gate-5 records from ROCm 10.1's hipcc.
Owner
Author
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.
CI for a landing train: #4914 stacked on main in that order. Nothing merges from this PR: each PR above lands on its own once this tip is green, and this PR is then closed.