Repository navigation
Conversation
Replace the per-element unique/generic permute kernels with a single tiled KernelAbstractions kernel: each workgroup gathers one power-of-two tile of a destination tree, recoupled over the source trees, into shared memory in source order and writes it out in destination order, so reads and writes are both coalesced. Unique and recoupling blocks share one launch, and the diagonal paths use the same kernel with one-dimensional blocks. - tile shapes are chosen per transformer with a sector-based cost model - the tile length is branched on statically, so `DeviceTreeTransformer` has a concrete type and the device caches declare their return types - tiles of blocks with more source trees are scheduled first - split the GPUArrays extension into several files Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
... and 7 files with indirect coverage changes 🚀 New features to boost your workflow:
|
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.
Replaces the per-element
unique/genericpermute kernels of the GPUArrays extension with a single tiled KernelAbstractions kernel.Design
colssource trees, into@localmemin source order, then written out in destination order, so both reads and writes are coalesced.Int32. Shared memory is padded once per dim-1 row to avoid bank conflicts.rows = cols = 1) and recoupling blocks share one launch, which halves host overhead for non-abelian tensors. The diagonal paths use the same kernel with 1-D blocks.β ≠ 0.DeviceTreeTransformertherefore has a concrete type, and the@cacheddevice constructors declare their return type (devicetransformertype).truncation.jl,utility.jl,indexmanipulations.jl,trace.jlanddiagonal.jl. Traces are unchanged.Benchmarks (RTX A6000, old per-element kernels → tiled)
Throughput is back-to-back launches in µs. All outputs match the old kernels.
copyto!Known weak spots:
These numbers are from before the last round of cleanup (static tile-length branching, typed caches, tile ordering). A rerun of the small-tensor cases after the cleanup matched them. The rerun of the larger cases ran while another job was using the GPU, so it still needs to be redone.
Possible follow-ups
Uthere. This should help the SU(2) rank-6 case.MAX_TILE_LENGTH, so Float32 can use larger tiles (not yet measured).Tests
test/runtests.jl cuda: 125107 pass, 36 broken, 4 errors. The errors are IsingBimoduleSpaceMismatchs raised while building the test spaces (test/cuda/planar.jl:80,test/cuda/tensors.jl:119), before any kernel runs. They are not caused by this PR, but I haven't confirmed they also fail onmain.🤖 Generated with Claude Code