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

[dynamo] Dynamo triggering on list comprehension <listcomp> frames and graph breaking #138654

Closed
anijain2305 opened this issue Oct 22, 2024 · 0 comments

Comments

@anijain2305
Copy link
Contributor

anijain2305 commented Oct 22, 2024

🐛 Describe the bug

Internal xref - https://fb.workplace.com/groups/1075192433118967/permalink/1528968734407999/

import torch


class Module(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self._num = 4

    @torch._dynamo.disable(recursive=False)
    def forward(self, x):
        values = [4 * torch.cos(i) for i in range(self._num)]
        return sum(values) * x

mod = Module()

def fn(x):
    return mod(x)

opt_fn = torch.compile(fn, backend="eager")
opt_fn(torch.randn(4))

Error logs

No response

Minified repro

No response

Versions

NA

cc @ezyang @chauhang @penguinwu

anijain2305 added a commit that referenced this issue Oct 22, 2024
anijain2305 added a commit that referenced this issue Oct 23, 2024
Fixes #138654

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames rec

[ghstack-poisoned]
anijain2305 added a commit that referenced this issue Oct 23, 2024
…ion input"

Fixes #138654

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames rec

[ghstack-poisoned]
anijain2305 added a commit that referenced this issue Oct 23, 2024
Fixes #138654

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames rec

[ghstack-poisoned]
anijain2305 added a commit that referenced this issue Oct 23, 2024
…ion input"

Fixes #138654

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames rec

[ghstack-poisoned]
anijain2305 added a commit that referenced this issue Oct 23, 2024
Fixes #138654

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames rec

[ghstack-poisoned]
anijain2305 added a commit that referenced this issue Oct 23, 2024
…ion input"

Fixes #138654

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames rec

[ghstack-poisoned]
anijain2305 added a commit that referenced this issue Oct 23, 2024
Fixes #138654

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames rec

[ghstack-poisoned]
anijain2305 added a commit that referenced this issue Oct 23, 2024
…ion input"

Fixes #138654

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames rec

[ghstack-poisoned]
anijain2305 added a commit that referenced this issue Oct 23, 2024
Fixes #138654

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames rec

[ghstack-poisoned]
anijain2305 added a commit that referenced this issue Oct 23, 2024
…ion input"

Fixes #138654

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames rec

[ghstack-poisoned]
anijain2305 added a commit that referenced this issue Oct 23, 2024
Fixes #138654

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames rec

[ghstack-poisoned]
facebook-github-bot pushed a commit to pytorch/benchmark that referenced this issue Oct 24, 2024
Summary:
Fixes pytorch/pytorch#138654

X-link: pytorch/pytorch#138657
Approved by: https://github.com/williamwen42, https://github.com/jansel

Reviewed By: wdvr

Differential Revision: D64881833

Pulled By: anijain2305

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

No branches or pull requests

1 participant