This repository has been archived by the owner on Mar 21, 2024. It is now read-only.
Stop specifying the minimum blocks __launch_bounds__
parameter
#1051
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.
It messes up register allocation and increases register pressure, and we don't
actually know at compile time how many blocks we will use (aside from single
tile kernels).
For inclusive scan on 16-bit, the current launch bounds annotation tells the compiler that there are 128 threads per block, and only 1 block per SM. On GV100, this means the compiler is free to use up to 255 registers without worrying about occupancy. A compiler change is pushing the per-thread register usage from 39 to 57 registers. Even though the compiler is able to still schedule the kernel using 39 registers without spills, the launch_bounds annotation is telling it not to bother because there are only 4 warps per SM.
However, the kernel is actually executed with many blocks per SM, causing occupancy-related performance issues. See #10 for some results.
The launch bounds are coming from scan.h in THRUST:
Empirically, setting
_MIN_BLOCKS
to 12 constrains the compiler to use only 40 registers, which recovers the performance (and occupancy).Note that the perf is actually slightly better than the baseline run without the compiler change.
Internal CI Job
Bug 2826490
Reviewed-by: Michał 'Griwes' Dominiak [email protected]