perf(amdgpu): reduce per-kernel SGPR pressure#39
Open
peizhang56 wants to merge 2 commits into
Open
Conversation
Two AMDGPU codegen changes:
* Emit a no-loop variant of gpu_parallel_range_for_fixed_config when
the launch grid fully covers the iteration space, removing the
grid-stride loop's SGPR bookkeeping at kernel entry. Gated by a
saturating_grid_dim safety check.
* Strip 8 unused implicit kernarg SGPR preloads at JIT time
(amdgpu-no-{queue-ptr,dispatch-id,completion-action,
multigrid-sync-arg,heap-ptr,default-queue,hostcall-ptr,
lds-kernel-id}). No Quadrants kernel consumes them; each one
freed reclaims an SGPR pair on every AMDGPU kernel.
Co-authored-by: Cursor <cursoragent@cursor.com>
Author
|
/run-ci |
Add JIT-time predicate grid_exactly_covers_range in codegen_amdgpu.cpp and a leaner runtime template gpu_parallel_range_for_fixed_config_no_loop_no_guard in runtime.cpp that omits the s_and_saveexec/s_cbranch_execz guard when bounds are compile-time constants and grid_dim*block_dim == (end-begin).
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.
Two AMDGPU codegen changes:
Emit a no-loop variant of gpu_parallel_range_for_fixed_config when the launch grid fully covers the iteration space, removing the grid-stride loop's SGPR bookkeeping at kernel entry. Gated by a saturating_grid_dim safety check.
Strip 8 unused implicit kernarg SGPR preloads at JIT time (amdgpu-no-{queue-ptr,dispatch-id,completion-action, multigrid-sync-arg,heap-ptr,default-queue,hostcall-ptr, lds-kernel-id}). No Quadrants kernel consumes them; each one freed reclaims an SGPR pair on every AMDGPU kernel.
Issue: #
Brief Summary
copilot:summary
Walkthrough
copilot:walkthrough