-
Notifications
You must be signed in to change notification settings - Fork 24.7k
[CPU] fix _weight_int8pack_mm with large output shape #158341
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
base: main
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/158341
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (2 Unrelated Failures)As of commit eeb0d08 with merge base a5e6881 ( BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Hi @lezcano @nikitaved @IvanYashchuk Could you please review this PR since you are code owners? Thanks |
@pytorchbot merge |
Merge failedReason: Approvers from one of the following sets are needed:
|
Summary
_weight_int8pack_mm
on CPU may cause segmentation fault if output shape is large (i.e., M * N is large). It's because the kernel compute output buffer address byauto* C_ptr = C_data + mb_start * N + nb_start;
where both
mb_start
andN
areint
and when they are large their product may overflow.The solution is simple: declare these variables as
int64_t
so that the product won't overflow.Test plan
cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @jerryzh168