-
Notifications
You must be signed in to change notification settings - Fork 173
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
Provide a way to initialize connection to dynolog without triggering cupti API #1032
Comments
@yinghai Just wanted to share where dynolog registry happens. https://github.com/pytorch/kineto/blob/main/libkineto/src/init.cpp#L233 This will under the hood call updateBaseConfig that tries to construct the DaemonConfigloader and thus dynolog registry takes place We primarily need to call updateBaseConfig() in init to initialize dynolog, this does not trigger CUPTI as such. |
Fix pytorch/kineto#1032 See pytorch/kineto#1035 for testplan Pull Request resolved: #147015 Approved by: https://github.com/sraikund16, https://github.com/Skylion007
@yinghai let's wait for pytorch nightly to catch up, and we can check if this works! |
Context in facebookincubator/dynolog#286.
In pytorch, we have only 2 call sites of libkineto_init (https://github.com/search?q=repo%3Apytorch%2Fpytorch%20libkineto_init&type=code). - One is the to when we need to register ourselves to dynolog (KINETO_USE_DAEMON=1).
First one is triggered from
global_kineto_init
, butlibkineto_init
actually triggers a bunch of cupti API, which defeats the purpose of lazy cupti attach. Therefore we are potentially affecting the perf of the program until cuptiFinalize is called.I think the right design would be decoupling registration to dynolog from all the cupti initialization. At
global_kineto_init
, we only register to dynolog but don't do cupti calls. And then when we get signal from dynolog, we trigger ondemand profile and then attach cupti context, basically following the pattern of the second use case in pytorch above.This requires
global_kineto_init
in pytorch only trigger the registration to dynolog partglobal_kineto_init
accordingly.The text was updated successfully, but these errors were encountered: