[Frontend][ONNX] Fix softmax converter when input shape is dynamic#11507
[Frontend][ONNX] Fix softmax converter when input shape is dynamic#11507AndrewZhaoLuo merged 2 commits intoapache:mainfrom
Conversation
9aabbe7 to
4302b50
Compare
4302b50 to
b5f44dc
Compare
AndrewZhaoLuo
left a comment
There was a problem hiding this comment.
I see, LGTM. Yes this dynamism support stuff can be confusing and inconsistent sometimes. There are failing tests with somewhat scary errors so please take a look at those.
|
Hi @AndrewZhaoLuo, thanks for your reply. Consider the testing relay graph I found that when the target is cuda, the TIR lowering from softmax contains which seems to allocate warp memory with any. I am not sure why the reason behind the problem is that cuda's softmax does not support dynamic shapes? or is it a softmax schedule issue? Can anyone give me some hints? |
|
I'm not aware of dynamism support for softmax in CUDA but my guess is it's a schedule issue. I'm fine with you marking the dynamic tests as skip with cuda target. Just add a TODO please |
|
@AndrewZhaoLuo got it. I've marked cuda as xfailed and added a TODO comment. |
When I run the onnx version mobilenet_v1 from here without freeze_params, I meet an error:
This is caused by Softmax encountering an input with a dynamic shape and using it to construct reshape.
I think simple solution is to directly create Softmax when axis==-1.
I also rewrite the Softmax test to cover dynamic case.
@blackkker @AndrewZhaoLuo @mbrookhart please give it a look.
Thanks for contributing to TVM! Please refer to guideline https://tvm.apache.org/docs/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from Reviewers by @ them in the pull request thread.