Conversation
|
cc'ing @kevinstephano @rdspring1 @jacobhinkle on the contiguity change. |
|
linking #2551 |
|
Could you please add this test? We need to make sure def test_fix_2549(self):
a = torch.ones(4, 1, dtype=torch.double, device='cuda')
b = torch.ones(4, 4, dtype=torch.double, device='cuda')
def nvfuser_fusion_id(fd : FusionDefinition) -> None :
T0 = fd.define_tensor(sizes=a.shape, strides=a.stride(), dtype=DataType.Double, is_cpu=False)
T1 = fd.define_tensor(sizes=b.shape, strides=b.stride(), dtype=DataType.Double, is_cpu=False)
T2 = fd.ops.broadcast_in_dim(T0, output_shape=[4, 4], broadcast_dims=[0, 1])
T3 = fd.ops.div(T1, T2)
fd.add_output(T3)
with FusionDefinition() as fd:
nvfuser_fusion_id(fd)
out = fd.execute([a, b])
self.assertEqual(out[0], b / a) |
|
Is this change need to be versioned? |
Good catch. I'll bump that~~ |
|
Linking the old PR from Xiang with the contiguity refactor #2517 |
zasdfgbnm
left a comment
There was a problem hiding this comment.
Thanks for fixing! Just some minor comments.
| if (not_broadcast(i)) { | ||
| break; | ||
| } | ||
| } |
There was a problem hiding this comment.
nit: Please revert this white space change (and consider using a modern editor rather than vim😈😈😈😈)
There was a problem hiding this comment.
Thanks for catching this~~ somehow my clangformat changes didn't get pushed.
and consider using a modern editor rather than vim
I'm going to unfriend you on all my social media.
Co-authored-by: Gao, Xiang <qasdfgtyuiop@gmail.com>
|
all comments resolved. I'll merge this when CI finishes. |
Fixes python handling of expanded broadcast dimension.
e.g.
torch.randint(0, 1, (5, 5), device="cuda").bool().unsqueeze(-1).expand(5, 5, 5)Changes contiguity representation on python.
computeContiguitycurrently returns an array with the length of tensor rank, elements in the array can be:True,FalseorNone, whereNoneindicates a given dimension is broadcast.