iree
iree copied to clipboard
[spirv] PyTorch AlexNet returns zeros on Apple M GPUs
What happened?
On running Alexnet infernece on macos with SHARK, we see the output tensor is zero.
Steps to reproduce your issue
mlir: https://storage.googleapis.com/shark_tank/alexnet_torch/alexnet_torch.mlir
input: https://storage.googleapis.com/shark_tank/alexnet_torch/inputs.npz
golden_output: https://storage.googleapis.com/shark_tank/alexnet_torch/golden_out.npz
Compile and Run commands :
./iree-compile \
--iree-input-type=none \
--iree-vm-bytecode-module-output-format=flatbuffer-binary \
--iree-hal-target-backends=vulkan \
--iree-llvm-target-cpu-features=host \
-iree-vulkan-target-triple=m1-moltenvk-macos \
--iree-stream-resource-index-bits=64 \
--iree-vm-target-index-bits=64 \
/path_to/alexnet_torch_alexnet_torch.mlir -o alexnet_test.vmfb
-----
./iree-run-module \
--module_file=alexnet_test.vmfb \
--device=vulkan \
--entry_function=forward \
--function_input=@/_path_to_/alexnet_torch_inputs.npy
What component(s) does this issue relate to?
No response
Version information
No response
Additional context
Converted npz to npy (to use with iree-run-module) using the following steps:
import numpy as np
x = np.load("PATH TO input.npz")
np.save("PATH TO input.npy", x["arr_0"])
x.close()
@antiagainst Can you take a look at this one to assign priority?
It seems those files are moved? wget
reports "Not Found". Could you provide the new locations for them?
Here are the new locations:
mlir: https://storage.googleapis.com/shark_tank/latest/alexnet_torch/alexnet_torch.mlir
input: https://storage.googleapis.com/shark_tank/latest/alexnet_torch/inputs.npz
golden_output: https://storage.googleapis.com/shark_tank/latest/alexnet_torch/golden_out.npz
Closing this for now given this is Vulkan on MoltenVK -- we have native Metal support and that's the way forward.