Skip to content
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

Deprecate top level quantization APIs (#344) #357

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

jerryzh168
Copy link
Contributor

Summary:
This PR deprecates a few quantization APIs and here are the bc-breaking notes:

  1. int8 weight only quantization int8 weight only quant module swap API
apply_weight_only_int8_quant(model)

and
int8 weight only tensor subclass API

change_linear_weights_to_int8_woqtensors(model)

-->

unified tensor subclass API

quantize(model, get_apply_int8wo_quant()))
  1. int8 dynamic quantization
apply_dynamic_quant(model)

or

change_linear_weights_to_int8_dqtensors(model)

-->

unified tensor subclass API

quantize(model, get_apply_int8dyn_quant()))
  1. int4 weight only quantization
change_linear_weights_to_int4_wotensors(model)

-->

unified tensor subclass API

quantize(model, get_apply_int4wo_quant()))

Test Plan:
python test/quantization/test_quant_api.py
python test/integration/test_integration.py

Reviewers:

Subscribers:

Tasks:

Tags:

Summary:
This PR deprecates a few quantization APIs and here are the bc-breaking notes:

1. int8 weight only quantization
int8 weight only quant module swap API
```
apply_weight_only_int8_quant(model)
```

and
int8 weight only tensor subclass API
```
change_linear_weights_to_int8_woqtensors(model)
```

-->

unified tensor subclass API
```
quantize(model, get_apply_int8wo_quant()))
```

2. int8 dynamic quantization

```
apply_dynamic_quant(model)
```
or
```
change_linear_weights_to_int8_dqtensors(model)
```

-->

unified tensor subclass API
```
quantize(model, get_apply_int8dyn_quant()))
```

3. int4 weight only quantization
```
change_linear_weights_to_int4_wotensors(model)
```

-->

unified tensor subclass API
```
quantize(model, get_apply_int4wo_quant()))
```

Test Plan:
python test/quantization/test_quant_api.py
python test/integration/test_integration.py

Reviewers:

Subscribers:

Tasks:

Tags:
Copy link

pytorch-bot bot commented Jun 13, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/357

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit e9fde84 with merge base 950a893 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 13, 2024
@jerryzh168 jerryzh168 requested a review from msaroufim June 13, 2024 02:01
@jerryzh168
Copy link
Contributor Author

looks like there are not many tests for the release branch cherry-pick merge

@jerryzh168 jerryzh168 merged commit 7e0027a into pytorch:release/0.3 Jun 13, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants