-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[nvbugs/5354884][fix] Update beam search workspace estimation to new upper bound #5926
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
/bot run |
|
PR_Github #11563 [ run ] triggered by Bot |
|
PR_Github #11563 [ run ] completed with state |
|
/bot run --disable-fail-fast |
|
PR_Github #11649 [ run ] triggered by Bot |
|
PR_Github #11649 [ run ] completed with state |
|
/bot run |
|
PR_Github #11657 [ run ] triggered by Bot |
|
PR_Github #11657 [ run ] completed with state |
c2a0e1a to
b4e4bce
Compare
|
/bot run |
|
PR_Github #11802 [ run ] triggered by Bot |
|
PR_Github #11802 [ run ] completed with state |
|
@ChristinaZ not sure if you're familiar with this AirTopK variant. Could you please review? |
|
@symphonylyh maybe you could also review or reassign since you reviewed the original implementation. |
Let me introduce some background. AIR TopK actually has two different versions: a single-block and a multi-block implementation. One of our main reasons for choosing between different implementations is to avoid the tailing effect. |
…_stable_radix_topk_ as an better upper bound Signed-off-by: Stefan Niebler <[email protected]>
WalkthroughThe function Changes
Sequence Diagram(s)sequenceDiagram
participant Host
participant GPU
Host->>GPU: Query number of streaming multiprocessors (sm_cnt)
Host->>Host: Compute grid_dim using sm_cnt
Host->>GPU: Call standalone_stable_radix_topk_ with detailed parameters (workspace, grid_dim, flags, etc.)
GPU-->>Host: Return workspace size/buffer size
Poem
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
|
/bot run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
cpp/tensorrt_llm/kernels/topkLastDim.cu (1)
1477-1478: Consider adding explanatory comment for future maintainers.While the implementation correctly ensures upper bound workspace estimation, consider adding a comment explaining why we explicitly call
standalone_stable_radix_topk_instead ofstandalone_stable_radix_11bits. This would help future maintainers understand the reasoning behind this approach.+ // Explicitly call the multi-block version to ensure workspace size represents + // the upper bound, preventing underestimation when batch size changes standalone_stable_radix_topk_<T, idxT, 11, block_dim>(workspace, buf_size, in, static_cast<idxT*>(nullptr), batchSize, inputLength, k, out_val, out_idx, !is_largest, fused_last_filter, grid_dim, 0, sorted);
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
cpp/tensorrt_llm/kernels/topkLastDim.cu(1 hunks)
🔇 Additional comments (2)
cpp/tensorrt_llm/kernels/topkLastDim.cu (2)
1462-1462: Good use of type alias for consistency.The introduction of
idxTtype alias improves code readability and maintains consistency throughout the function.
1470-1478: Effective solution for workspace size underestimation.The explicit setup and call to
standalone_stable_radix_topk_ensures that workspace size is calculated using the multi-block version parameters, which provides the upper bound needed to prevent out-of-bounds access. This directly addresses the PR objective of fixing workspace underestimation when batch size changes.The approach of querying SM count and calculating grid dimensions ensures we get the workspace size for the more resource-intensive multi-block algorithm, preventing the underestimation issue described in the PR.
|
PR_Github #12300 [ run ] triggered by Bot |
|
PR_Github #12300 [ run ] completed with state |
|
/bot run |
|
PR_Github #12325 [ run ] triggered by Bot |
|
PR_Github #12325 [ run ] completed with state |
…upper bound (NVIDIA#5926) Signed-off-by: Stefan Niebler <[email protected]>
…upper bound (NVIDIA#5926) Signed-off-by: Stefan Niebler <[email protected]>
…upper bound (NVIDIA#5926) Signed-off-by: Stefan Niebler <[email protected]> Signed-off-by: Shreyas Misra <[email protected]>
Description
Out of bounds access, occured, when batchsize changes during generates as the initial estimation of beam search workspace size might sometimes be lower than an estimation with a lower batchsize, due to different algorithms being called.
This change always uses the function, which exhibits the larger workspace demands as an upper bound estimation
Test Coverage
GitHub Bot Help
/bot [-h] ['run', 'kill', 'skip', 'reuse-pipeline'] ...Provide a user friendly way for developers to interact with a Jenkins server.
Run
/bot [-h|--help]to print this help message.See details below for each supported subcommand.
run [--disable-fail-fast --skip-test --stage-list "A10-1, xxx" --gpu-type "A30, H100_PCIe" --add-multi-gpu-test --only-multi-gpu-test --disable-multi-gpu-test --post-merge --extra-stage "H100_PCIe-[Post-Merge]-1, xxx"]Launch build/test pipelines. All previously running jobs will be killed.
--disable-fail-fast(OPTIONAL) : Disable fail fast on build/tests/infra failures.--skip-test(OPTIONAL) : Skip all test stages, but still run build stages, package stages and sanity check stages. Note: Does NOT update GitHub check status.--stage-list "A10-1, xxx"(OPTIONAL) : Only run the specified test stages. Examples: "A10-1, xxx". Note: Does NOT update GitHub check status.--gpu-type "A30, H100_PCIe"(OPTIONAL) : Only run the test stages on the specified GPU types. Examples: "A30, H100_PCIe". Note: Does NOT update GitHub check status.--only-multi-gpu-test(OPTIONAL) : Only run the multi-GPU tests. Note: Does NOT update GitHub check status.--disable-multi-gpu-test(OPTIONAL) : Disable the multi-GPU tests. Note: Does NOT update GitHub check status.--add-multi-gpu-test(OPTIONAL) : Force run the multi-GPU tests. Will also run L0 pre-merge pipeline.--post-merge(OPTIONAL) : Run the L0 post-merge pipeline instead of the ordinary L0 pre-merge pipeline.--extra-stage "H100_PCIe-[Post-Merge]-1, xxx"(OPTIONAL) : Run the ordinary L0 pre-merge pipeline and specified test stages. Examples: --extra-stage "H100_PCIe-[Post-Merge]-1, xxx".For guidance on mapping tests to stage names, see
docs/source/reference/ci-overview.md.kill
killKill all running builds associated with pull request.
skip
skip --comment COMMENTSkip testing for latest commit on pull request.
--comment "Reason for skipping build/test"is required. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.reuse-pipeline
reuse-pipelineReuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.
Summary by CodeRabbit