8000 Replace `unimplemented` with `unimplemented_v2' in `codegen.py` (#148… · pytorch/pytorch@1add61c · GitHub 10000
[go: up one dir, main page]

Skip to content

Commit 1add61c

Browse files
zeshengzongpytorchmergebot
authored andcommitted
Replace unimplemented with unimplemented_v2' in codegen.py` (#148069)
Fixes #147913 - replace `unimplemented` in `codegen.py` - remove unused import `unimplemented` Pull Request resolved: #148069 Approved by: https://github.com/Skylion007, https://github.com/williamwen42
1 parent edd640a commit 1add61c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

torch/_dynamo/codegen.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
create_rot_n,
3737
Instruction,
3838
)
39-
from .exc import IncorrectUsage, unimplemented, unimplemented_v2
39+
from .exc import IncorrectUsage, unimplemented_v2
4040
from .source import AttrSource, ChainedSource, DictGetItemSource, Source
4141
from .utils import is_safe_constant, rot_n_helper
4242
from .variables.base import ValueMutationExisting, VariableTracker
@@ -197,7 +197,12 @@ def __call__(self, value, allow_cache=True):
197197
try:
198198
self.call_reconstruct(source)
199199
except NotImplementedError:
200-
unimplemented(f"reconstruct: {source}")
200+
unimplemented_v2(
201+
gb_type="Reconstruction failure: source.reconstruct not implemented",
202+
context=str(source),
203+
explanation=f"Dynamo has no bytecode reconstruction implemented for {type(source)} variable {source}.",
204+
hints=[*graph_break_hints.DYNAMO_BUG],
205+
)
201206

202207
self._output.append(create_dup_top())
203208
self.add_cache(source)

0 commit comments

Comments
 (0)
0