Skip to content

data parallel patching for FastLanes#6708

Draft
a10y wants to merge 30 commits intodevelopfrom
aduffy/patches-transposed
Draft

data parallel patching for FastLanes#6708
a10y wants to merge 30 commits intodevelopfrom
aduffy/patches-transposed

Conversation

@a10y
Copy link
Contributor

@a10y a10y commented Feb 27, 2026

Summary

This PR adds G-ALP style patches that allow for data parallel access. This allows removing the additional execute_patches kernel 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.

image

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:

image

This diff looks large, but in reality the big pieces

  • Adds a new patches.h header file with shared definitions between the CUDA kernel and the Rust code.
  • Adds a patches.cuh with some C++ code to make it easier to seek/iterate over a range of patch values
  • Updates the unpacking kernels to accept an optional set of patches

This does not change the memory format for the Patches type, 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.

a10y added 16 commits February 27, 2026 10:44
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>
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>
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>
@a10y a10y force-pushed the aduffy/patches-transposed branch from 2c90a0b to 9826309 Compare February 27, 2026 15:44
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 27, 2026

Merging this PR will improve performance by 17.64%

⚡ 1 improved benchmark
✅ 953 untouched benchmarks
⏩ 1466 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation chunked_opt_bool_canonical_into[(10, 1000)] 1.6 ms 1.4 ms +17.64%

Comparing aduffy/patches-transposed (3e53f51) with develop (0abfb33)

Open in CodSpeed

Footnotes

  1. 1466 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Signed-off-by: Andrew Duffy <andrew@a10y.dev>
a10y added 5 commits February 27, 2026 18:04
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>
@a10y a10y added the changelog/performance A performance improvement label Feb 27, 2026
a10y added 3 commits February 27, 2026 14:47
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
a10y added 4 commits February 27, 2026 15:25
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/performance A performance improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant