Draft
Conversation
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
2c90a0b to
9826309
Compare
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
Merging this PR will improve performance by 17.64%
Performance Changes
Comparing Footnotes
|
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
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.
Summary
This PR adds G-ALP style patches that allow for data parallel access. This allows removing the additional
execute_patcheskernel launch, and instead inserts patch values inside of the unpacking kernels, at the step when we dispatch from shared -> global memory.The benchmarks added in #6712 show a significant speedup with this change, and performance is pretty much invariant to patch count.
Background
The G-ALP paper's contribution is modifying the standard layout of "exceptions" (what we call Patches in Vortex) to allow for fully data parallel access. Their target is an f32 ALP decoding kernel, but it is equally applicable for our unpacking kernels.
The core insight is that storing patches in sorted order, which is great for single-threaded execution on a super-scalar CPU, results in very poor GPU performance.
Instead, we need to shuffle them so that they can be accessed ordered by
(chunk, lane). The chunk is the normal FastLanes vector chunk size (1024). The lane depends on the width of the type. Doing this means that we get O(1) access to the patches within our kernel.Replicating Figure 2 from the paper:
This diff looks large, but in reality the big pieces
patches.hheader file with shared definitions between the CUDA kernel and the Rust code.patches.cuhwith some C++ code to make it easier to seek/iterate over a range of patch valuesThis does not change the memory format for the
Patchestype, rather this just does a D2H -> transpose on CPU -> H2D transformation.Testing
Uses the existing test suite which includes a lot of bit-unpacking with patches.