torch-mlir
torch-mlir copied to clipboard
Unimplemented view op case
There is a dynamic dim case where the, in this case batch dim and a dynamic dim are collapsed, which is not currently supported.
Offending case:
%39 = torch.aten.view %34, %38 : !torch.vtensor<[2,?,4096],f32>, !torch.list<int> -> !torch.vtensor<[?,4096],f32>
Error seen:
../SHARK-Turbine/Llama_2_7b_chat_hf_batch2.mlir:1037:11: error: failed to legalize operation 'torch.aten.view' that was explicitly marked illegal
%39 = torch.aten.view %34, %38 : !torch.vtensor<[2,?,4096],f32>, !torch.list<int> -> !torch.vtensor<[?,4096],f32>
This seems to fall into the case at this line https://github.com/llvm/torch-mlir/blob/d1cd117998d5d9b6d0f68784119d38a6b191463a/lib/Conversion/TorchToLinalg/DataMovement.cpp#L946
@Shukla-Gaurav might be interested in grabbing this.