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

[FIX][AUTOTVM] Make autotvm work with spawn #6790

Merged
merged 1 commit into from Oct 29, 2020

Conversation

tkonolige
Copy link
Contributor

Like #6671 this PR fixes autotvm when using the spawn start method for multiprocessing. I've added some tests to make sure that things work with spawn in the CI. I've also added notices to the tutorials letting users know that they will not run on windows or macOS.

Here are performance results for tutorials/autotvm/tune_conv2d_cuda.py with n_trials = 100.

This PR

XGB iter:   0	tr-a-recall@64: 0.661270	tr-map: 0.100000
XGB iter:  25	tr-a-recall@64: 0.754100	tr-map: 1.000000
XGB stopped. Best iteration: [29] tr-a-recall@64:0.75971	tr-map:1.00000
XGB train: 1.08	obs: 64	error: 43	n_cache: 64
SA iter: 50	last_update: 49	max-0: 5.39	max-1: 6.08	temp: 0.90	elapsed: 3.41
SA iter: 100	last_update: 98	max-0: 5.72	max-1: 6.25	temp: 0.80	elapsed: 6.82
SA iter: 150	last_update: 148	max-0: 5.89	max-1: 6.51	temp: 0.70	elapsed: 10.38
SA iter: 200	last_update: 197	max-0: 5.97	max-1: 6.51	temp: 0.60	elapsed: 14.18
SA iter: 250	last_update: 248	max-0: 6.09	max-1: 6.51	temp: 0.50	elapsed: 18.02
SA iter: 300	last_update: 298	max-0: 6.15	max-1: 6.51	temp: 0.40	elapsed: 21.72
SA iter: 350	last_update: 348	max-0: 6.17	max-1: 6.51	temp: 0.30	elapsed: 25.30
SA iter: 400	last_update: 398	max-0: 6.21	max-1: 6.51	temp: 0.20	elapsed: 28.79
SA iter: 450	last_update: 447	max-0: 6.24	max-1: 6.51	temp: 0.10	elapsed: 32.20
SA iter: 500	last_update: 493	max-0: 6.25	max-1: 6.51	temp: 0.00	elapsed: 35.35
SA iter: 500	last_update: 493	elapsed: 35.35


main

XGB iter:   0	tr-a-recall@64: 0.610293	tr-map: 0.500000
XGB iter:  25	tr-a-recall@64: 0.671535	tr-map: 1.000000
XGB stopped. Best iteration: [29] tr-a-recall@64:0.67466	tr-map:1.00000
XGB train: 1.02	obs: 64	error: 50	n_cache: 64
SA iter: 50	last_update: 49	max-0: 5.41	max-1: 6.23	temp: 0.90	elapsed: 3.41
SA iter: 100	last_update: 98	max-0: 5.58	max-1: 6.23	temp: 0.80	elapsed: 6.94
SA iter: 150	last_update: 145	max-0: 5.72	max-1: 6.37	temp: 0.70	elapsed: 10.61
SA iter: 200	last_update: 198	max-0: 5.76	max-1: 6.37	temp: 0.60	elapsed: 14.25
SA iter: 250	last_update: 247	max-0: 5.83	max-1: 6.45	temp: 0.50	elapsed: 17.87
SA iter: 300	last_update: 298	max-0: 6.03	max-1: 6.45	temp: 0.40	elapsed: 21.81
SA iter: 350	last_update: 349	max-0: 6.07	max-1: 6.45	temp: 0.30	elapsed: 25.57
SA iter: 400	last_update: 397	max-0: 6.11	max-1: 6.45	temp: 0.20	elapsed: 28.99
SA iter: 450	last_update: 444	max-0: 6.13	max-1: 6.45	temp: 0.10	elapsed: 32.60
SA iter: 500	last_update: 489	max-0: 6.14	max-1: 6.45	temp: 0.00	elapsed: 35.76
SA iter: 500	last_update: 489	elapsed: 35.76

This is on a 64-core x86 ubuntu system with python 3.6.9. Performance is the same.

Like apache#6671 this PR fixes autotvm when using the spawn start method for
multiprocessing. I've added some tests to make sure that things work
with spawn in the CI.
@merrymercy merrymercy merged commit 8e6481e into apache:main Oct 29, 2020
@merrymercy
Copy link
Member

@tkonolige Thanks! It is merged.

trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Dec 2, 2020
Like apache#6671 this PR fixes autotvm when using the spawn start method for
multiprocessing. I've added some tests to make sure that things work
with spawn in the CI.
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Dec 4, 2020
Like apache#6671 this PR fixes autotvm when using the spawn start method for
multiprocessing. I've added some tests to make sure that things work
with spawn in the CI.
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Dec 4, 2020
Like apache#6671 this PR fixes autotvm when using the spawn start method for
multiprocessing. I've added some tests to make sure that things work
with spawn in the CI.
@merrymercy
Copy link
Member

merrymercy commented Dec 5, 2020

@tkonolige This PR introduces cloudpickle as a dependency.

Could you add this to https://github.com/apache/tvm/blob/main/docs/install/from_source.rst#python-dependencies and all autotvm tutorials (

# pip3 install --user psutil xgboost tornado
and other places)?

Or can we do not introduce cloudpicke when fork is used?

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.

None yet

2 participants