Skip to content

Add test_batch_prefill.cpp to HIP#43

Merged
demandal25 merged 6 commits intoROCm:amd-integrationfrom
rtmadduri:test/impl-batch-prefill
Nov 14, 2025
Merged

Add test_batch_prefill.cpp to HIP#43
demandal25 merged 6 commits intoROCm:amd-integrationfrom
rtmadduri:test/impl-batch-prefill

Conversation

@rtmadduri
Copy link
Collaborator

This PR ports over the test_batch_prefill to HIP and adds the necessary utility functions to flashinfer_prefill_ops.

This is required for testing the BatchPrefillWithPagedKVCache and BatchPrefillWithRaggedPagedKVCache kernels.

@rtmadduri rtmadduri self-assigned this Nov 12, 2025
@rtmadduri rtmadduri requested a review from diptorupd November 13, 2025 01:40
@rtmadduri rtmadduri force-pushed the test/impl-batch-prefill branch from 955f683 to 1634298 Compare November 13, 2025 08:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR ports the test_batch_prefill test suite to HIP and adds essential wrapper functions and the BatchPrefillHandler class to support testing of batch prefill kernels with both paged and ragged KV cache layouts.

  • Introduces comprehensive test coverage for batch prefill operations including one-hot, short context, long context, and zero context scenarios
  • Adds BatchPrefillHandler class for managing workspace buffers and planning batch prefill operations
  • Provides wrapper functions BatchPrefillWithPagedKVCacheWrapper and BatchPrefillWithRaggedKVCacheWrapper for convenient kernel invocation

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 15 comments.

File Description
libflashinfer/utils/flashinfer_prefill_ops_hip.h Adds BatchPrefillHandler class and wrapper functions for batch prefill operations with paged and ragged KV caches
libflashinfer/tests/hip/test_batch_prefill.cpp New comprehensive test suite with multiple test cases covering various batch prefill scenarios for HIP backend

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@demandal25 demandal25 changed the title Add test_batch_prefill.cpp Add test_batch_prefill.cpp to HIP Nov 14, 2025
@demandal25 demandal25 merged commit d6b0157 into ROCm:amd-integration Nov 14, 2025
1 check passed
diptorupd pushed a commit that referenced this pull request Dec 5, 2025
In this PR, we add infra for enabling decode via flashinfer gpu_iface.
This PR does not change existing infrastructure and we can still build
decode using AOT and JIT.

Tested locally 
```
    Start 5: SingleDecodeTest
5/6 Test #5: SingleDecodeTest .................   Passed   35.12 sec
    Start 6: BatchDecodeTest
6/6 Test #6: BatchDecodeTest ..................   Passed  541.87 sec
```

We will have a follow up PR for enabling AOT decode using flashinfer
gpu_iface
diptorupd pushed a commit that referenced this pull request Dec 5, 2025
This PR ports over the `test_batch_prefill` to HIP and adds the
necessary utility functions to `flashinfer_prefill_ops`.

This is required for testing the `BatchPrefillWithPagedKVCache` and
`BatchPrefillWithRaggedPagedKVCache` kernels.

---------

Signed-off-by: Debasis Mandal <Debasis.Mandal@amd.com>
Co-authored-by: Debasis Mandal <Debasis.Mandal@amd.com>
zhenhantech pushed a commit to zhenhantech/flashinfer that referenced this pull request Jan 9, 2026
In this PR, we add infra for enabling decode via flashinfer gpu_iface.
This PR does not change existing infrastructure and we can still build
decode using AOT and JIT.

Tested locally 
```
    Start 5: SingleDecodeTest
5/6 Test ROCm#5: SingleDecodeTest .................   Passed   35.12 sec
    Start 6: BatchDecodeTest
6/6 Test ROCm#6: BatchDecodeTest ..................   Passed  541.87 sec
```

We will have a follow up PR for enabling AOT decode using flashinfer
gpu_iface
zhenhantech pushed a commit to zhenhantech/flashinfer that referenced this pull request Jan 9, 2026
This PR ports over the `test_batch_prefill` to HIP and adds the
necessary utility functions to `flashinfer_prefill_ops`.

This is required for testing the `BatchPrefillWithPagedKVCache` and
`BatchPrefillWithRaggedPagedKVCache` kernels.

---------

Signed-off-by: Debasis Mandal <Debasis.Mandal@amd.com>
Co-authored-by: Debasis Mandal <Debasis.Mandal@amd.com>
diptorupd pushed a commit to diptorupd/flashinfer that referenced this pull request Jan 28, 2026
In this PR, we add infra for enabling decode via flashinfer gpu_iface.
This PR does not change existing infrastructure and we can still build
decode using AOT and JIT.

Tested locally 
```
    Start 5: SingleDecodeTest
5/6 Test #5: SingleDecodeTest .................   Passed   35.12 sec
    Start 6: BatchDecodeTest
6/6 Test #6: BatchDecodeTest ..................   Passed  541.87 sec
```

We will have a follow up PR for enabling AOT decode using flashinfer
gpu_iface
diptorupd pushed a commit to diptorupd/flashinfer that referenced this pull request Jan 28, 2026
This PR ports over the `test_batch_prefill` to HIP and adds the
necessary utility functions to `flashinfer_prefill_ops`.

This is required for testing the `BatchPrefillWithPagedKVCache` and
`BatchPrefillWithRaggedPagedKVCache` kernels.

---------

Signed-off-by: Debasis Mandal <Debasis.Mandal@amd.com>
Co-authored-by: Debasis Mandal <Debasis.Mandal@amd.com>
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