mirror of
https://github.com/deepseek-ai/DeepGEMM.git
synced 2026-11-05 00:47:26 +00:00
[GH-ISSUE #313] [Question] Is there a simpler implementation for the UTCCP transposer? #156
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepGEMM#156
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dcaox on GitHub (Apr 21, 2026).
Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/313
[Question] Is there a simpler implementation for the UTCCP transposer?
Hi, I was reading the UTCCP transposer warp logic in
utccp_required_smem_warp_transposeand noticed that it uses a very clever XOR-based coordinate remapping to avoid shared-memory bank conflicts during the transpose.From what I understand, the underlying problem here is essentially a shared-memory transpose of
uint32[4][32] -> uint32[32][4]. The current implementation seems to solve the bank-conflict issue by permuting the per-lane scalar load/store order.For this specific
4x32 -> 32x4case, I was wondering whether a simpler approach could also work: keep the loads scalar, then perform a single vector store per lane.For example, something like:
My understanding is that:
smem_ptr + i * 32 + lane_idxare already conflict-freeDoes the current XOR-based transpose have advantages over a scalar-load + vector-store approach that I may be missing?
@nouman11033 commented on GitHub (Apr 21, 2026):
The scalar-load + vector-store approach can indeed be conflict-free for the 4×32 → 32×4 case, but only because the 16B-per-lane store gets split into 128B transactions (8 lanes each), where the accesses happen to be conflict-free within each transaction.
However, this relies on very specific assumptions about transaction grouping, alignment, and instruction lowering. If any of those change, bank conflicts can reappear.
The XOR-based remapping (shared memory swizzling) instead guarantees conflict-free accesses per transaction, independent of how the warp is partitioned or how the compiler emits the instructions.
So while the simpler approach may work in this specific case, the XOR approach is more robust and general, which is likely why UTCCP uses it.
@zheanxu commented on GitHub (Apr 27, 2026):
Thank you for the insightful suggestion! The simplified load+vector store approach is indeed cleaner. We'll adopt it in the next update.