You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/12/06 10:39:29 UTC
[GitHub] [tvm] masahi opened a new pull request, #13561: [MetaSchedule] Restore `num_threads` parameter in tuning API
masahi opened a new pull request, #13561:
URL: https://github.com/apache/tvm/pull/13561
It was removed in https://github.com/apache/tvm/pull/12895.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] masahi merged pull request #13561: [MetaSchedule] Restore `num_threads` parameter in tuning API
Posted by GitBox <gi...@apache.org>.
masahi merged PR #13561:
URL: https://github.com/apache/tvm/pull/13561
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] masahi commented on pull request #13561: [MetaSchedule] Restore `num_threads` parameter in tuning API
Posted by GitBox <gi...@apache.org>.
masahi commented on PR #13561:
URL: https://github.com/apache/tvm/pull/13561#issuecomment-1339843228
The main use case of this param is for tuning on a high-core system shared by many users. Currently if one user starts tuning, it occupies all CPU resources, which disrupts other users. So the goal is to limit the number of cores used by MS throughout the tuning process (evo search, post order apply, XGB training, builder / runner).
Also, `tune_tir` API has `num_threads` param as well.
https://github.com/apache/tvm/blob/6780c9f87db6620409f8f58c2c2925c7bd7b6681/python/tvm/meta_schedule/tir_integration.py#L57
> I would suggest using a better name because num_threads can be confusing
Agreed, but that's what `TuneContext` calls... I can replace `num_threads` in the high-level API with `max_workers` or something, and initialize `TuneContext` by `num_threads=max_workers`. If people this is better I can do that, otherwise I'd keep the existing convention.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] junrushao commented on pull request #13561: [MetaSchedule] Restore `num_threads` parameter in tuning API
Posted by GitBox <gi...@apache.org>.
junrushao commented on PR #13561:
URL: https://github.com/apache/tvm/pull/13561#issuecomment-1340501073
I don't have a clear idea (very bad at naming). Perhaps @tqchen you could suggest?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] masahi commented on a diff in pull request #13561: [MetaSchedule] Restore `num_threads` parameter in tuning API
Posted by GitBox <gi...@apache.org>.
masahi commented on code in PR #13561:
URL: https://github.com/apache/tvm/pull/13561#discussion_r1041836003
##########
tests/python/contrib/test_hexagon/metaschedule_e2e/test_resnet50_int8.py:
##########
@@ -125,8 +142,8 @@ def tune_vrmpy_auto_tensorize(mod, params, hexagon_launcher):
# num_trials_per_iter=32,
# max_trials_per_task=128,
# strategy="evolutionary",
- builder=get_hexagon_local_builder(),
- runner=get_hexagon_rpc_runner(hexagon_launcher, number=20),
+ builder=get_hexagon_local_builder(max_workers=num_threads),
Review Comment:
I think `num_cores` is at least better than `num_threads`, but I don't have better alternatives other than verbose ones like `num_cores_tuning` etc.
So I propose to use `num_cores` in `tune_relay` and `tune_tir` , thoughts?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] spectrometerHBH commented on pull request #13561: [MetaSchedule] Restore `num_threads` parameter in tuning API
Posted by GitBox <gi...@apache.org>.
spectrometerHBH commented on PR #13561:
URL: https://github.com/apache/tvm/pull/13561#issuecomment-1339563361
I would suggest using a better name because num_threads can be confusing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] zxybazh commented on a diff in pull request #13561: [MetaSchedule] Restore `num_threads` parameter in tuning API
Posted by GitBox <gi...@apache.org>.
zxybazh commented on code in PR #13561:
URL: https://github.com/apache/tvm/pull/13561#discussion_r1041342637
##########
tests/python/contrib/test_hexagon/metaschedule_e2e/test_resnet50_int8.py:
##########
@@ -125,8 +142,8 @@ def tune_vrmpy_auto_tensorize(mod, params, hexagon_launcher):
# num_trials_per_iter=32,
# max_trials_per_task=128,
# strategy="evolutionary",
- builder=get_hexagon_local_builder(),
- runner=get_hexagon_rpc_runner(hexagon_launcher, number=20),
+ builder=get_hexagon_local_builder(max_workers=num_threads),
Review Comment:
I also find the name of `num_threads` maybe a bit confusing for builder / runners because they are managed with PopenPool Workers, basically new processes. We can consider some better naming, maybe `parallelism`?
##########
python/tvm/meta_schedule/relay_integration.py:
##########
@@ -249,6 +249,7 @@ def tune_relay(
strategy: SearchStrategy.SearchStrategyType = "evolutionary",
seed: Optional[int] = None,
module_equality: str = "structural",
+ num_threads: Union[Literal["physical", "logical"], int] = "physical",
Review Comment:
Do we have some logic to process `physical` `logical` as input here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] tvm-bot commented on pull request #13561: [MetaSchedule] Restore `num_threads` parameter in tuning API
Posted by GitBox <gi...@apache.org>.
tvm-bot commented on PR #13561:
URL: https://github.com/apache/tvm/pull/13561#issuecomment-1339120797
<!---bot-comment-->
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from [Reviewers](https://github.com/apache/incubator-tvm/blob/master/CONTRIBUTORS.md#reviewers) by @-ing them in a comment.
<!--bot-comment-ccs-start-->
* cc @Hzfengsy, @elvin-n, @junrushao <sub>See [#10317](https://github.com/apache/tvm/issues/10317) for details</sub><!--bot-comment-ccs-end-->
<sub>Generated by [tvm-bot](https://github.com/apache/tvm/blob/main/ci/README.md#github-actions)</sub>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] masahi commented on a diff in pull request #13561: [MetaSchedule] Restore `num_threads` parameter in tuning API
Posted by GitBox <gi...@apache.org>.
masahi commented on code in PR #13561:
URL: https://github.com/apache/tvm/pull/13561#discussion_r1041396919
##########
python/tvm/meta_schedule/relay_integration.py:
##########
@@ -249,6 +249,7 @@ def tune_relay(
strategy: SearchStrategy.SearchStrategyType = "evolutionary",
seed: Optional[int] = None,
module_equality: str = "structural",
+ num_threads: Union[Literal["physical", "logical"], int] = "physical",
Review Comment:
Yes, this param eventually reaches to the `TuneContext` constructor and processed at
https://github.com/apache/tvm/blob/main/python/tvm/meta_schedule/tune_context.py#L126-L130
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] junrushao commented on pull request #13561: [MetaSchedule] Restore `num_threads` parameter in tuning API
Posted by GitBox <gi...@apache.org>.
junrushao commented on PR #13561:
URL: https://github.com/apache/tvm/pull/13561#issuecomment-1339425339
I am not sure it should be a top-level parameter as it’s less frequently used by introductory-level users, but don’t have much strong opinions.
In the meantime, I’m not sure if using the same num_threads for xgb and for evo search is a good idea because I assume xgb prefers physical cores? I don’t have numbers handy so I’m not 100% sure.
Removed this because @spectrometerHBH @Hzfengsy @jinhongyii @MasterJH5574 suggested to, so I’d love to hear more from you guys.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] junrushao commented on pull request #13561: [MetaSchedule] Restore `num_threads` parameter in tuning API
Posted by GitBox <gi...@apache.org>.
junrushao commented on PR #13561:
URL: https://github.com/apache/tvm/pull/13561#issuecomment-1341581309
The reason that I don’t like “cores” is that they are threads, which are not necessarily related to physical cpu cores. Perhaps num_threads makes more sense at the moment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] masahi commented on pull request #13561: [MetaSchedule] Restore `num_threads` parameter in tuning API
Posted by GitBox <gi...@apache.org>.
masahi commented on PR #13561:
URL: https://github.com/apache/tvm/pull/13561#issuecomment-1342170860
Replaced `num_threads` with `num_tuning_cores` in the API.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] masahi commented on pull request #13561: [MetaSchedule] Restore `num_threads` parameter in tuning API
Posted by GitBox <gi...@apache.org>.
masahi commented on PR #13561:
URL: https://github.com/apache/tvm/pull/13561#issuecomment-1341600167
I think "cores" is better because we are also using this parameter to set the number of workers used by builder / runner. Also, when a user wants to limit the amount of CPU resources used by MS, they would think in terms of the number of "cores", not "threads". So as an API, "core" sounds more intuitive to me.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] masahi commented on a diff in pull request #13561: [MetaSchedule] Restore `num_threads` parameter in tuning API
Posted by GitBox <gi...@apache.org>.
masahi commented on code in PR #13561:
URL: https://github.com/apache/tvm/pull/13561#discussion_r1041459969
##########
tests/python/contrib/test_hexagon/metaschedule_e2e/test_resnet50_int8.py:
##########
@@ -125,8 +142,8 @@ def tune_vrmpy_auto_tensorize(mod, params, hexagon_launcher):
# num_trials_per_iter=32,
# max_trials_per_task=128,
# strategy="evolutionary",
- builder=get_hexagon_local_builder(),
- runner=get_hexagon_rpc_runner(hexagon_launcher, number=20),
+ builder=get_hexagon_local_builder(max_workers=num_threads),
Review Comment:
I'm trying to come up with a name that should make it obvious that it is for tuning-time parallelism.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] zxybazh commented on pull request #13561: [MetaSchedule] Restore `num_threads` parameter in tuning API
Posted by GitBox <gi...@apache.org>.
zxybazh commented on PR #13561:
URL: https://github.com/apache/tvm/pull/13561#issuecomment-1341597453
Just want to add that Runner & Builder are using new processes, that's why we may want to consider using other terminology. On the other hand, if we don't have very good idea on new naming, I don't mind just sticking to the current naming nun_threads before that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] masahi commented on pull request #13561: [MetaSchedule] Restore `num_threads` parameter in tuning API
Posted by GitBox <gi...@apache.org>.
masahi commented on PR #13561:
URL: https://github.com/apache/tvm/pull/13561#issuecomment-1341502709
I'm going to go to with `num_tuning_cores` per discussion with @zxybazh, if there is no objection. For now I'll keep `num_threads` in `TuneContext`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] junrushao commented on pull request #13561: [MetaSchedule] Restore `num_threads` parameter in tuning API
Posted by GitBox <gi...@apache.org>.
junrushao commented on PR #13561:
URL: https://github.com/apache/tvm/pull/13561#issuecomment-1341650922
The argument that builder/runner workers are using processes rather than threads makes sense to me. Thanks for the explanation! Then I'm happy with the "core" terminology
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org