-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mobilenetv2 doesn't work with Vulkan backend #6516
Comments
|
Hi @sternezsl, thanks for raising this issue!
I definitely appreciate the help on this :) I did encounter an issue when trying out the mobilenet example, but it was separate from the issues that you have described. The problem that I encountered back then was related to the runner binary, not the Vulkan export, and I decided to replace the example with a simpler one because I didn't have time to look into the failure before the beta release of ExecuTorch. The fact that you were able to get MobileNet V2 working suggests that the problem with the runner binary has been fixed, however. If we can verify that mobilenet works on main then it would make sense to make the example mobilenet once more (y)
I also became aware of this regression while trying to commit the new reduce shader, but decided to go ahead with it for the sake of updating the implementation to use a more modern pattern of being agnostic to memory layouts, and because the new implementation is more performant for the single reduction dim case. Also, at the time mobilenet v2 was the only model that I was working with at the time that used When I first committed the new reduce shader, there was an issue with the regression since the new implementation cannot handle reducing over multiple tensor dimensions. However, I have since landed #6488 as well which addresses this. The linked PR essentially adds the ability for operators to implement a specific check function to detect whether they are supported by Vulkan, and after the PR was committed the Please let me know if you're still running into problems on the current main branch.
I am currently working on #6636 which will fix errors like these. However, in the meantime if you lower to Vulkan with the following settings:
It should fix the issue as well. |
🐛 Describe the bug
I can successfully export the vulkan pte. When I run the model with
I get the error:
I inspect the code and find that the input tensor's packed_dim is 0 rather than 2(WHCN::kChannelsDim). If I comment out the
check_conv_args
function, then I run into another problem:I noticed that @SS-JIA replaced the
mobilenet
demo with aAdd
one in the tutorial a few days ago. I guess you know the problem. I try to fix the problem. unfortunately, presently I do not know much about Vulkan backend, could you please give me some hints and I'll try to fix it.The following is the model conversion script:
Versions
PyTorch version: 2.5.0+git8a0ce38
Is debug build: False
CUDA used to build PyTorch: 11.8
ROCM used to build PyTorch: N/A
VULKAN used to build PyTorch: True
OS: Fedora Linux Asahi Remix 40 (KDE Plasma) (aarch64)
GCC version: (GCC) 14.2.1 20240912 (Red Hat 14.2.1-3)
Clang version: 18.1.7 (https://github.com/llvm/llvm-project 768118d1ad38bf13c545828f67bd6b474d61fc55)
CMake version: version 3.20.0
Libc version: glibc-2.39
Vulkan Driver Version: Mesa 24.3.0-devel (git-f05157f591),
Vulkan Instance Version: 1.3.290
Python version: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 19:56:21) [GCC 11.3.0] (64-bit runtime)
Python platform: Linux-6.11.3-dimilar-4-1-edge-ARCH+-aarch64-with-glibc2.39
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True
CPU: Apple M1 Max
Versions of relevant libraries:
[pip3] flake8==6.1.0
[pip3] flake8-breakpoint==1.1.0
[pip3] flake8-bugbear==23.9.16
[pip3] flake8-comprehensions==3.14.0
[pip3] flake8-plugin-utils==1.3.3
[pip3] flake8-pyi==23.5.0
[pip3] mypy-extensions==1.0.0
[pip3] numpy==1.25.0
[pip3] pytorch-sphinx-theme==0.0.19
[pip3] torchao==0.7.0+git6b529961
[pip3] torchvision==0.20.0a0+f851df1
[conda] numpy 1.25.0 pypi_0 pypi
[conda] pytorch-sphinx-theme 0.0.19 pypi_0 pypi
[conda] torchao 0.7.0+git6b529961 pypi_0 pypi
[conda] torchfix 0.5.0 pypi_0 pypi
[conda] torchvision 0.20.0a0+f851df1 pypi_0 pypi
The text was updated successfully, but these errors were encountered: