Fold grid.y/z into permute cap_grid_dim_x to fix HIP 2^32 overflow - #6082
Closed
q10 wants to merge 1 commit into
Closed
Fold grid.y/z into permute cap_grid_dim_x to fix HIP 2^32 overflow#6082q10 wants to merge 1 commit into
q10 wants to merge 1 commit into
Conversation
Contributor
|
@q10 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D113884728. |
Summary: The permute embedding kernel launches cap grid.x via cap_grid_dim_x but passed only the per-block thread count (kMaxThreads) as the threshold argument, omitting the y/z batch dimensions. cap_grid_dim_x bounds the *total* launch and requires all other launch dims folded into that argument, so with a large batch the launch still exceeded HIP's 2^32 thread-per-launch limit even though grid.x alone fit, tripping KernelLauncher::checkThreadCountNotExceeded on ROCm. The kernel-side grid-stride + repro tests already landed (D105353645, D105354406, D105355306) but these host call sites under-counted. Fold block-threads * grid.y * grid.z into the cap so grid.x is clamped against the full launch; the kernels already grid-stride over their saturating dimension so a clamped grid.x still covers all work. Fixed at all three host launch sites: - permute_multi_embedding_ops.cu (permute_multi_embs_kernel) - permute_pooled_embedding_ops.cu (permute_pooled_embs_kernel) - permute_pooled_embedding_ops_split.cu (split frontend) Differential Revision: D113884728
Contributor
|
This pull request has been merged in 5fc44e4. |
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.
Summary:
The permute embedding kernel launches cap grid.x via cap_grid_dim_x but
passed only the per-block thread count (kMaxThreads) as the threshold
argument, omitting the y/z batch dimensions. cap_grid_dim_x bounds the
total launch and requires all other launch dims folded into that
argument, so with a large batch the launch still exceeded HIP's 2^32
thread-per-launch limit even though grid.x alone fit, tripping
KernelLauncher::checkThreadCountNotExceeded on ROCm. The kernel-side
grid-stride + repro tests already landed (D105353645, D105354406,
D105355306) but these host call sites under-counted.
Fold block-threads * grid.y * grid.z into the cap so grid.x is clamped
against the full launch; the kernels already grid-stride over their
saturating dimension so a clamped grid.x still covers all work. Fixed at
all three host launch sites:
Differential Revision: D113884728