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

Rework roctracer shutdown flushing #833

Closed
wants to merge 1 commit into from
Closed

Conversation

mwootton
Copy link
Contributor

Reworked roctracer flush on shutdown. Removing a race condition added while removing the original race condition. :)
Previous implementation had a deadlock in the case where the op buffer had filled and flushed on its own immediately before shutdown.

This new approach is simpler but has to continuously log correlation ids of completed async ops. This is done on the roctracer supplied callback thread so it is not an overhead/performance issue. Previous attempt was over-optimized at the cost of not working correctly. Oops.

@mwootton
Copy link
Contributor Author

@jeffdaily This look good now?

Copy link

@jeffdaily jeffdaily left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aaronenyeshi for merging.

@facebook-github-bot
Copy link
Contributor

@aaronenyeshi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@aaronenyeshi merged this pull request in 490f305.

mwootton added a commit to ROCm/kineto that referenced this pull request Nov 30, 2023
Summary:
Reworked roctracer flush on shutdown.  Removing a race condition added while removing the original race condition. :)
Previous implementation had a deadlock in the case where the op buffer had filled and flushed on its own immediately before shutdown.

This new approach is simpler but has to continuously log correlation ids of completed async ops.  This is done on the roctracer supplied callback thread so it is not an overhead/performance issue.  Previous attempt was over-optimized at the cost of not working correctly.  Oops.

Pull Request resolved: pytorch#833

Reviewed By: xuzhao9

Differential Revision: D51473804

Pulled By: aaronenyeshi

fbshipit-source-id: 7a7bea1356aea7e9a719fffe8e50735d072843f6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants