|
33 | 33 | augment_exc_message,
|
34 | 34 | BackendCompilerFailed,
|
35 | 35 | format_error_msg,
|
| 36 | + format_error_msg_verbose, |
36 | 37 | InternalTorchDynamoError,
|
37 | 38 | TorchRuntimeError,
|
38 | 39 | unimplemented,
|
@@ -215,7 +216,19 @@ def exception_handler(e, code, frame=None):
|
215 | 216 | # Only log the exception if we are going to suppress it
|
216 | 217 | # if aren't suppressing it, a higher level except block will handle it
|
217 | 218 | if config.suppress_errors:
|
218 |
| - log.error(format_error_msg(e, code, record_filename, frame)) |
| 219 | + if config.is_fbcode(): |
| 220 | + from torch._dynamo.fb.logging import ( # type: ignore[import] |
| 221 | + log_dynamo_suppress_errors, |
| 222 | + ) |
| 223 | + |
| 224 | + error_msg = format_error_msg_verbose(e, code, record_filename, frame) |
| 225 | + log_dynamo_suppress_errors( |
| 226 | + code.co_name, code.co_filename, code.co_firstlineno, error_msg |
| 227 | + ) |
| 228 | + else: |
| 229 | + error_msg = format_error_msg(e, code, record_filename, frame) |
| 230 | + |
| 231 | + log.warning(error_msg) |
219 | 232 |
|
220 | 233 |
|
221 | 234 | FRAME_COUNTER = 0
|
@@ -551,7 +564,7 @@ def _convert_frame(
|
551 | 564 | except Exception:
|
552 | 565 | if not config.suppress_errors:
|
553 | 566 | raise
|
554 |
| - log.info("converting frame raised error, suppressing error") |
| 567 | + log.warning("converting frame raised error, suppressing error") |
555 | 568 | return None
|
556 | 569 |
|
557 | 570 | _convert_frame._torchdynamo_orig_callable = compiler_fn # type: ignore[attr-defined]
|
|
0 commit comments