8000 Replace unimplemented with unimplemented_v2 for dynamo by FFFrog · Pull Request #148158 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

Replace unimplemented with unimplemented_v2 for dynamo #148158

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

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update
[ghstack-poisoned]
  • Loading branch information
FFFrog committed Feb 28, 2025
commit b370cf3b33e230d8205291557e328966ba4fef30
11 changes: 8 additions & 3 deletions torch/_dynamo/variables/constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import torch
from torch._dynamo.source import AttrSource, GetItemSource

from .. import variables
from ..exc import raise_observed_exception, unimplemented
from .. import graph_break_hints, variables
from ..exc import raise_observed_exception, unimplemented_v2
from ..utils import cmp_name_to_op_mapping, common_constant_types, istype, np
from .base import VariableTracker

Expand Down Expand Up @@ -234,7 +234,12 @@ def create(cls, cls_type, value_vt, options):
for member in list(cls_type):
if member.value == value_vt.as_python_constant():
return cls(member, **options)
unimplemented("Enum variable is constructed with non constant values")
unimplemented_v2(
gb_type="Failed to trace enum variable",
context="",
explanation="Enum variable is constructed with non constant values",
hints=[*graph_break_hints.DYNAMO_BUG],
)

def as_proxy(self):
if isinstance(self.value, int):
Expand Down
Loading
0