10000 Support fp8 output of _scaled_mm for CPU by yanbing-j · Pull Request #153600 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

Support fp8 output of _scaled_mm for CPU #153600

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 2 commits into
base: main
Choose a base branch
from

Conversation

yanbing-j
Copy link
Collaborator
@yanbing-j yanbing-j commented May 15, 2025

This PR is to support fp8 output of torch._scaled_mm for CPU, and create related UTs with fp8 and bf16/fp16/fp32 output.

cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @jerryzh168 @gujinghui @PenghuiCheng @jianyuh @min-jean-cho @Guobing-Chen @Xia-Weiwen @snadampal

Copy link
pytorch-bot bot commented May 15, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit d992029 with merge base 1a722f6 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot bot added ciflow/linux-aarch64 linux aarch64 CI workflow module: cpu CPU specific problem (e.g., perf, algorithm) module: mkldnn Related to Intel IDEEP or oneDNN (a.k.a. mkldnn) integration labels May 15, 2025
@yanbing-j yanbing-j added the topic: not user facing topic category label May 15, 2025
@yanbing-j yanbing-j force-pushed the yanbing/scaled_mm_fp8_output branch 2 times, most recently from 8876f82 to 75a6bba Compare May 16, 2025 07:20
@yanbing-j yanbing-j marked this pull request as ready for review May 16, 2025 07:21
@yanbing-j yanbing-j added the ciflow/trunk Trigger trunk jobs on your pull request label May 16, 2025
@yanbing-j yanbing-j requested a review from mingfeima May 16, 2025 07:23
Comment on lines 594 to 595
ideep::tensor dst_scales_t = ideep::tensor(ideep::scale_t(1, output_scale));
args.insert({DNNL_ARG_ATTR_SCALES | DNNL_ARG_DST, dst_scales_t});
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to check output_scale != 1.0f here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, I will follow the output_scale in qconv and add the check here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@yanbing-j yanbing-j requested a review from Xia-Weiwen May 16, 2025 07:45
Copy link
Collaborator
@leslie-fang-intel leslie-fang-intel 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
ciflow/linux-aarch64 linux aarch64 CI workflow ciflow/trunk Trigger trunk jobs on your pull request module: cpu CPU specific problem (e.g., perf, algorithm) module: mkldnn Related to Intel IDEEP or oneDNN (a.k.a. mkldnn) integration open source topic: not user facing topic category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0