Skip to content
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

accumulate on Metal sometimes fails due to weaker @synchronize guarantees than on other platforms #10

Open
anicusan opened this issue Nov 12, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@anicusan
Copy link
Member

Possible fixes:

  • From @maleadt on Slack: "the default KA.jl @synchronize for Metal.jl calls threadgroup_barrier with flag=Metal.MemoryFlagThreadGroup, i.e., it only orders memory operations to threagroup memory. If it's device memory, you could try MemoryFlagDevice"
  • Implement algorithm without decoupled opportunistic lookback.
@anicusan anicusan added the bug Something isn't working label Nov 12, 2024
@anicusan
Copy link
Member Author

anicusan commented Nov 13, 2024

Leaving here as a note: using Metal.MemoryFlagDevice did not help (though it probably makes it slower); the problem is that Metal doesn't flush caches of device arrays after synchronize statements. It seems opportunistic lookback just cannot be implemented on Macs (see post and issue); turns out they had to change the WebGPU standard because of it. Isn't parallelism fun when your algorithm has a 0.38% chance of returning cobblers on just one out of 5 backends?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant