Skip to content

[RUNTIME][METAL] Fix multithreading access of metal runtime#16605

Merged
tqchen merged 1 commit intoapache:mainfrom
MasterJH5574:tvm-dev/2024-02-18-metal-thread
Feb 18, 2024
Merged

[RUNTIME][METAL] Fix multithreading access of metal runtime#16605
tqchen merged 1 commit intoapache:mainfrom
MasterJH5574:tvm-dev/2024-02-18-metal-thread

Conversation

@MasterJH5574
Copy link
Copy Markdown
Contributor

This PR fixes a bug where metal runtime cannot be accessed from multiple threads. This is because the ThreadLocal entry initialization happens during global workspace initialization, meaning other threads that tries to use metal runtime later cannot have the thread local entry correctly initialized.

This PR fixes the problem by always use nullptr fallback and lookup at the global workspace for default stream.


Co-authored-by: Tianqi Chen tqchenml@gmail.com

This PR fixes a bug where metal runtime cannot be accessed from multiple threads.
This is because the ThreadLocal entry initialization happens during global workspace
initialization, meaning other threads that tries to use metal runtime later cannot
have the thread local entry correctly initialized.

This PR fixes the problem by always use nullptr fallback and lookup at the
global workspace for default stream.
@tqchen tqchen merged commit f0c28a0 into apache:main Feb 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants