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/03/03 22:26:56 UTC
[GitHub] [tvm] tkonolige opened a new pull request #10474: [TOPHUB] Remove tophub context from VM and Graph Executor
tkonolige opened a new pull request #10474:
URL: https://github.com/apache/tvm/pull/10474
Remove tophub context from VM and Graph Executor because 1. it is no longer up to date and 2. it causes differences in lowering between vm.VMCompiler.optimize and vm.VMCompiler.lower.
Will this cause any impacts? I'm not sure how much tophub is used.
@masahi @comaniac
--
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 #10474: [TOPHUB] Remove tophub context from VM and Graph Executor
Posted by GitBox <gi...@apache.org>.
masahi commented on pull request #10474:
URL: https://github.com/apache/tvm/pull/10474#issuecomment-1059476650
> @masahi It looks like using the fallback schedules caused CI to fail for this pr. So unfortunately I guess that could count as a perf regression.
Ok, so the CI is really pulling the tophub GPU schedule for mobilenet v2...
--
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] comaniac commented on pull request #10474: [TOPHUB] Remove tophub context from VM and Graph Executor
Posted by GitBox <gi...@apache.org>.
comaniac commented on pull request #10474:
URL: https://github.com/apache/tvm/pull/10474#issuecomment-1058628299
Although I'm not 100% for sure, I'm afraid of performance impact. The tricky points are:
1. Although TOPHUB does out of date, many tuned schedules are still applicable. For example, the tile sizes tuned for Conv2Ds in ResNet on NVIDIA T4, V100, etc should still applicable, as AutoTVM and TVM CUDA codegne are rarely updated in the past year.
2. We do know that some ops (especially Conv2Ds on x86 and CUDA) do demonstrate obvious performance improvements with the TOPHUB schedules. General speaking, as long as we still support AutoTVM, we should not abandon TOPHUB.
--
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] tkonolige commented on pull request #10474: [TOPHUB] Remove tophub context from VM and Graph Executor
Posted by GitBox <gi...@apache.org>.
tkonolige commented on pull request #10474:
URL: https://github.com/apache/tvm/pull/10474#issuecomment-1058716240
@comaniac My goal with this PR was the fix the issue that some codepaths use the tophub context and some do not. This leads the really confusing results where `VMCompiler.optimize` and `VMCompiler.lower` result in different lowered functions (usually different layouts due to alter op layout). I see three ways to make everything consistent:
1. Require users to manually use tophub (this PR). It seems like this approach may have a negative performance impact if the user is not using tuned schedules.
2. Use tophub as the default context when no other context has been specified. This will make `VMCompiler.optimize` and `VMCompiler.lower` consistent in their results. On the other hand, some alteroplayout code may no longer fire correctly because it depends on a fallback context (unclear if it was even correct in the first place).
3. Add `with tophub` to `VMCompiler.optimize`. This doesn't solve the underlying problem. I expect us see more inconsistent results in other parts of the codebase where tophub is not used.
1. or 2. appear to be the best solutions. Do you prefer 2. over 1.? If so, I will submit a PR with that change.
--
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 #10474: [TOPHUB] Remove tophub context from VM and Graph Executor
Posted by GitBox <gi...@apache.org>.
masahi commented on pull request #10474:
URL: https://github.com/apache/tvm/pull/10474#issuecomment-1059437987
Is "not firing this code path" a bad thing? To me it looks like it only prevents fallback schedules to be applied, and alter layout itself still kicks in?
--
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] tkonolige commented on pull request #10474: [TOPHUB] Remove tophub context from VM and Graph Executor
Posted by GitBox <gi...@apache.org>.
tkonolige commented on pull request #10474:
URL: https://github.com/apache/tvm/pull/10474#issuecomment-1059459513
@masahi It looks like using the fallback schedules caused CI to fail for this pr. So unfortunately I guess that could count as a perf regression.
--
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 #10474: [TOPHUB] Remove tophub context from VM and Graph Executor
Posted by GitBox <gi...@apache.org>.
masahi commented on pull request #10474:
URL: https://github.com/apache/tvm/pull/10474#issuecomment-1058748592
> some alteroplayout code may no longer fire correctly because it depends on a fallback context (unclear if it was even correct in the first place)
@tkonolige Can you point us to an example of such code? Sounds weird...
--
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] comaniac commented on pull request #10474: [TOPHUB] Remove tophub context from VM and Graph Executor
Posted by GitBox <gi...@apache.org>.
comaniac commented on pull request #10474:
URL: https://github.com/apache/tvm/pull/10474#issuecomment-1059461148
Please be aware that default schedule is not always valid on GPU, because a hand pick tile size may not fit to a certain GPU architecture.
IMHO, based on the above discussion this change might be worth to have a short RFC to inform the community, as TopHub has been used for a long while and we have no clue about the impact. If we are going to apply the change in this PR, at least a deprecate warning is necessary.
--
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] comaniac commented on pull request #10474: [TOPHUB] Remove tophub context from VM and Graph Executor
Posted by GitBox <gi...@apache.org>.
comaniac commented on pull request #10474:
URL: https://github.com/apache/tvm/pull/10474#issuecomment-1059525183
> Do RFCs have the broadest reach? Or would it make more sense to post on the forum? I'm not sure who the users of tophub are.
Posting to the forum is also fine. My intention is just making an announcement, because I believe now only 3 of us know that we are going to do this.
> How long should we provide a deprecation warning for? I'd prefer to have this fixed as soon as possible instead of waiting. We change a lot of things in tvm that are more impactful than this without warning.
Usually we provide a warning for a release cycle. For example, now is 0.9.dev, so the warning should be at the 0.9 release and remove at 0.10 (or 1.0 not sure what's going to happen). Of course this could be flexible as long as most community members have an agreement. This is also a reason of posting to the forum or filing an RFC.
--
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] tkonolige commented on pull request #10474: [TOPHUB] Remove tophub context from VM and Graph Executor
Posted by GitBox <gi...@apache.org>.
tkonolige commented on pull request #10474:
URL: https://github.com/apache/tvm/pull/10474#issuecomment-1059391521
@masahi If we set the default context to the tophub context, then this code will never fire: https://github.com/apache/tvm/blob/main/python/tvm/topi/x86/conv2d_alter_op.py#L98-L109. There a couple more similar blocks in this function that also will not fire.
--
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 #10474: [TOPHUB] Remove tophub context from VM and Graph Executor
Posted by GitBox <gi...@apache.org>.
masahi commented on pull request #10474:
URL: https://github.com/apache/tvm/pull/10474#issuecomment-1059452885
From my recent work on vnni dense, I remember that if I don't have `is_fallback` code path, some random (?) value was chosen to instantiate my schedule. So things should run I believe without `is_fallback`.
I think `is_fallback` is mostly for the case where autotvm is not used and developers want to apply more sensible default values than the ones chosen arbitrary by autotvm. I think the question is: are tophub schedules supposed to be better than those hand picked params in fallback schedules? If the answer is not a definite yes, I'm inclined to remove tophub altogether and possibly port their params to whatever `_get_default_config` is doing.
So how about this: We go ahead with this PR and remove tophub. If later someone complains about perf regression, which means they rely on tophub, we port tophub params to `_get_default_config`.
--
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] tkonolige commented on pull request #10474: [TOPHUB] Remove tophub context from VM and Graph Executor
Posted by GitBox <gi...@apache.org>.
tkonolige commented on pull request #10474:
URL: https://github.com/apache/tvm/pull/10474#issuecomment-1059445991
I'm not sure if the fallback schedules are necessary or not. We can try dropping them and see what happens?
--
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] comaniac commented on pull request #10474: [TOPHUB] Remove tophub context from VM and Graph Executor
Posted by GitBox <gi...@apache.org>.
comaniac commented on pull request #10474:
URL: https://github.com/apache/tvm/pull/10474#issuecomment-1058721769
Thanks for the explanation. I personally prefer 2 for sure as it minimizes the changes from user's perspective.
cc @masahi to see if there's any obvious concern for the alter op layout.
--
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] tkonolige commented on pull request #10474: [TOPHUB] Remove tophub context from VM and Graph Executor
Posted by GitBox <gi...@apache.org>.
tkonolige commented on pull request #10474:
URL: https://github.com/apache/tvm/pull/10474#issuecomment-1059515927
> Please be aware that default schedule is not always valid on GPU, because a hand pick tile size may not fit to a certain GPU architecture.
This is also true of the tophub schedules as they are not specific to a GPU model, just target kind.
> IMHO, based on the above discussion this change might be worth to have a short RFC to inform the community, as TopHub has been used for a long while and we have no clue about the impact. If we are going to apply the change in this PR, at least a deprecate warning is necessary.
Do RFCs have the broadest reach? Or would it make more sense to post on the forum? I'm not sure who the users of tophub are.
How long should we provide a deprecation warning for? I'd prefer to have this fixed as soon as possible instead of waiting. We change a lot of things in tvm that are more impactful than this without warning.
--
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 edited a comment on pull request #10474: [TOPHUB] Remove tophub context from VM and Graph Executor
Posted by GitBox <gi...@apache.org>.
masahi edited a comment on pull request #10474:
URL: https://github.com/apache/tvm/pull/10474#issuecomment-1059437987
Is "not firing this code path" a bad thing? To me it looks like it only prevents fallback schedules to be applied, and alter layout itself still kicks in?
If the tophub schedule is supposed to be better than that fallback ones, 2 seems safe to me. We can also remove ` if cfg.is_fallback:` code if it no longer fires and if we are ok with 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