8000 Replace `unimplemented` with `unimplemented_v2' in `codegen.py` by zeshengzong · Pull Request #148069 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

Replace unimplemented with unimplemented_v2' in codegen.py` #148069

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 3 commits into from
Closed
Changes from all commits
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
9 changes: 7 additions & 2 deletions torch/_dynamo/codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
create_rot_n,
Instruction,
)
from .exc import IncorrectUsage, unimplemented, unimplemented_v2
from .exc import IncorrectUsage, unimplemented_v2
from .source import AttrSource, ChainedSource, DictGetItemSource, Source
from .utils import is_safe_constant, rot_n_helper
from .variables.base import ValueMutationExisting, VariableTracker
Expand Down Expand Up @@ -197,7 +197,12 @@ def __call__(self, value, allow_cache=True):
try:
self.call_reconstruct(source)
except NotImplementedError:
unimplemented(f"reconstruct: {source}")
unimplemented_v2(
gb_type="Reconstruction failure: source.reconstruct not implemented",
context=str(source),
explanation=f"Dynamo has no bytecode reconstruction implemented for {type(source)} variable {source}.",
hints=[*graph_break_hints.DYNAMO_BUG],
)

self._output.append(create_dup_top())
self.add_cache(source)
Expand Down
Loading
0