Skip to content

Commit

Permalink
Rename cache limit to recompile limit in configs (#143709)
Browse files Browse the repository at this point in the history
Summary:
This PR renames every cache_limit to recompile_limit via sed.

Old config options are maintained via Config(alias='xyz')

X-link: pytorch/pytorch#143709
Approved by: https://github.com/jansel

Reviewed By: aorenste

Differential Revision: D67580275

Pulled By: oulgen

fbshipit-source-id: 5f44f01a2d43ee280a4872b112aff7eaf7b71700
  • Loading branch information
oulgen authored and facebook-github-bot committed Dec 23, 2024
1 parent 07e6ef4 commit bf18cc9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions userbenchmark/dynamo/dynamobench/_dynamo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2401,16 +2401,16 @@ def format_func_info(code):

@contextlib.contextmanager
def disable_cache_limit():
prior = config.cache_size_limit
config.cache_size_limit = sys.maxsize
prior_acc_limit = config.accumulated_cache_size_limit
config.accumulated_cache_size_limit = sys.maxsize
prior = config.recompile_limit
config.recompile_limit = sys.maxsize
prior_acc_limit = config.accumulated_recompile_limit
config.accumulated_recompile_limit = sys.maxsize

try:
yield
finally:
config.cache_size_limit = prior
config.accumulated_cache_size_limit = prior_acc_limit
config.recompile_limit = prior
config.accumulated_recompile_limit = prior_acc_limit


# map from transformed code back to original user code
Expand Down
2 changes: 1 addition & 1 deletion userbenchmark/dynamo/dynamobench/torchao_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def setup_baseline():

recommended_inductor_config_setter()
torch._dynamo.config.automatic_dynamic_shapes = False
torch._dynamo.config.cache_size_limit = 10000
torch._dynamo.config.recompile_limit = 10000


def torchao_optimize_ctx(quantization: str):
Expand Down

0 comments on commit bf18cc9

Please sign in to comment.