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

[Not for land] Util for saving quantized model #1280

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

kwen2501
Copy link
Contributor

@kwen2501 kwen2501 commented Oct 8, 2024

When composing distributed with quantization, one potential case is that the model has been quantized and saved so a second run do not need to quantize it again.

This is a script for quantizing a model and save it to disk.

The quantization can be done via either:

  • --quantize abc.json, or
  • quantize_(model, int8_weight_only()).

The latter is not in torchchat today.

Cc: @Jack-Khuu @jerryzh168

Copy link

pytorch-bot bot commented Oct 8, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchchat/1280

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

✅ No Failures

As of commit ea41439 with merge base 9fb7999 (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 Meta Open Source bot. label Oct 8, 2024

from torchchat.utils.build_utils import set_precision

from torchao.quantization import quantize_, int8_weight_only
Copy link
Contributor

Choose a reason for hiding this comment

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

we now support tensor parallelism for int4_weight_only, float8_weight_only and float8_dynamic_activation_float8_weight as well I think, feel free to try out

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.

LGTM

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 Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants