-
Notifications
You must be signed in to change notification settings - Fork 10.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
Vulkan Phi Fix for AMD Proprietary Drivers #5260
Conversation
Nice, this seems to work pretty well. I don't get nonsense generations anymore, but there are some "issues" with consistency. Testing with fixed seed and 0 temperature give different outputs depending on the amount of layers offloaded. Not a big deal though.
|
GPU give slightly different results in floating point operations compared to CPU, so even with CUDA or HIP there may be differences. But I also had to build an entire matrix multiplication shader myself since there is no BLAS library for Vulkan, and I suspect there might be some inaccuracies still in there. It's at least mostly correct now and pretty fast. |
I'm not observing the same level of discrepency with other models... Anyways, as long as the output is coherent, that's good enough for me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyways, I just tried with the CLBlast backend, and I get the exact same behaviour as this PR, so it's something about this model specifically that makes it have different outputs between CPU and GPU. So everything is good! |
It does pass it, yeah. Since Vulkan can run on a whole bunch of devices, the tests can work one some and fail on other devices or drivers, like in this case on proprietary AMD drivers. On the open source AMD drivers it's fine. |
test-backend-ops is failing on the Vulkan backend for me on AMDVLK (tested on this PR): test-backend-ops-amdvlk.txt |
Yes, that's expected (and not related to amdvlk), but GELU works. I haven't spent time fixing tests yet cause they came up pretty late and I've had my own testing framework by then, which focuses on getting models to work, not general compliance. But I'll get around to it. |
* Replace tanh to avoid NaN in gelu shader on AMD proprietary driver * Fix another Vulkan CPY buffer size bug
* Replace tanh to avoid NaN in gelu shader on AMD proprietary driver * Fix another Vulkan CPY buffer size bug
Fixes #5243
I also found a CPY buffer size bug that I fixed alongside this. Let me know if it works @stduhpf