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

[WIP] Fix LocalBuilder on macOS with python 3.8. #6083

Merged
merged 1 commit into from
Jul 17, 2020

Conversation

tkonolige
Copy link
Contributor

Python 3.8 changes the default way multiprocessing creates new processes on macOS from forking to spawing. Spawning requires all objects to be picklable. Nested functions and lambdas are not picklable, so this commit fixes the one instance of nested functions in the codebase that was causing issues.

Although I've fixed the error from objects not being picklable, I'm getting an error in tests/python/unittest/test_autotvm_measure.py where registered tasks aren't found. Looking in python/tvm/autotvm/measure/local_executor.py, the global TASK_TABLE is empty in some child processes. The error only occurs with python 3.8 and pytest. Running tests/python/unittest/test_autotvm_measure.py directly (without pytest) gives no errors. I'd assume this issue is related to multiprocessing.

Python 3.8 changes the default way multiprocessing creates new processes
on macOS from forking to spawing. Spawning requires all objects to be
picklable. Nested functions and lambdas are not picklable, so this
commit fixes the one instance of nested functions in the codebase that
was causing issues.
@tkonolige
Copy link
Contributor Author

@tqchen @junrushao1994

@tqchen tqchen merged commit 378a85a into apache:master Jul 17, 2020
@tqchen
Copy link
Member

tqchen commented Jul 17, 2020

Thanks @tkonolige !

trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
Python 3.8 changes the default way multiprocessing creates new processes
on macOS from forking to spawing. Spawning requires all objects to be
picklable. Nested functions and lambdas are not picklable, so this
commit fixes the one instance of nested functions in the codebase that
was causing issues.
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
Python 3.8 changes the default way multiprocessing creates new processes
on macOS from forking to spawing. Spawning requires all objects to be
picklable. Nested functions and lambdas are not picklable, so this
commit fixes the one instance of nested functions in the codebase that
was causing issues.
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Sep 2, 2020
Python 3.8 changes the default way multiprocessing creates new processes
on macOS from forking to spawing. Spawning requires all objects to be
picklable. Nested functions and lambdas are not picklable, so this
commit fixes the one instance of nested functions in the codebase that
was causing issues.
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Sep 3, 2020
Python 3.8 changes the default way multiprocessing creates new processes
on macOS from forking to spawing. Spawning requires all objects to be
picklable. Nested functions and lambdas are not picklable, so this
commit fixes the one instance of nested functions in the codebase that
was causing issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants