[PyTorch] [Frontend] Add support for 'aten::new_zeros' & 'aten::copy_'#9375
[PyTorch] [Frontend] Add support for 'aten::new_zeros' & 'aten::copy_'#9375hgt312 wants to merge 1 commit intoapache:mainfrom
Conversation
|
Please add tests. Also, we need to discuss
|
|
Yes we should definitely add a warning at least. A safer alternative, which I'm more comfortable with, is make use of the custom convert map tvm/python/tvm/relay/frontend/pytorch.py Line 3810 in 0df4edc copy_ and pass it to from_torch. If that's acceptable for your use cases, I think this is the most reasonable compromise.
|
|
Good suggestion. We should definitely do so for our use cases in particular, although I guess the same issue may happen periodically when someone tries to work on BART lol |
|
Yeah, users need to acknowledge that TVM cannot represent all PT models. It is better to reject such models early than returning corrupted models. Since this request comes up too often, how about we do the following:
|
|
@comaniac @masahi I find that the output will not be correct due to something like In BART, it is from a function, the whole function is not inplace. Also, I find that after pytorch/pytorch#52063 (torch version >= 1.9), we can use and the subgraph can be convert to ONNX's Maybe the torch->onnx path will work for these models? |
|
closed now |
|
I've tried |
aten::new_zeros&aten::copy_This pr enables convert from 'bart_base' model in transformers
@comaniac