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

Skip to content

Commit fc02d7d

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: ff5779a Pull Request resolved: #144700
1 parent 7e2239f commit fc02d7d

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
@@ -1221,16 +1221,15 @@ def default(self, o):
12211221
except Exception:
12221222
return "Value is not JSON serializable"
12231223

1224-
configs_to_scrub_re = r"((^TYPE_CHECKING$)|(.*_progress$)|(.*TESTING.*)|(.*(rocm|halide).*)|(^trace\..*)|(^_))"
1225-
keys_to_scrub = set()
1224+
keys_to_scrub: Set[Any] = set()
12261225
inductor_conf_str = None
12271226
inductor_config_copy = (
12281227
torch._inductor.config.get_config_copy() if torch._inductor.config else None
12291228
)
12301229
if inductor_config_copy is not None:
12311230
try:
12321231
for key, val in inductor_config_copy.items():
1233-
if not isinstance(key, str) or re.search(configs_to_scrub_re, key):
1232+
if not isinstance(key, str):
12341233
keys_to_scrub.add(key)
12351234
# Convert set() to list for json.dumps()
12361235
if isinstance(val, set):

0 commit comments

Comments
 (0)
0