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

How to integrate latest torch-mlir with torch stable <= 2.4.0?

Open qingyunqu opened this issue 1 year ago • 3 comments

Becuase of torch have changed the signature of aten.scale_dot_product_attention, the relative testcases failed when the torch is not latest nightly version. See also https://github.com/llvm/torch-mlir/pull/3627 and https://github.com/llvm/torch-mlir/pull/3666. It's hard for me when I want to integrate latest torch-mlir with torch stable <= 2.4.0.

Is there any possible to provide compatibility? @vivekkhandelwal1 @rsuderman @stellaraccident

In short term, I think I could checkout a new branch and manually cherry pick commits which I need, until the problem have been resolved or torch==2.5.0 stable version have been released.

qingyunqu avatar Aug 29 '24 08:08 qingyunqu

We should just create a 2.4 compatible tag and upgrade head to 2.5. Torch is moving too fast to have a large at head compatibility window.

If you have a branch that is 2.5 ready, we can land that.

stellaraccident avatar Aug 29 '24 13:08 stellaraccident

Oh wait, in my mind, 2.5 was already released but that happens in the near future.

Shall we start a 2.5 branch in torch-mlir for the early adoption and then land it when torch releases?

I also wish we had a way to deal with these signature changes in a less disruptive way.

stellaraccident avatar Aug 29 '24 14:08 stellaraccident

Oh wait, in my mind, 2.5 was already released but that happens in the near future.

Shall we start a 2.5 branch in torch-mlir for the early adoption and then land it when torch releases?

I also wish we had a way to deal with these signature changes in a less disruptive way.

Something like tf onnx's method is to create a old version op like aten.scale_dot_product_attention_v1, both keep aten.scale_dot_product_attention_v1 and aten.scale_dot_product_attention in torch-mlir. If do that, I think we should change jit_ir_importer and fx_importer ?

qingyunqu avatar Aug 29 '24 16:08 qingyunqu