8000 inductor_config_logging: Don't drop keys · pytorch/pytorch@bf6f0c0 · GitHub
[go: up one dir, main page]

Skip to content

Commit bf6f0c0

Browse files
committed
inductor_config_logging: Don't drop keys
This bit me while I was trying to debug some trace issues. In general this config is already quite large when dumping, so adding more fields doesn't make it significantly worse. Also a number of the items we are type checking for (except the test configs), don't even show up. Primarily this will help us when debugging rocm, halide, and trace configs. ghstack-source-id: bf8a1a7 Pull Request resolved: #144700
1 parent efa88e0 commit bf6f0c0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

test/dynamo/test_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ def test_inductor_config_jsonify(self):
387387

388388
inductor_config_json = utils._scrubbed_inductor_config_for_logging()
389389
self.assertTrue(isinstance(inductor_config_json, str))
390+
self.assertIn('trace"', inductor_config_json)
390391

391392
@mock.patch("torch._dynamo.utils.torch._inductor.config")
392393
def test_inductor_config_parsing_non_conforming_items(self, mocked_inductor_config):

torch/_dynamo/utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,16 +1331,15 @@ def default(self, o):
13311331
except Exception:
13321332
return "Value is not JSON serializable"
13331333

1334-
configs_to_scrub_re = r"((^TYPE_CHECKING$)|(.*_progress$)|(.*TESTING.*)|(.*(rocm|halide).*)|(^trace\..*)|(^_))"
1335-
keys_to_scrub = set()
1334+
keys_to_scrub: Set[Any] = set()
13361335
inductor_conf_str = None
13371336
inductor_config_copy = (
13381337
torch._inductor.config.get_config_copy() if torch._inductor.config else None
13391338
)
13401339
if inductor_config_copy is not None:
13411340
try:
13421341
for key, val in inductor_config_copy.items():
1343-
if not isinstance(key, str) or re.search(configs_to_scrub_re, key):
1342+
if not isinstance(key, str):
13441343
keys_to_scrub.add(key)
13451344
# Convert set() to list for json.dumps()
13461345
if isinstance(val, set):

0 commit comments

Comments
 (0)
0