dynamo: Only log if we've disabled eval_frame once. (#134529)

This spams logs pretty badly otherwise

Pull Request resolved: https://github.com/pytorch/pytorch/pull/134529
Approved by: https://github.com/chuanhaozhuge, https://github.com/oulgen
This commit is contained in:
Colin L. Rice
2024-08-30 00:35:23 +00:00
committed by PyTorch MergeBot
parent 8b68912dfc
commit cf11fc0dcb
2 changed files with 3 additions and 2 deletions

View File

@ -104,7 +104,7 @@ def _maybe_set_eval_frame(callback: DynamoCallback):
from torch._C._dynamo.eval_frame import set_eval_frame
if not justknobs_check("pytorch/compiler:enable_compiler_set_eval_frame"):
log.warning(
torch._dynamo.utils.warn_once(
"Dynamo disabled by Justknob: enable_compiler_set_eval_frame, skipping set_eval_frame"
)
return callback

View File

@ -235,7 +235,8 @@ def justknobs_feature(
killswitch work by having feature return True to turn off features
Requirements:
Don't use this at import time - Simply pass in the existing config
WARNING - Don't use this at import time - Simply pass in the existing config.
If you want to use this at config time, use JustKnobsConfig
"""
if config_value is not None:
return config_value