Repository navigation
Shader: run wave64 groups that share nothing as one host group per wave - #14
Merged
Merged
Conversation
On hosts without 64-lane waves, a console wave64 compute program in the console flow with more than 64 threads per group, no LDS, and no s_barrier runs each console wave as a 64-thread host group. The translator derives console group and thread ids from the host ids and reports the factor (HostShader::regroup, stored in the shader cache flags). Direct dispatches multiply X by the factor; indirect dispatches multiply the records' X in the clamp pass before ExecuteIndirect and divide it back in a follow-up ungroup pass. Requires a rebuilt shader cache.
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.
Compute programs compiled as wave64 with groups larger than 64 threads that use neither LDS nor
s_barrier(such as tiled sun-shadow variants) were previously refused on 32-lane hosts (console wave64 lanes in a group of more than 64 threads).Changes
victory-shader): In the console control-flow pass, wave64 compute shaders withthreads > 64,threads % 64 == 0, no LDS, and nos_barrierare lowered with a 64-thread host group ([64, 1, 1]) andregroup = threads / 64, deriving console thread/group IDs from the host group/thread IDs (HostShader::regroup, persisted in the shader cache flags).victory-gpu):Xbyp.regroup()(dropping if > 65,535).regroupintoindirect::bounded, multiplying the argument records'XbeforeExecuteIndirectand dividing it back in a follow-upungrouppass (Bound::Regrouped).Verification
cargo clippy(victory-shader,victory-gpu,victory --features diagnostics)-- -D warnings: cleancargo test -p victory-shader: 297 passedcargo test -p victory-gpu -- --test-threads=1: 187 passedcargo xtask policy: 186 passedmain).