I’m not familiar with your use case and don’t know what exactly you would like to profile, but based on the docs 2:

Host functions without a mandated order (such as in independent streams) execute in undefined order and may be serialized.

you would need to check, if it fits your use case.



 tanmay2592:

but won’t it have an adverse affect on the performance?


If you are synchronizing on a custom or the default stream used in PyTorch it will impact the performance, but again I might not understand your use case and how you would like to time kernel executions without synchronizations/events.