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

Sync xla_args before computation. #5823

Merged
merged 2 commits into from
Nov 21, 2023
Merged

Conversation

ysiraichi
Copy link
Collaborator

Fix: #5746

This PR synchronizes FunctionalTensorWrapper objects, before actually computing them. As a result, _clear_pending_irs doesn't delete the computed tensor anymore.

# value reference before actually computing it.
for a in xla_args:
if isinstance(a, torch.Tensor) and torch._is_functional_tensor(a):
torch._functionalize_sync(a)
Copy link
Collaborator

Choose a reason for hiding this comment

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

first time learnt this api.. interesting.

@ysiraichi ysiraichi merged commit f80e3ba into pytorch:master Nov 21, 2023
20 checks passed
zpcore pushed a commit that referenced this pull request Nov 21, 2023
* Sync `xla_args` before actually computing them.

* Only sync `FunctionalTensorWrapper` tensors.
lsy323 pushed a commit to lsy323/xla that referenced this pull request Nov 28, 2023
* Sync `xla_args` before actually computing them.

* Only sync `FunctionalTensorWrapper` tensors.
@lezcano lezcano added the xla:gpu label Dec 1, 2023
chunnienc pushed a commit to chunnienc/xla that referenced this pull request Dec 14, 2023
* Sync `xla_args` before actually computing them.

* Only sync `FunctionalTensorWrapper` tensors.
golechwierowicz pushed a commit that referenced this pull request Jan 12, 2024
* Sync `xla_args` before actually computing them.

* Only sync `FunctionalTensorWrapper` tensors.
bhavya01 pushed a commit that referenced this pull request Apr 22, 2024
* Sync `xla_args` before actually computing them.

* Only sync `FunctionalTensorWrapper` tensors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Torchbench speech_transformer fails when calling _get_graph_hash.
3 participants