Skip to content

Enable AWQ on Intel GPU. #2248

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

xiaowangintel
Copy link

@xiaowangintel xiaowangintel commented May 23, 2025

Following pytorch/pytorch#153019 requests, we enable awq-uint4 for Intel GPU in pytorch/ao after RTN ready. Currently, the implementation of awq-uint4 uses the ZeroPointDomain.FLOAT and ZeroPointDomain.INT.

How to run awq quantization model:

cd torchao/prototype/awq

#for zero point int domain:
python example.py --device xpu --zero_point_domin=int  huggingface-model(such as meta-llama/Llama-3.1-8B-Instruct) awq-uint4-128

#for zero point float domain:
python example.py --device xpu huggingface-model(such as meta-llama/Llama-3.1-8B-Instruct) awq-uint4-128

#Results of meta-llama/Llama-3.1-8B-Instruct for int domain on Intel GPU:
{'perplexity': {'perplexity': 10.099576950073242, 'prediction_time': 0.20489671968780787}}

#Results of meta-llama/Llama-3.1-8B-Instruct for float domain on Intel GPU:
{'perplexity': {'perplexity': 10.166366577148438, 'prediction_time': 0.12182355982012454}}

#Results of meta-llama/Llama-3.1-8B-Instruct for float domain on NVIDIA-A100 GPU:
Results: {'perplexity': {'perplexity': 10.160041809082031, 'prediction_time': 0.4466673863672577}}

Copy link

pytorch-bot bot commented May 23, 2025

🔗 Helpful Links

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

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

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 23, 2025
@xiaowangintel
Copy link
Author

@liangan1 Can you help to review this PR?

@liangan1
Copy link

how about perplexity on cuda?

Copy link

@liangan1 liangan1 left a comment

Choose a reason for hiding this comment

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

LGTM

@xiaowangintel xiaowangintel changed the title [WIP]Enable AWQ on Intel GPU. Enable AWQ on Intel GPU. May 23, 2025
@liangan1
Copy link

@EikanWang

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