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
fix: metal on conda on a13 and higher #4483
base: master
Are you sure you want to change the base?
Conversation
fixes on apple silicon #2226 |
Bad spacing. Don't use globals. |
tinygrad/runtime/ops_metal.py
Outdated
@@ -11,10 +11,20 @@ def wait_check(cbuf: Any): | |||
if (error := cbuf.error()) is not None: | |||
raise RuntimeError(error) | |||
|
|||
def get_workaround_lib(device): | |||
options = Metal.MTLCompileOptions.new() |
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.
bad indent-width
Can we submit this request with the correct requestType directly instead of using this hack? |
No, I looked for other ways but apple expects you not to use libraryDataContents and therefore store incomplete library data on some versions. The only way to do it properly is either to recompile and pray for system cache or use things with very limited support (BinaryArchive). |
Changes
|
If you were to call private C++ apis from Metal internals you could send the proper requestType but that wouldn't be supported everywhere, this hack is not as bad. |
metal not compiling successfully on conda is due to a wrong compile requestType. This can be fixed the following ways:
This fix is using the last way. It will work on any mac which supports dynamic library and will only trigger then. For older devices it won't change anything.