Skip to content

[Quant] Move parts of BackendConfig tutorial #2169

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

Merged
merged 1 commit into from
Jan 18, 2023

Conversation

andrewor14
Copy link
Contributor

@andrewor14 andrewor14 commented Jan 11, 2023

Summary: This commit moves the API specification and the Data
Type Restriction sections to the docstrings. See
pytorch/pytorch#91999. This commit also
reorganizes the end-to-end example to make it easier to follow.

Reviewers: jerryzh168, vkuzo

Subscribers: jerryzh168, vkuzo

Copy link
Contributor

@jerryzh168 jerryzh168 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the tutorial example, it would be good to lay out a step by step guide to user as well, start with a scenario, e.g. user have a backend that they want to implement quantized linear and quantized conv2d_relu operator, how they figure out the BackendConfig step by step.

e.g. 1. decide the list of quantized operators in the backend 2. write down the reference pattern for each quantized operator 3. for each operator, write the BackendPatternConfig based on the reference pattern of the quantized operator, and what types of fusions they will need etc. 4. combine BackendPatternConfig and get a BackendConfig object 5. write custom qconfig mapping 6. use it in prepare and convert

some of pieces are already there in the tutorial, but it might be better to just list the steps more explicitly, similar to https://github.com/pytorch/tutorials/blob/main/prototype_source/fx_graph_mode_ptq_static.rst

@andrewor14 andrewor14 force-pushed the backend-config-move branch 4 times, most recently from 423782e to 993c809 Compare January 12, 2023 15:58
@andrewor14 andrewor14 requested a review from jerryzh168 January 12, 2023 16:00
@andrewor14
Copy link
Contributor Author

For the tutorial example, it would be good to lay out a step by step guide to user as well, start with a scenario, e.g. user have a backend that they want to implement quantized linear and quantized conv2d_relu operator, how they figure out the BackendConfig step by step.

e.g. 1. decide the list of quantized operators in the backend 2. write down the reference pattern for each quantized operator 3. for each operator, write the BackendPatternConfig based on the reference pattern of the quantized operator, and what types of fusions they will need etc. 4. combine BackendPatternConfig and get a BackendConfig object 5. write custom qconfig mapping 6. use it in prepare and convert

some of pieces are already there in the tutorial, but it might be better to just list the steps more explicitly, similar to https://github.com/pytorch/tutorials/blob/main/prototype_source/fx_graph_mode_ptq_static.rst

Sounds good. I reorganized them based on your suggestion.

Summary: This commit moves the API specification and the Data
Type Restriction sections to the docstrings. See
pytorch/pytorch#91999. This commit also
reorganizes the end-to-end example to make it easier to follow.

Reviewers: jerryzh168, vkuzo

Subscribers: jerryzh168, vkuzo
@andrewor14 andrewor14 changed the title [Quant] Move BackendConfig API specification [Quant] Move parts of BackendConfig tutorial Jan 13, 2023
@andrewor14
Copy link
Contributor Author

Hi @svekars, can you help me merge this? Thanks.

@svekars svekars merged commit 9614e02 into pytorch:main Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants