mirror of
https://github.com/deepseek-ai/DeepGEMM.git
synced 2026-11-05 00:47:26 +00:00
[GH-ISSUE #71] How to solve the error ""Misaligned barriers" raised by padded cuda tensors #44
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#44
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 @NiuMa-1234 on GitHub (Mar 20, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/71
Hi, thank you for your marvelous work! I've been trying to pad the tensors with illegal shapes to adapt to DeepGEMM, and found it would raise errors as below during training:
A.shape: [7168, 128] (original: [7168, 103])
B.shape: [2048, 128] (original: [2048, 103])
Here's the way how I pad the tensors:
A = torch.nn.functional.pad(A, (0, ((shape0+128)//128*128)-shape0), mode='constant', value=0)The deepgemm works well with legal shape, but if I pad the illegal ones to legal ones (and keep the continuity in memory), it would raise the above error. Could you plz help me? Many many thanks.
@soundOfDestiny commented on GitHub (Mar 21, 2025):
It's been fixed in latest main.
@NiuMa-1234 commented on GitHub (Mar 25, 2025):
Hi, I've test the latest code, and found it would raise another error, which is like this :
A.shape: [4096,256] (original: [4096,206])
B.shape: [7168,256] (original: [7168,206])
torch.Size([4096, 256]) torch.Size([4096, 2]) torch.Size([7168, 256]) torch.Size([56, 2]) /opt/pytorch/pytorch/aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [0,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && index out of bounds failed. /opt/pytorch/pytorch/aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [1,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && index out of bounds failed. /opt/pytorch/pytorch/aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [2,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && index out of bounds failed. /opt/pytorch/pytorch/aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [3,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && index out of bounds failed. /opt/pytorch/pytorch/aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [4,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && index out of bounds failed. /opt/pytorch/pytorch/aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [5,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && index out of bounds failed. /opt/pytorch/pytorch/aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [8,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && index out of bounds failed. /opt/pytorch/pytorch/aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [9,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && index out of bounds failed. /opt/pytorch/pytorch/aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [10,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && index out of bounds failed. /opt/pytorch/pytorch/aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [11,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && index out of bounds failed. /opt/pytorch/pytorch/aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [12,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && index out of bounds failed. /opt/pytorch/pytorch/aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [13,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && index out of bounds failed. /opt/pytorch/pytorch/aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [14,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && index out of bounds failed. [rank6]:[E325 06:35:52.757615577 ProcessGroupNCCL.cpp:1534] [PG 54 Rank 2] Process group watchdog thread terminated with exception: CUDA error: device-side assert triggeredThe padded tensors is contiguous (I use
tensor.contiguous()when pass tensors to gemm). Is there any other factor that could raise this error? Could you plz help me ? Many many thanks.