-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
quant: make various configs printable #91419
Conversation
Summary: Makes various quantization configs print out human readable values instead of just the class name. This is useful when printing these configs out when debugging. Test plan: test script ``` conf_1 = torch.ao.quantization.backend_config.backend_config.DTypeConfig() print(conf_1) conf_2 = torch.ao.quantization.backend_config.backend_config.BackendConfig() print(conf_2) conf_3 = torch.ao.quantization.backend_config.backend_config.BackendPatternConfig() print(conf_3) conf_4 = torch.ao.quantization.fx.custom_config.PrepareCustomConfig()\ .set_input_quantized_indexes([0]) print(conf_4) conf_5 = torch.ao.quantization.fx.custom_config.ConvertCustomConfig()\ .set_preserved_attributes(['foo']) print(conf_5) conf_6 = torch.ao.quantization.fx.custom_config.FuseCustomConfig()\ .set_preserved_attributes(['foo']) print(conf_6) ``` test script output ``` DTypeConfig(input_dtype_with_constraints=DTypeWithConstraints(dtype=None, quant_min_lower_bound=None, quant_max_ upper_bound=None, scale_min_lower_bound=None, scale_max_upper_bound=None, scale_exact_match=None, zero_point_exa ct_match=None), output_dtype_with_constraints=DTypeWithConstraints(dtype=None, quant_min_lower_bound=None, quant _max_upper_bound=None, scale_min_lower_bound=None, scale_max_upper_bound=None, scale_exact_match=None, zero_poin t_exact_match=None), weight_dtype_with_constraints=DTypeWithConstraints(dtype=None, quant_min_lower_bound=None, quant_max_upper_bound=None, scale_min_lower_bound=None, scale_max_upper_bound=None, scale_exact_match=None, zero _point_exact_match=None), bias_dtype=None, is_dynamic=None) BackendConfig({'name': '', '_pattern_complex_format_to_config': {}}) BackendPatternConfig({'observation_type': <ObservationType.OUTPUT_USE_DIFFERENT_OBSERVER_AS_INPUT: 0>}) PrepareCustomConfig({'input_quantized_indexes': [0]}) ConvertCustomConfig({'preserved_attributes': ['foo']}) FuseCustomConfig({'preserved_attributes': ['foo']}) ``` [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/91419
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit b4311a8: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Summary: Makes various quantization configs print out human readable values instead of just the class name. This is useful when printing these configs out when debugging. Test plan: test script ``` conf_1 = torch.ao.quantization.backend_config.backend_config.DTypeConfig() print(conf_1) conf_2 = torch.ao.quantization.backend_config.backend_config.BackendConfig() print(conf_2) conf_3 = torch.ao.quantization.backend_config.backend_config.BackendPatternConfig() print(conf_3) conf_4 = torch.ao.quantization.fx.custom_config.PrepareCustomConfig()\ .set_input_quantized_indexes([0]) print(conf_4) conf_5 = torch.ao.quantization.fx.custom_config.ConvertCustomConfig()\ .set_preserved_attributes(['foo']) print(conf_5) conf_6 = torch.ao.quantization.fx.custom_config.FuseCustomConfig()\ .set_preserved_attributes(['foo']) print(conf_6) ``` test script output ``` DTypeConfig(input_dtype_with_constraints=DTypeWithConstraints(dtype=None, quant_min_lower_bound=None, quant_max_ upper_bound=None, scale_min_lower_bound=None, scale_max_upper_bound=None, scale_exact_match=None, zero_point_exa ct_match=None), output_dtype_with_constraints=DTypeWithConstraints(dtype=None, quant_min_lower_bound=None, quant _max_upper_bound=None, scale_min_lower_bound=None, scale_max_upper_bound=None, scale_exact_match=None, zero_poin t_exact_match=None), weight_dtype_with_constraints=DTypeWithConstraints(dtype=None, quant_min_lower_bound=None, quant_max_upper_bound=None, scale_min_lower_bound=None, scale_max_upper_bound=None, scale_exact_match=None, zero _point_exact_match=None), bias_dtype=None, is_dynamic=None) BackendConfig({'name': '', '_pattern_complex_format_to_config': {}}) BackendPatternConfig({'observation_type': <ObservationType.OUTPUT_USE_DIFFERENT_OBSERVER_AS_INPUT: 0>}) PrepareCustomConfig({'input_quantized_indexes': [0]}) ConvertCustomConfig({'preserved_attributes': ['foo']}) FuseCustomConfig({'preserved_attributes': ['foo']}) ``` ghstack-source-id: 6acbd915298aee7fac7a8131508ed49c8930aa61 Pull Request resolved: #91419
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.
Thanks! Can be a future PR but it would be good to print different fields on separate lines with the right indentations too; right now the built-in backend configs are printed as a huge jumble of text.
@pytorchbot help |
❌ 🤖 pytorchbot command failed:
Try |
@pytorchbot --help |
PyTorchBot Help
Merge
Revert
Rebase
Label
Dr CI
|
@pytorchbot rebase |
@pytorchbot successfully started a rebase job. Check the current status here |
Summary: Makes various quantization configs print out human readable values instead of just the class name. This is useful when printing these configs out when debugging. Test plan: test script ``` conf_1 = torch.ao.quantization.backend_config.backend_config.DTypeConfig() print(conf_1) conf_2 = torch.ao.quantization.backend_config.backend_config.BackendConfig() print(conf_2) conf_3 = torch.ao.quantization.backend_config.backend_config.BackendPatternConfig() print(conf_3) conf_4 = torch.ao.quantization.fx.custom_config.PrepareCustomConfig()\ .set_input_quantized_indexes([0]) print(conf_4) conf_5 = torch.ao.quantization.fx.custom_config.ConvertCustomConfig()\ .set_preserved_attributes(['foo']) print(conf_5) conf_6 = torch.ao.quantization.fx.custom_config.FuseCustomConfig()\ .set_preserved_attributes(['foo']) print(conf_6) ``` test script output ``` DTypeConfig(input_dtype_with_constraints=DTypeWithConstraints(dtype=None, quant_min_lower_bound=None, quant_max_ upper_bound=None, scale_min_lower_bound=None, scale_max_upper_bound=None, scale_exact_match=None, zero_point_exa ct_match=None), output_dtype_with_constraints=DTypeWithConstraints(dtype=None, quant_min_lower_bound=None, quant _max_upper_bound=None, scale_min_lower_bound=None, scale_max_upper_bound=None, scale_exact_match=None, zero_poin t_exact_match=None), weight_dtype_with_constraints=DTypeWithConstraints(dtype=None, quant_min_lower_bound=None, quant_max_upper_bound=None, scale_min_lower_bound=None, scale_max_upper_bound=None, scale_exact_match=None, zero _point_exact_match=None), bias_dtype=None, is_dynamic=None) BackendConfig({'name': '', '_pattern_complex_format_to_config': {}}) BackendPatternConfig({'observation_type': <ObservationType.OUTPUT_USE_DIFFERENT_OBSERVER_AS_INPUT: 0>}) PrepareCustomConfig({'input_quantized_indexes': [0]}) ConvertCustomConfig({'preserved_attributes': ['foo']}) FuseCustomConfig({'preserved_attributes': ['foo']}) ``` [ghstack-poisoned]
Successfully rebased |
Summary: Makes various quantization configs print out human readable values instead of just the class name. This is useful when printing these configs out when debugging. Test plan: test script ``` conf_1 = torch.ao.quantization.backend_config.backend_config.DTypeConfig() print(conf_1) conf_2 = torch.ao.quantization.backend_config.backend_config.BackendConfig() print(conf_2) conf_3 = torch.ao.quantization.backend_config.backend_config.BackendPatternConfig() print(conf_3) conf_4 = torch.ao.quantization.fx.custom_config.PrepareCustomConfig()\ .set_input_quantized_indexes([0]) print(conf_4) conf_5 = torch.ao.quantization.fx.custom_config.ConvertCustomConfig()\ .set_preserved_attributes(['foo']) print(conf_5) conf_6 = torch.ao.quantization.fx.custom_config.FuseCustomConfig()\ .set_preserved_attributes(['foo']) print(conf_6) ``` test script output ``` DTypeConfig(input_dtype_with_constraints=DTypeWithConstraints(dtype=None, quant_min_lower_bound=None, quant_max_ upper_bound=None, scale_min_lower_bound=None, scale_max_upper_bound=None, scale_exact_match=None, zero_point_exa ct_match=None), output_dtype_with_constraints=DTypeWithConstraints(dtype=None, quant_min_lower_bound=None, quant _max_upper_bound=None, scale_min_lower_bound=None, scale_max_upper_bound=None, scale_exact_match=None, zero_poin t_exact_match=None), weight_dtype_with_constraints=DTypeWithConstraints(dtype=None, quant_min_lower_bound=None, quant_max_upper_bound=None, scale_min_lower_bound=None, scale_max_upper_bound=None, scale_exact_match=None, zero _point_exact_match=None), bias_dtype=None, is_dynamic=None) BackendConfig({'name': '', '_pattern_complex_format_to_config': {}}) BackendPatternConfig({'observation_type': <ObservationType.OUTPUT_USE_DIFFERENT_OBSERVER_AS_INPUT: 0>}) PrepareCustomConfig({'input_quantized_indexes': [0]}) ConvertCustomConfig({'preserved_attributes': ['foo']}) FuseCustomConfig({'preserved_attributes': ['foo']}) ``` ghstack-source-id: 0183772b2b42699ba153f2206bb5c0cf053151bd Pull Request resolved: #91419
@pytorchbot merge |
Merge failedReason: The following mandatory check(s) failed (Rule Dig deeper by viewing the failures on hud Details for Dev Infra teamRaised by workflow job |
/easycla |
@pytorchbot rebase |
@pytorchbot successfully started a rebase job. Check the current status here |
Summary: Makes various quantization configs print out human readable values instead of just the class name. This is useful when printing these configs out when debugging. Test plan: test script ``` conf_1 = torch.ao.quantization.backend_config.backend_config.DTypeConfig() print(conf_1) conf_2 = torch.ao.quantization.backend_config.backend_config.BackendConfig() print(conf_2) conf_3 = torch.ao.quantization.backend_config.backend_config.BackendPatternConfig() print(conf_3) conf_4 = torch.ao.quantization.fx.custom_config.PrepareCustomConfig()\ .set_input_quantized_indexes([0]) print(conf_4) conf_5 = torch.ao.quantization.fx.custom_config.ConvertCustomConfig()\ .set_preserved_attributes(['foo']) print(conf_5) conf_6 = torch.ao.quantization.fx.custom_config.FuseCustomConfig()\ .set_preserved_attributes(['foo']) print(conf_6) ``` test script output ``` DTypeConfig(input_dtype_with_constraints=DTypeWithConstraints(dtype=None, quant_min_lower_bound=None, quant_max_ upper_bound=None, scale_min_lower_bound=None, scale_max_upper_bound=None, scale_exact_match=None, zero_point_exa ct_match=None), output_dtype_with_constraints=DTypeWithConstraints(dtype=None, quant_min_lower_bound=None, quant _max_upper_bound=None, scale_min_lower_bound=None, scale_max_upper_bound=None, scale_exact_match=None, zero_poin t_exact_match=None), weight_dtype_with_constraints=DTypeWithConstraints(dtype=None, quant_min_lower_bound=None, quant_max_upper_bound=None, scale_min_lower_bound=None, scale_max_upper_bound=None, scale_exact_match=None, zero _point_exact_match=None), bias_dtype=None, is_dynamic=None) BackendConfig({'name': '', '_pattern_complex_format_to_config': {}}) BackendPatternConfig({'observation_type': <ObservationType.OUTPUT_USE_DIFFERENT_OBSERVER_AS_INPUT: 0>}) PrepareCustomConfig({'input_quantized_indexes': [0]}) ConvertCustomConfig({'preserved_attributes': ['foo']}) FuseCustomConfig({'preserved_attributes': ['foo']}) ``` [ghstack-poisoned]
Successfully rebased |
Summary: Makes various quantization configs print out human readable values instead of just the class name. This is useful when printing these configs out when debugging. Test plan: test script ``` conf_1 = torch.ao.quantization.backend_config.backend_config.DTypeConfig() print(conf_1) conf_2 = torch.ao.quantization.backend_config.backend_config.BackendConfig() print(conf_2) conf_3 = torch.ao.quantization.backend_config.backend_config.BackendPatternConfig() print(conf_3) conf_4 = torch.ao.quantization.fx.custom_config.PrepareCustomConfig()\ .set_input_quantized_indexes([0]) print(conf_4) conf_5 = torch.ao.quantization.fx.custom_config.ConvertCustomConfig()\ .set_preserved_attributes(['foo']) print(conf_5) conf_6 = torch.ao.quantization.fx.custom_config.FuseCustomConfig()\ .set_preserved_attributes(['foo']) print(conf_6) ``` test script output ``` DTypeConfig(input_dtype_with_constraints=DTypeWithConstraints(dtype=None, quant_min_lower_bound=None, quant_max_ upper_bound=None, scale_min_lower_bound=None, scale_max_upper_bound=None, scale_exact_match=None, zero_point_exa ct_match=None), output_dtype_with_constraints=DTypeWithConstraints(dtype=None, quant_min_lower_bound=None, quant _max_upper_bound=None, scale_min_lower_bound=None, scale_max_upper_bound=None, scale_exact_match=None, zero_poin t_exact_match=None), weight_dtype_with_constraints=DTypeWithConstraints(dtype=None, quant_min_lower_bound=None, quant_max_upper_bound=None, scale_min_lower_bound=None, scale_max_upper_bound=None, scale_exact_match=None, zero _point_exact_match=None), bias_dtype=None, is_dynamic=None) BackendConfig({'name': '', '_pattern_complex_format_to_config': {}}) BackendPatternConfig({'observation_type': <ObservationType.OUTPUT_USE_DIFFERENT_OBSERVER_AS_INPUT: 0>}) PrepareCustomConfig({'input_quantized_indexes': [0]}) ConvertCustomConfig({'preserved_attributes': ['foo']}) FuseCustomConfig({'preserved_attributes': ['foo']}) ``` ghstack-source-id: 3269a2431edf0b90f3f7042f73be3f469c356aae Pull Request resolved: #91419
@pytorchbot merge -g |
Merge startedYour change will be merged once all checks on your PR pass since you used the green (-g) flag (ETA: 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Stack from ghstack (oldest at bottom):
Summary:
Makes various quantization configs print out human readable values instead
of just the class name. This is useful when printing these configs out when
debugging.
Test plan:
test script
test script output