Repository navigation
Conversation
… headers on Metal GPUTPCCFDecodeZSDenseLink decodes a page with one warp, walking it timebin by timebin and link by link. For every link header, the warp also collected the channels with data, a thread per channel with three warp scans, inside a serial chain of dependent loads that is the latency limit of the kernel. On Metal the header loop now only walks the headers, and thread 0 stores each link's level-2 bitmask and the offset of its channel bitmask in shared memory (+64 bytes). The channels are then collected with one thread per byte of a link's channel bitmask: one warp scan per 32 bytes instead of about three per link. Same samples in the same order, same pointers into the page, including into the next one, same error paths. On an M1 Max the decode takes 23 to 39% less time per launch in normal multi-stream runs (pbpb30 4.9 -> 3.7 ms, 50 kHz TF0 6.7 -> 4.2 ms), about 1 to 2% of the full time frame. The cluster dumps are byte-identical: sim5pp against the CPU, 30 kHz (1 of 4) and 50 kHz TF0 before against after. pbpb30 in deterministic mode gives 22,183 tracks as before, and a 36 against 36 pass comparison at 50 kHz shows no difference in the track count. It is Metal-only for now, since it was measured only there: CUDA, HIP, OpenCL and the CPU compile the existing code unchanged. The chain it shortens is there on every backend, so it could be enabled for them once timed.
Member
Author
|
@davidrohr does it make any sense? |
Collaborator
|
in some sense, usually I try to make options configurable, so that they are available for all backends. I prefer this over special cases with #ifdef. Otherwise, fine with me. |
Member
Author
|
I must have clicked by accident. |
Member
Author
|
The little friend did it only for metal because we couldn't verify the effect on CUDA / HIP. In principle it should work for all backends, though. Yes, we should discuss about the optimisations and how to go on from now on. |
This branch has not been deployed
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.
GPUTPCCFDecodeZSDenseLink decodes a page with one warp, walking it
timebin by timebin and link by link. For every link header, the warp
also collected the channels with data, a thread per channel with three
warp scans, inside a serial chain of dependent loads that is the
latency limit of the kernel.
On Metal the header loop now only walks the headers, and thread 0
stores each link's level-2 bitmask and the offset of its channel
bitmask in shared memory (+64 bytes). The channels are then collected
with one thread per byte of a link's channel bitmask: one warp scan per
32 bytes instead of about three per link. Same samples in the same
order, same pointers into the page, including into the next one, same
error paths.
On an M1 Max the decode takes 23 to 39% less time per launch in normal
multi-stream runs (pbpb30 4.9 -> 3.7 ms, 50 kHz TF0 6.7 -> 4.2 ms),
about 1 to 2% of the full time frame. The cluster dumps are
byte-identical: sim5pp against the CPU, 30 kHz (1 of 4) and 50 kHz TF0
before against after. pbpb30 in deterministic mode gives 22,183 tracks
as before, and a 36 against 36 pass comparison at 50 kHz shows no
difference in the track count.
It is Metal-only for now, since it was measured only there: CUDA, HIP,
OpenCL and the CPU compile the existing code unchanged. The chain it
shortens is there on every backend, so it could be enabled for them
once timed.