mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
[Dynamo][Logging]Fix regression on stack adding to latest bytecode by… (#165946)
… adding verbose check (#165926) [ghstack-poisoned] Fixes #ISSUE_NUMBER Pull Request resolved: https://github.com/pytorch/pytorch/pull/165946 Approved by: https://github.com/williamwen42
This commit is contained in:
parent
2c851c16e5
commit
6038e476e8
|
|
@ -1363,14 +1363,15 @@ class InstructionTranslatorBase(
|
|||
|
||||
# Store the latest 20 bytecode execution for the process,
|
||||
# Used repr for byte processing and limiting the length to 2048
|
||||
try:
|
||||
stack_repr = repr(self.stack)
|
||||
except ValueError:
|
||||
# Handle large integers that exceed sys.int_info.str_digits_check_threshold
|
||||
stack_repr = "<self.stack repr truncated due to large integer>"
|
||||
self.latest_bytecode_queue.append(
|
||||
f"TRACE {inst.opname} {repr(inst.argval)} {stack_repr}"
|
||||
)
|
||||
if config.verbose:
|
||||
try:
|
||||
stack_repr = repr(self.stack)
|
||||
except ValueError:
|
||||
# Handle large integers that exceed sys.int_info.str_digits_check_threshold
|
||||
stack_repr = "<self.stack repr truncated due to large integer>"
|
||||
self.latest_bytecode_queue.append(
|
||||
f"TRACE {inst.opname} {repr(inst.argval)} {stack_repr}"
|
||||
)
|
||||
|
||||
self.update_block_stack(inst)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user