-
Notifications
You must be signed in to change notification settings - Fork 514
Replace xm.mark_step
with torch_xla.sync()
wherever possible
#9070
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
base: master
Are you sure you want to change the base?
Conversation
Also update remaining uses of mark_step to use/reference torch_xla.sync().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo one nit on the comment.
I think we have some tests that look for strings (yuck!) and there's a subtle string mismatch.
"""Launches all pending graph operations. | ||
|
||
Args: | ||
wait (bool): whether to block the current process until the execution finished. | ||
|
||
reset_scope (bool): whether to reset the tracing scope of lazy tensor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you elaborate what this means? By reading the code, I wasn't sure what does "resetting" mean. Does it mean any tracing scope set by the user for the profiler are invalidated? Maybe could you run some simple tests to verify its behavior?
This comment shouldn't hold up this PR, but I want to register that I think that we have an opportunity to rename this again in the future to make it easier for users to understand what this does without reading documentation. The problem with What I think we should do is have a torch_xla.synchronize which ONLY waits for all results from the underlying devices to return, similar to torch.cuda.synchronize. There are unresolved design questions: Next torch.compile vs torch_xla.compile()torch.cuda.synchronize(device=None)[SOURCE][SOURCE] Parameters |
Agree that |
IMO it's very worth having a separate discussion for renaming |
Fixes #8862.