You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the implementation of aten::masked_fill(Tensor self, Tensor mask, Scalar value) in core/conversion/converters/impl/select.cpp the converter implementation is such that the masked rank is padded to match the rank of self if the rank of mask is less than self Tensor. This creates an issue when the broadcastable is checked in util::broadcastable, since they might be broadcastable according to the masked_fill torch rules, but the TensorRT select layer will restrict since they would not be broadcastable.
At present padding both the self tensor, when mask tensor has dimension greater than the self tensor causes issue. eg: mask tensor is of shape [1,1,1,1488] and the self tensor is [1,512, 1488] then padding self to mask with additional 1s, causes error down the line in aten::matmul when last dimension of input0 is 1 (should be 512 )and second last dimension of input 1 is 512.
Hence we would want a broadcasting utility in converter_utils.cpp which would broadcast the self and mask tensor according to torch rules. It would remove the unnecessary 1s from the dimensions.
The text was updated successfully, but these errors were encountered:
Feature context
In the implementation of aten::masked_fill(Tensor self, Tensor mask, Scalar value) in core/conversion/converters/impl/select.cpp the converter implementation is such that the masked rank is padded to match the rank of self if the rank of mask is less than self Tensor. This creates an issue when the broadcastable is checked in util::broadcastable, since they might be broadcastable according to the masked_fill torch rules, but the TensorRT select layer will restrict since they would not be broadcastable.
Reference to Issue 1573 after PR 1609
Workaround
At present padding both the self tensor, when mask tensor has dimension greater than the self tensor causes issue. eg: mask tensor is of shape [1,1,1,1488] and the self tensor is [1,512, 1488] then padding self to mask with additional 1s, causes error down the line in aten::matmul when last dimension of input0 is 1 (should be 512 )and second last dimension of input 1 is 512.
Hence we would want a broadcasting utility in converter_utils.cpp which would broadcast the self and mask tensor according to torch rules. It would remove the unnecessary 1s from the dimensions.
The text was updated successfully, but these errors were encountered: