Repository navigation
Conversation
Always use direct state indices to avoid CUDA Graph padding mismatches and remove obsolete sort cache and permutation plumbing.
d74ae32 to
024c23b
Compare
There was a problem hiding this comment.
Pull request overview
This PR removes the host-side (and associated kernel-side) sorted-index decode path for HIP GDN, motivated by correctness/safety issues when CUDA Graph padding/replay can cause a cached permutation to no longer match the active indices. The resulting implementation always launches decode using the original (unsorted) state indices and eliminates the sorted-index cache/reset API.
Changes:
- Removed the Python/API surface for invalidating the sorted-index cache (
hip_gdn_decode_reset_sort_cache) and corresponding export. - Deleted the C++ extension’s host-side
argsort/index_selectflow, sorted-index cache, andHIP_GDN_SORT_IDX_BSthreshold logic. - Simplified the HIP kernel interface by removing
batch_permplumbing and deleting sorted kernel variants/dispatch.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| aiter/ops/hip/gated_delta_net/hip_gdn_decode.py | Removes documentation and Python wrapper for reset-sort-cache behavior. |
| aiter/ops/hip/gated_delta_net/gdn_decode_kernel_hip.hip | Removes batch_perm parameter and sorted kernel variants; always uses original batch indexing. |
| aiter/ops/hip/gated_delta_net/gdn_decode_ext.cpp | Removes host-side sorting/caching and updates launcher calls to pass original indices only. |
| aiter/ops/hip/gated_delta_net/init.py | Stops exporting the removed reset-sort-cache API. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Looks good. Please ensure this change is deployed together with the paired SGLang update, since the removed reset API is still referenced by older SGLang versions. |
|
No activity for 15 days, so this is now labelled |
Motivation
Remove the host-side GDN index sorting path, which is unsafe with CUDA Graph padding and replay when the cached permutation no longer matches the active indices.
Technical Details
argsortandindex_select.HIP_GDN_SORT_IDX_BS.batch_permand sorted HIP kernel dispatch.Test Plan
Test Result
Submission Checklist