Closed m-lyon closed 1 year ago
Hey, I would love to work on this! I was wondering if there were any hints or guides to get started with this-thanks so much!
Here https://github.com/pytorch/pytorch/blob/cce577b39154b501705f32ee0392c77eee43820b/torch/_inductor/ir.py#L1179 add dims = cls._map_neg_dims(dims)
, modify assert
line accordingly and add a test as the failing example above to test_torchinductor.py
Ah, I see. Originally, I was thinking about fixing line 1206 below, but I think that at most that would only fix what's wrong with tensor.permute()
and not tensor.unfold()
and tensor.unsqueeze()
. Thank you so much for referring me to this, I really appreciate it!
🐛 Describe the bug
torch.compile fails when given the specific sequence of operations
Importantly, swapping out
tensor = tensor.permute([0, 2, 3, -3])
fortensor = tensor.permute([0, 2, 3, 1])
stops the compiler from crashing. Additionally removing thetensor.unfold
andtensor.unsqueeze
calls (and adjusting the dimension sizes accordingly) stops the compiler from crashing.Below is the full traceback
Versions
cc @ezyang @soumith @msaroufim @wconstab @ngimel @bdhirsh @mlazos @voznesenskym @yanboliang @penguinwu @anijain2305 @EikanWang @jgong5 @Guobing-Chen @chunyuan-w @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @desertfire