mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Log information about suppressed data dependent errors (#151041)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/151041 Approved by: https://github.com/bobrenjc93 ghstack dependencies: #151023, #151038
This commit is contained in:
parent
73d95893a2
commit
ccd00359da
|
|
@ -1187,6 +1187,17 @@ def compute_unbacked_bindings(
|
|||
return symbol_to_path
|
||||
|
||||
|
||||
def _log_suppressed_dde(a: SymBool, assumed_value: bool) -> None:
|
||||
sloc, extra = a.node.shape_env._get_stack_summary(True)
|
||||
log.info(
|
||||
"could not evaluate %s due to data dependency, it was assumed to be %s with no runtime assertions %s %s",
|
||||
a,
|
||||
assumed_value,
|
||||
sloc,
|
||||
extra,
|
||||
)
|
||||
|
||||
|
||||
# The following two functions are common utilities used while defining unbacked semantics
|
||||
# of various framework code. Those would be used in situations you prefer to guard and know
|
||||
# the result of the expression over not guarding, but in case you hit a data dependent error
|
||||
|
|
@ -1210,6 +1221,7 @@ def guard_or_false(a: BoolLikeType) -> bool:
|
|||
try:
|
||||
return guard_bool(a)
|
||||
except GuardOnDataDependentSymNode:
|
||||
_log_suppressed_dde(a, False)
|
||||
return False
|
||||
|
||||
|
||||
|
|
@ -1231,6 +1243,7 @@ def guard_or_true(a: BoolLikeType) -> bool:
|
|||
try:
|
||||
return guard_bool(a)
|
||||
except GuardOnDataDependentSymNode:
|
||||
_log_suppressed_dde(a, True)
|
||||
return True
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user