optimize gpu.cu which leads to a ~4% speedup#28
Open
mrzetti wants to merge 1 commit into
Open
Conversation
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.
This is created by me trying out gpt5.6 sol xhigh.
Further testing on more gpus and cuda versions would be nice :)
Changes
[256][6]to[6][256]to avoid stride-6 shared-memory bank conflicts12 -> 013 -> 914 -> 115 -> 11uint8_tindices so modulo 256 occurs once instead of at every lookupfilter_2_01b, fixing unsafe in-place compactionResource impact
On
sm_89,filter_gradvecs_1shared memory drops from 17,712 to 16,560 bytes per block. This allows six resident blocks within Ada's 100 KiB shared-memory limit instead of five.Benchmark
RTX 4070,
sm_89, bounded small biomes, fixed start seed0:Fixed-seed stage counts remained identical during testing.
Related work
PR #24 also modifies the gradient-vector kernels, but takes a different approach by expanding and flattening the convolution buffers. This change instead reduces and transposes them, lowering
filter_gradvecs_1shared memory from approximately 30 KB in #24 to 16,560 bytes while preserving fixed-seed stage outputs.