torch-mlir icon indicating copy to clipboard operation
torch-mlir copied to clipboard

Unimplemented view op case

Open IanNod opened this issue 1 year ago • 1 comments

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

IanNod avatar Feb 02 '24 23:02 IanNod

@Shukla-Gaurav might be interested in grabbing this.

renxida avatar Feb 06 '24 00:02 renxida