-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
The method from_numpy() not working on Mac when using Vulkan backend #6295
Comments
Thanks for sharing this! I would also like to share my findings based on this info.
It seems that the problem only appears with molten-vk >= 1.1.11 on macOS >= 12.5 (or 12.4, I don't have a machine for that lol). @bobcao3 Do you have any idea about what is happening? |
Maybe macOS relaxed synchronization or something weird, i think only way to figure this out is to debug this on higher macOS versions. ( We should start narrowing down the problem by adding a bunch of |
I'm testing with the following minimum script and it seems that import numpy as np
import taichi as ti
ti.init(ti.vulkan, offline_cache=False)
@ti.kernel
def foo(a: ti.types.ndarray()) -> ti.i32:
# adding ti.sync() here doesn't help
return a[1]
# there's an automatic sync for kernels with return values
x = np.array([4, 6])
print(foo(x)) # 0 (wrong)
print(x) # [4, 6] I'm now thinking about whether there could be an address alignment issue. |
After bisecting MoltenVK commits, I found that the problem was introduced in KhronosGroup/MoltenVK#1638, which enabled support for |
…6415) See #6295 (comment). Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…aichi-dev#6415) See taichi-dev#6295 (comment). Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Describe the bug
In the latest night-build release, the method
from_numpy()
is still not working on mac with Vulkan backend, but functional on Metal.To Reproduce
Log/Screenshots
Using Vulkan backend
Using Metal backend
Additional comments
The code even failed when I try to use a kernel to transfer the data from NumPy to taichi, and the only way to get a correct result is by using python for-loop. Also, I found that the method stopped working after the
taichi-nightly-1.1.3.post20220828
release.The text was updated successfully, but these errors were encountered: