Revert "revert test repro logging" (#140749)

This reverts commit 6323fa673279eac9f2292b9b7790f621a4649af8.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/140749
Approved by: https://github.com/bobrenjc93
ghstack dependencies: #138634
This commit is contained in:
Edward Z. Yang
2024-11-14 20:32:53 -05:00
committed by PyTorch MergeBot
parent 62fb6fd8bd
commit 6094f17ada

View File

@ -74,6 +74,7 @@ from torch import Tensor
from torch._C import ScriptDict, ScriptList # type: ignore[attr-defined]
from torch._dynamo.trace_rules import _as_posix_path
from torch._utils_internal import get_writable_path
from torch._logging.scribe import open_source_signpost
from torch.nn import (
ModuleDict,
ModuleList,
@ -2470,6 +2471,16 @@ def print_repro_on_failure(repro_parts):
repro_str = " ".join(filter(None, (sample_isolation_prefix, *repro_parts)))
open_source_signpost(
subsystem="test_repros",
name="test_failure",
parameters=json.dumps(
{
"repro": " ".join(filter(None, (sample_isolation_prefix, *repro_parts))),
}
),
)
repro_msg = f"""
To execute this test, run the following from the base repo dir:
{repro_str}