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

Add AffineQuantizedTensor based workflow doc and examples #277

Merged
merged 2 commits into from
May 29, 2024

Conversation

jerryzh168
Copy link
Contributor

Summary:
att

Test Plan:
.

Reviewers:

Subscribers:

Tasks:

Tags:

Copy link

pytorch-bot bot commented May 25, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit accdb3d with merge base 6dd63b8 (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 May 25, 2024


# benchmark to see the speedup
from torch.utils.benchmark import Timer
Copy link
Member

Choose a reason for hiding this comment

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

We have a benchmark util now https://github.com/pytorch/ao/blob/main/torchao/utils.py#L4

Mind if we update it in case yours is subtly different?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, but we probably need to follow up and enable benchmark for cpu and mps as well for that, created an issue here: #287

# optional filtering for module name, shape etc.
# quantization activation (needed by dynamic quantization)
# m.weight = nn.Parameter(to_laq(m.weight, device=..., layout=..., ...))
m.weight = nn.Parameter(to_aq(m.weight, device=..., layout=..., ...))
Copy link
Member

Choose a reason for hiding this comment

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

Can we make this a real snippet people can copy paste?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah sure

Copy link
Member

@msaroufim msaroufim left a comment

Choose a reason for hiding this comment

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

Some minor feedback but thank you for writing this!

Summary:
att

Test Plan:
.

Reviewers:

Subscribers:

Tasks:

Tags:
@msaroufim msaroufim merged commit cbc74ee into pytorch:main May 29, 2024
13 checks passed
@jerryzh168 jerryzh168 deleted the add-aqt-docs branch July 2, 2024 20:31
dbyoung18 pushed a commit to dbyoung18/ao that referenced this pull request Jul 31, 2024
yanbing-j pushed a commit to yanbing-j/ao that referenced this pull request Dec 9, 2024
Add special case for zero-temperature sampling. For stories15M on my devserver, seems to improve tokens/sec as follows:

before: 189, 180, 166
after: 264, 285, 285
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