Skip to content

feat: add xattention_prefill_reshape_cache kernel.#963

Open
zhang-minchao wants to merge 1 commit intojd-opensource:mainfrom
zhang-minchao:feat/xattention_prefill_reshape_cache
Open

feat: add xattention_prefill_reshape_cache kernel.#963
zhang-minchao wants to merge 1 commit intojd-opensource:mainfrom
zhang-minchao:feat/xattention_prefill_reshape_cache

Conversation

@zhang-minchao
Copy link
Collaborator

No description provided.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new CUDA kernel for prefill_reshape_and_cache, replacing a simpler CPU-based implementation. The new kernel is optimized for performance using vectorized memory access. The PR also includes comprehensive unit tests that cover various tensor layouts, and the necessary build system updates. My review identified one critical issue where input tensor validation is performed after slicing, potentially leading to out-of-bounds memory access. I have provided a code suggestion to correct this validation logic. Once this issue is addressed, the changes look good.

@zhang-minchao zhang-minchao force-pushed the feat/xattention_prefill_reshape_cache branch 2 times, most recently from 6b96a04 to ff93c78 Compare February 28, 2026 10:23
DragonFive
DragonFive previously approved these changes Feb 28, 2026
Copy link
Collaborator

@DragonFive DragonFive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants