Skip to content

Fix generate.py for fbgemm int4 integration #2273

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
May 29, 2025

Conversation

jerryzh168
Copy link
Contributor

Summary:

Updated table:

overall tokens/sec TTFT Peak Memory Model Size
baseline - 1 131.65 0.0220 16.24 GB 15.01 GB
baseline - 128 76.38 0.0544 26.92 GB 15.01 GB
int4wo - 1 207.69 0.0288 6.41 GB 3.99 GB
int4wo - 128 12.85 0.4223 16.01 GB 3.99 GB
fbgemm-int4 - 1 (w/ compile) 61.12 0.0212 7.59 GB 3.00 GB
fbgemm-int4 - 128 (w/ compile) 71.23 0.0576 16.13 GB 3.99 GB

Verified that compile works:

python generate.py --checkpoint_path $CHECKPOINT_PATH/$MODEL_REPO/model.pth --quantization fbgemm-int4-128 --batch_size 1 --compile

==========
Average overall tokens/sec: 61.12
Average decode tokens/sec: 61.5512 s
Average TTFT: 0.0212 s
Average tokens/sec: 61.12
Average Bandwidth: 243.70 GB/s
Peak Memory Usage: 7.59 GB
Model Size: 3.99 GB

python generate.py --checkpoint_path $CHECKPOINT_PATH/$MODEL_REPO/model.pth --quantization fbgemm-int4-128 --batch_size 128 --compile

==========
Average overall tokens/sec: 71.23
Average decode tokens/sec: 72.8871 s
Average TTFT: 0.0576 s
Average tokens/sec: 71.23
Average tokens/sec including batches 9116.81
Average Bandwidth: 284.00 GB/s
Peak Memory Usage: 16.13 GB
Model Size: 3.99 GB

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

Summary:

Updated table:

|                 | overall tokens/sec | TTFT | Peak Memory | Model Size |
| ---------| -------------------| ------| --------------| -----------|
| baseline - 1 | 131.65 | 0.0220 | 16.24 GB | 15.01 GB |
| baseline - 128| 76.38 | 0.0544 | 26.92 GB | 15.01 GB|
| int4wo - 1 | 207.69 | 0.0288 | 6.41 GB | 3.99 GB |
| int4wo - 128 | 12.85 | 0.4223 |  16.01 GB | 3.99 GB |
| fbgemm-int4 - 1  (w/ compile) | 61.12 | 0.0212 | 7.59 GB | 3.00 GB |
| fbgemm-int4 - 128 (w/ compile) | 71.23 | 0.0576 | 16.13 GB | 3.99 GB |

Verified that compile works:

python generate.py --checkpoint_path $CHECKPOINT_PATH/$MODEL_REPO/model.pth --quantization fbgemm-int4-128 --batch_size 1 --compile

==========
Average overall tokens/sec: 61.12
Average decode tokens/sec: 61.5512 s
Average TTFT: 0.0212 s
Average tokens/sec: 61.12
Average Bandwidth: 243.70 GB/s
Peak Memory Usage: 7.59 GB
Model Size: 3.99 GB

python generate.py --checkpoint_path $CHECKPOINT_PATH/$MODEL_REPO/model.pth --quantization fbgemm-int4-128 --batch_size 128 --compile

==========
Average overall tokens/sec: 71.23
Average decode tokens/sec: 72.8871 s
Average TTFT: 0.0576 s
Average tokens/sec: 71.23
Average tokens/sec including batches 9116.81
Average Bandwidth: 284.00 GB/s
Peak Memory Usage: 16.13 GB
Model Size: 3.99 GB

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
Copy link

pytorch-bot bot commented May 29, 2025

🔗 Helpful Links

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

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

⏳ No Failures, 4 Pending

As of commit 3263c1d with merge base 4d5f657 (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 29, 2025
@jerryzh168 jerryzh168 added the topic: not user facing Use this tag if you don't want this PR to show up in release notes label May 29, 2025
@jerryzh168 jerryzh168 merged commit d963a88 into pytorch:main May 29, 2025
18 of 21 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. topic: not user facing Use this tag if you don't want this PR to show up in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants