Skip to content

Commit

Permalink
inductor_config_logging: Don't drop keys (#144700)
Browse files Browse the repository at this point in the history
Summary:
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.

X-link: pytorch/pytorch#144700
Approved by: https://github.com/ezyang

Reviewed By: ZainRizvi

Differential Revision: D68746502

fbshipit-source-id: d441bb6e39d8e5d38ee1386ebcca5f4ad00c896b
  • Loading branch information
c00w authored and facebook-github-bot committed Jan 28, 2025
1 parent 8e6edf8 commit 5018404
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions userbenchmark/dynamo/dynamobench/_dynamo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
Generic,
Optional,
overload,
Set,
TypeVar,
Union,
)
Expand Down Expand Up @@ -1332,16 +1333,15 @@ def default(self, o):
except Exception:
return "Value is not JSON serializable"

configs_to_scrub_re = r"((^TYPE_CHECKING$)|(.*_progress$)|(.*TESTING.*)|(.*(rocm|halide).*)|(^trace\..*)|(^_))"
keys_to_scrub = set()
keys_to_scrub: Set[Any] = set()
inductor_conf_str = None
inductor_config_copy = (
torch._inductor.config.get_config_copy() if torch._inductor.config else None
)
if inductor_config_copy is not None:
try:
for key, val in inductor_config_copy.items():
if not isinstance(key, str) or re.search(configs_to_scrub_re, key):
if not isinstance(key, str):
keys_to_scrub.add(key)
# Convert set() to list for json.dumps()
if isinstance(val, set):
Expand Down

0 comments on commit 5018404

Please sign in to comment.