Skip to content

Conversation

mlazos
Copy link
Contributor

@mlazos mlazos commented May 9, 2024

Torch.compile doesn't support data dependent control flow, in some cases this can be supported with a torch.where. To avoid a graph break we check anis_compiling condition to avoid forcing eager to all an extra kernel for torch.where.

Stack from ghstack (oldest at bottom):

[ghstack-poisoned]
@mlazos mlazos requested review from albanD and janeyx99 as code owners May 9, 2024 04:55
Copy link

pytorch-bot bot commented May 9, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/125824

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (1 Unrelated Failure)

As of commit 325ad14 with merge base c59a236 (image):

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

Adds `is_compiling` condition to avoid forcing eager to all an extra kernel for `torch.where`




[ghstack-poisoned]
@albanD albanD removed their request for review May 9, 2024 12:40
else:
exp_avg_sq_sqrt = exp_avg_sq_sqrt.add_(eps)

return (bias_correction2**0.5) / exp_avg_sq_sqrt
Copy link
Contributor

Choose a reason for hiding this comment

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

not related to this PR, but maybe _dispatch_sqrt (in this file and elsewhere) can be replaced by simply ** 0.5 which is supposed to work both for python scalars and for tensors (this is already used in most occurences in this file as well, the only dispatch_sqrt usage remaining)

@mlazos mlazos closed this May 11, 2024
@github-actions github-actions bot deleted the gh/mlazos/39/head branch June 10, 2024 01:56
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.

2 participants