-
Notifications
You must be signed in to change notification settings - Fork 608
Verbosity control for export #2690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Summary: Verbosity control for export Reviewed By: kimishpatel Differential Revision: D55374748
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/2690
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ No FailuresAs of commit 63395e9 with merge base cde514c ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This pull request was exported from Phabricator. Differential Revision: D55374748 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok as-is, but left some suggestions for improving clarity.
def set_verbosity(val): | ||
global verbosity_setting | ||
verbosity_setting = val | ||
|
||
|
||
def verbose_export(): | ||
return verbosity_setting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to clarify the type here. And along with it, verbosity_setting: bool = False
above.
def set_verbosity(val): | |
global verbosity_setting | |
verbosity_setting = val | |
def verbose_export(): | |
return verbosity_setting | |
def set_verbosity(val: bool): | |
global verbosity_setting | |
verbosity_setting = val | |
def verbose_export() -> bool: | |
return verbosity_setting |
@@ -46,6 +46,7 @@ | |||
logging.basicConfig(level=logging.INFO, format=FORMAT) | |||
|
|||
pkg_name = __name__ | |||
verbosity_setting = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be good to make this clearly internal, though I don't know if anyone imports this file.
verbosity_setting = None | |
_verbosity_setting = None |
@@ -46,6 +46,7 @@ | |||
logging.basicConfig(level=logging.INFO, format=FORMAT) | |||
|
|||
pkg_name = __name__ | |||
verbosity_setting = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any way for a user to override this, or is it effectively hard-disabled for now?
@@ -240,7 +250,8 @@ def quantize( | |||
from torchao.quantization.quant_api import Int8DynActInt4WeightQuantizer | |||
|
|||
model = Int8DynActInt4WeightQuantizer(precision=torch_dtype).quantize(model) | |||
print("quantized model:", model) | |||
if verbose_export(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the idea is to guard all prints with this, consider adding a custom print function like log_export()
that does it internally to simplify the call sites.
This pull request has been merged in dfeadab. |
Summary: Verbosity control for export
Reviewed By: kimishpatel
Differential Revision: D55374748