Skip to content

[Inductor][Quant]Support qconv_pointwise.tensor and qconv2d_pointwise.binary_tensor#166608

Closed
jiayisunx wants to merge 12 commits intogh/jiayisunx/87/basefrom
gh/jiayisunx/87/head
Closed

[Inductor][Quant]Support qconv_pointwise.tensor and qconv2d_pointwise.binary_tensor#166608
jiayisunx wants to merge 12 commits intogh/jiayisunx/87/basefrom
gh/jiayisunx/87/head

Conversation

@jiayisunx
Copy link
Collaborator

@jiayisunx jiayisunx commented Oct 30, 2025

@pytorch-bot
Copy link

pytorch-bot bot commented Oct 30, 2025

🔗 Helpful Links

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

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

✅ You can merge normally! (1 Unrelated Failure)

As of commit 9c168c4 with merge base aa504d4 (image):

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.

jiayisunx added a commit that referenced this pull request Oct 30, 2025
@jiayisunx jiayisunx marked this pull request as draft October 30, 2025 03:22
jiayisunx added a commit that referenced this pull request Oct 30, 2025
[ghstack-poisoned]
@jiayisunx jiayisunx added ciflow/trunk Trigger trunk jobs on your pull request release notes: inductor labels Nov 3, 2025
jiayisunx added a commit that referenced this pull request Nov 4, 2025
[ghstack-poisoned]
jiayisunx added a commit that referenced this pull request Nov 5, 2025
[ghstack-poisoned]
@jiayisunx jiayisunx changed the title [Quant][PT2E][X86]Support qconv_pointwise.tensor [Inductor][Quant]Support qconv_pointwise.tensor and qconv2d_pointwise.binary_tensor Nov 10, 2025
jiayisunx added a commit that referenced this pull request Nov 12, 2025
[ghstack-poisoned]
jiayisunx added a commit that referenced this pull request Nov 12, 2025
[ghstack-poisoned]
jiayisunx added a commit that referenced this pull request Nov 14, 2025
jiayisunx added a commit that referenced this pull request Nov 14, 2025
jiayisunx added a commit that referenced this pull request Nov 14, 2025
jiayisunx added a commit that referenced this pull request Nov 14, 2025
jiayisunx added a commit that referenced this pull request Nov 14, 2025
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
jiayisunx added a commit that referenced this pull request Nov 17, 2025
@jiayisunx jiayisunx requested a review from Xia-Weiwen November 17, 2025 05:11
[ghstack-poisoned]
"none", None, "none", [], ""
): generate_pattern_with_output_quant(
get_qconv_pt2e_pattern(1),
get_qconv_pt2e_pattern(users=1),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why don't we need to consider the tensor variant here?

Copy link
Collaborator Author

@jiayisunx jiayisunx Nov 19, 2025

Choose a reason for hiding this comment

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

These fusions have migrated to torchao, so I will make more changes to this part directly in torchao.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Then is this change needed? Does it work if we remove this change and depend on torchao's pass?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This change is needed because _register_quantization_lowerings has not been migrated to torchao, and all changes to this file are to modify _register_quantization_lowerings to support fp8.

jiayisunx added a commit that referenced this pull request Nov 18, 2025
[ghstack-poisoned]
@jiayisunx jiayisunx requested a review from Xia-Weiwen November 19, 2025 01:28
jiayisunx added a commit that referenced this pull request Nov 19, 2025
[ghstack-poisoned]
"none", None, "none", [], ""
): generate_pattern_with_output_quant(
get_qconv_pt2e_pattern(1),
get_qconv_pt2e_pattern(users=1),
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we always use the tensor variant now and get_qconv_pt2e_pattern returns the default variant here, will the fusion pass will work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For int8, the qconv pattern here is always the qconv_pointwise.default

@jiayisunx jiayisunx requested a review from Xia-Weiwen November 19, 2025 05:21
qw: "TensorBox", # qw
w_scale: "TensorBox",
w_zero_point: "TensorBox",
w_zero_point,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this change needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, in order to pass python type checking.

packed_weight: TensorBox,
w_scale: TensorBox,
w_zp: TensorBox,
w_zp,
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

packed_weight: TensorBox,
w_scale: TensorBox,
w_zp: TensorBox,
w_zp,
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

@jiayisunx jiayisunx requested a review from mingfeima November 24, 2025 02:34
@mingfeima mingfeima marked this pull request as ready for review November 24, 2025 02:40
@jiayisunx jiayisunx requested a review from jansel November 24, 2025 05:53
@jiayisunx
Copy link
Collaborator Author

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@github-actions github-actions bot deleted the gh/jiayisunx/87/head branch December 25, 2025 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants