2 parents fe21563 + 03a3d7a commit f709778Copy full SHA for f709778
1 file changed
torch_cluster/triton.py
@@ -181,7 +181,8 @@ def _triton_pairwise_distances(
181
x = torch.nn.functional.normalize(x, dim=-1)
182
y = torch.nn.functional.normalize(y, dim=-1)
183
out = torch.empty((M, N), device=x.device, dtype=torch.float32)
184
- grid = (triton.cdiv(M, 64), triton.cdiv(N, 64))
+ grid = lambda meta: (triton.cdiv(M, meta['BLOCK_M']),
185
+ triton.cdiv(N, meta['BLOCK_N']))
186
_pairwise_dot_kernel[grid](
187
x,
188
y,
@@ -201,7 +202,8 @@ def _triton_pairwise_distances(
201
202
x_norm = (x * x).sum(dim=1).float()
203
y_norm = (y * y).sum(dim=1).float()
204
205
206
207
_pairwise_distance_kernel[grid](
208
209
0 commit comments