arg223_1 dtype is int64, and value 731 is contained in it, and
if arg223_1 become view_13 by torch.ops.aten.view.default, then value 731 retain 731
if arg223_1 become view_13 by ttnn.reshape, then because ttnn.reshape input dtype must be bfloat16, then value 731 should be converted to bfloat16(731) = 732, and convert back to int64(732) = 732 after ttnn.reshape, so the value 731 become 732 in view_13, then it will casue this error
IndexError: index 732 is out of bounds for dimension 0 with size 732
One of the suggestion of this issue is NOT lowering torch.ops.aten.view.default to ttnn.reshape if dtype is int64(then beit cannot end-to-end compiled), but I want to get some feedback from TT side
You can reproduce this error by pytest tests/pattern/test_beit_pattern.py
In
microsoft/beit-base-patch16-224
, there has this patternwhere
arg1_1.shape = [732, 12]
andarg223_1
will to be a list of indexarg223_1
dtype isint64
, and value 731 is contained in it, andarg223_1
becomeview_13
bytorch.ops.aten.view.default
, then value 731 retain 731arg223_1
becomeview_13
byttnn.reshape
, then becausettnn.reshape
input dtype must be bfloat16, then value 731 should be converted tobfloat16(731) = 732
, and convert back toint64(732) = 732
afterttnn.reshape
, so the value 731 become 732 inview_13
, then it will casue this errorOne of the suggestion of this issue is NOT lowering
torch.ops.aten.view.default
tottnn.reshape
if dtype isint64
(then beit cannot end-to-end compiled), but I want to get some feedback from TT sideYou can reproduce this error by
pytest tests/pattern/test_beit_pattern.py