Repository navigation
Indirect compute records past the host's group limit run in pieces too (on top of #976); the group base goes to the group id only - #1222
Open
Steenax6 wants to merge 2 commits into
Conversation
… its groups start The title asks some passes for more thread groups in x than the host runs in one dispatch (65,535), and the groups after it were lost, or the count itself went to the driver, which has no duty to survive it: - Dispatch, DispatchX and DispatchMesh are run as pieces of at most 65,535 groups, and the translated program adds the piece's first group to its group id (SV_DispatchThreadID and the mesh stage's group are built from the same op, so all of them move with it). The dword is one the host computes (USER_GROUP_BASE, an Other root kind after USER_VIEW_BIAS), bound at 0 by every bind and set again before each piece from the second on. VICTORY_GROUP_SPLIT=0 turns it off. - A dispatch past the limit whose program reads no group id is clamped to 65,535 with a note (its ids cannot move), where before the whole count went to the driver. - A group count that arrives in GPU memory (the indirect light pass's compute record of about 77,500 groups, run 200) is still clamped, now counted as well: the clamp notes the largest group count its compute records asked for (budget words 12 and 16, beside the mesh notes at 4 and 8), and the frame line reports it, so the next run measures what the cut-off costs. Built and unit-tested (the program that reads its group id is checked to read the base with the split on and not with it off); not yet seen in a run of the title.
…o; the group base goes to the group id only On top of the commit before (pull request fxceless#976), which runs direct dispatches of more than 65,535 groups in x in pieces and leaves a count that arrives in GPU memory cut at 65,535. What was seen: in the first room a band along the bottom of the picture held stale blocks, old tiles of earlier frames, in the scene target and in several history targets. A compute pass of the title's indirect lighting is run by an indirect record that asks for about 74,816 thread groups in x; a host dispatch runs 65,535, and the argument clamp cut the record there, so the last tiles of the list, the bottom of the screen, were never written. 1.2 such records a frame. - Indirect compute records: for a program that reads its group id, the argument clamp writes each record VICTORY_GROUP_PIECES times (2 by default, at most 16), the copies a record list apart in the scratch buffer, piece p holding clamp(x - p * 65,535, 0, 65,535) groups, and the execution is recorded once a piece with that piece's group base (USER_GROUP_BASE). No count is read back. All pieces of a record charge the list's budget as one: a record runs whole or not at all. A piece with no groups is an empty dispatch. - Only the clamp where the record runs needs this here: a dispatch record is never served from a window and never gathered (VICTORY_INDIRECT_GATHER=1 gathers only what a window could hold), so the gather pass is given one piece and is otherwise unchanged. - The translated program adds the base to its group id only. In the commit before it was added to the thread id in the group as well (both are read through the same helper), so a program that reads its thread id in the group read it too large by the base in every piece after the first. - Still cut, and counted: a record of a program that reads no group id, a record that asks for more than all its pieces run, and everything with VICTORY_GROUP_SPLIT=0 (one piece, as before). The frame line reports the indirect compute records over 65,535 a frame, those over what their pieces run, the pieces after the first that ran groups, the executions recorded in pieces, and the direct dispatches split. - The clamp's root constants go from 6 to 8 (the benchmark's old clamp gets the same root signature), and the budget buffer's notes from 4 words to 7. Measured and looked at in another tree, not on this base (Steenax6/VIctory-NVID, commit ac7664d, RTX 4070 Ti): the largest count asked for is 74,816, the records over the limit run whole, the band is gone, and no cost in frame time was measured (88.7 ms with two pieces, 87.6 with one). On this base it has been compiled, linted and unit-tested only (a WARP test runs a record of 70,000 groups in two pieces and in one); it has not been seen in a run of the title. The translator changes, so every shader is translated again on the next start. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.
What
#976 (MoscaLosca, open) runs direct dispatches of more than 65,535 thread groups in pieces. This adds the indirect case, which is the one we hit, and one correction to the translated program.
In the first room a band along the bottom of the picture held stale blocks, old tiles of earlier frames, in the scene target and in several history targets (it looks like HUD garbage; it is not HUD). A compute pass of the title's indirect lighting is run by an indirect record that asks for about 74,816 thread groups in x. A host dispatch runs 65,535, and the argument clamp cut the record there, so the last tiles of the list, the bottom of the screen, were never written. About 1.2 such records a frame.
Commits
VICTORY_GROUP_PIECEStimes (2 by default, at most 16), piece p holdingclamp(x - p * 65535, 0, 65535)groups, and the execution is recorded once a piece with that piece's group base (USER_GROUP_BASE). No count is read back. All pieces of a record charge the list's budget as one.VICTORY_GROUP_SPLIT=0.VICTORY_INDIRECT_GATHER=1), so the gather pass gets one piece and is otherwise unchanged.Measured (in our tree, Steenax6/VIctory-NVID ac7664d, RTX 4070 Ti)
The largest count asked for is 74,816; the records over the limit run whole and the band is gone. No cost in frame time (88.7 ms with two pieces, 87.6 with one).
What I can and cannot say for this tree
maingives, none new.cargo test --workspace --locked:victory-shaderpasses with the extended group-base test, and a new WARP test runs a record of 70,000 groups in two pieces and in one. Failing and not from this change:xtaskrepository_passes_policy(two files underdiagnostics/onmainare over the size limit) and one of two WARP tests inwatch.rs/inplace.rs, a different one in each run.🤖 Generated with Claude Code