Skip to content

Commit 4053a18

Browse files
Gasoonjiafacebook-github-bot
authored andcommitted
Remove dim order check in unsqueeze op to unblock supernova model release (#5299)
Summary: Pull Request resolved: #5299 TLDR: recently introduced dim order check blocks supernova team from releasing the latest language model. This diff does a minimum revert to mitigate the issue and unblock the model release. =============================================== Diving into the operator, the sanity checks themselves are correct, but the ambiguous dim order issue causes the problem. The size of input and output tensor of unsqueeze op are [1,1,768] and [1,1,1,768]. Our system interprets the first one as contiguous dim order while the second one as channels_last, which triggers the assertion failure. To unblock the model releasing, I removed the dim order check in the unsqueeze op. In the long term, I need to figure out the way to solve the ambiguous dim order stuff. Reviewed By: digantdesai, cccclai Differential Revision: D62550036 fbshipit-source-id: 8aa9d6e58871a68d81a608534faeff22b695e51f
1 parent 1d37332 commit 4053a18

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

kernels/portable/cpu/op_unsqueeze_copy.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ Tensor& unsqueeze_copy_out(
3838
ET_KERNEL_CHECK(ctx, self.dim() + 1 == out.dim(), InvalidArgument, out);
3939
ET_KERNEL_CHECK(ctx, dim <= self.dim(), InvalidArgument, out);
4040

41-
ET_KERNEL_CHECK(
42-
ctx, tensors_have_same_dim_order(self, out), InvalidArgument, out);
43-
44-
ET_KERNEL_CHECK(ctx, tensor_is_default_dim_order(self), InvalidArgument, out);
45-
4641
for (size_t i = 0; i < out.dim(); ++i) {
4742
if (i < dim) {
4843
expected_output_size[i] = self.size(i);

0 commit comments

Comments
 (0)