Skip to content

Duplicate cat if sandwiched between deq/quant (#19925)#19925

Merged
meta-codesync[bot] merged 1 commit into
pytorch:mainfrom
DrJessop:export-D107174424
Jun 3, 2026
Merged

Duplicate cat if sandwiched between deq/quant (#19925)#19925
meta-codesync[bot] merged 1 commit into
pytorch:mainfrom
DrJessop:export-D107174424

Conversation

@DrJessop

@DrJessop DrJessop commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary:

Suppose we have (int_data -> dq, fp32_data) -> cat -> (slice, q)

This is a case with a multi-user cat. If we duplicated the cat, we would have

(int_data -> dq, fp32_data) -> (cat -> slice, cat -> q)

Then, in one of our chains, we could push the q above its cat. This allows for us to at least keep one chain using quantized math the whole way instead of forcing a break to fp32 in both chains.

Example {F1990607611}. Just suppose that we already hoisted the quant node to be right underneath the cat.

In a later pass, will hoist quant under single-user cat above the cat. This pass only duplicates the cat for each quant op user which has independent quant params.

Reviewed By: mcremon-meta

Differential Revision: D107174424

@pytorch-bot

pytorch-bot Bot commented Jun 1, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

⏳ No Failures, 15 Pending

As of commit 7bd12f9 with merge base b63adec (image):
💚 Looks good so far! There are no failures yet. 💚

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

@meta-cla meta-cla 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 Jun 1, 2026
@meta-codesync

meta-codesync Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

@DrJessop has exported this pull request. If you are a Meta employee, you can view the originating Diff in D107174424.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@meta-codesync meta-codesync Bot changed the title Duplicate cat if sandwiched between deq/quant Duplicate cat if sandwiched between deq/quant (#19925) Jun 2, 2026
@DrJessop DrJessop force-pushed the export-D107174424 branch from 1f11fca to c826de9 Compare June 2, 2026 21:01
DrJessop added a commit to DrJessop/executorch that referenced this pull request Jun 2, 2026
Summary:

Suppose we have (int_data -> dq, fp32_data) -> cat -> (slice, q)

This is a case with a multi-user cat. If we duplicated the cat, we would have

(int_data -> dq, fp32_data) -> (cat -> slice, cat -> q)

Then, in one of our chains, we could push the q above its cat. This allows for us to at least keep one chain using quantized math the whole way instead of forcing a break to fp32 in both chains.

Example {F1990607611}. Just suppose that we already hoisted the quant node to be right underneath the cat.

In a later pass, will hoist quant under single-user cat above the cat. This pass only duplicates the cat for each quant op user which has independent quant params.

Reviewed By: mcremon-meta

Differential Revision: D107174424
DrJessop added a commit to DrJessop/executorch that referenced this pull request Jun 2, 2026
Summary:

Suppose we have (int_data -> dq, fp32_data) -> cat -> (slice, q)

This is a case with a multi-user cat. If we duplicated the cat, we would have

(int_data -> dq, fp32_data) -> (cat -> slice, cat -> q)

Then, in one of our chains, we could push the q above its cat. This allows for us to at least keep one chain using quantized math the whole way instead of forcing a break to fp32 in both chains.

Example {F1990607611}. Just suppose that we already hoisted the quant node to be right underneath the cat.

In a later pass, will hoist quant under single-user cat above the cat. This pass only duplicates the cat for each quant op user which has independent quant params.

Reviewed By: mcremon-meta

Differential Revision: D107174424
@DrJessop DrJessop force-pushed the export-D107174424 branch from c826de9 to 56bfbdb Compare June 2, 2026 21:15
DrJessop added a commit to DrJessop/executorch that referenced this pull request Jun 2, 2026
Summary:

Suppose we have (int_data -> dq, fp32_data) -> cat -> (slice, q)

This is a case with a multi-user cat. If we duplicated the cat, we would have

(int_data -> dq, fp32_data) -> (cat -> slice, cat -> q)

Then, in one of our chains, we could push the q above its cat. This allows for us to at least keep one chain using quantized math the whole way instead of forcing a break to fp32 in both chains.

Example {F1990607611}. Just suppose that we already hoisted the quant node to be right underneath the cat.

In a later pass, will hoist quant under single-user cat above the cat. This pass only duplicates the cat for each quant op user which has independent quant params.

Reviewed By: mcremon-meta

Differential Revision: D107174424
DrJessop added a commit to DrJessop/executorch that referenced this pull request Jun 2, 2026
Summary:

Suppose we have (int_data -> dq, fp32_data) -> cat -> (slice, q)

This is a case with a multi-user cat. If we duplicated the cat, we would have

(int_data -> dq, fp32_data) -> (cat -> slice, cat -> q)

Then, in one of our chains, we could push the q above its cat. This allows for us to at least keep one chain using quantized math the whole way instead of forcing a break to fp32 in both chains.

Example {F1990607611}. Just suppose that we already hoisted the quant node to be right underneath the cat.

In a later pass, will hoist quant under single-user cat above the cat. This pass only duplicates the cat for each quant op user which has independent quant params.

Reviewed By: mcremon-meta

Differential Revision: D107174424
Summary:

Suppose we have (int_data -> dq, fp32_data) -> cat -> (slice, q)

This is a case with a multi-user cat. If we duplicated the cat, we would have

(int_data -> dq, fp32_data) -> (cat -> slice, cat -> q)

Then, in one of our chains, we could push the q above its cat. This allows for us to at least keep one chain using quantized math the whole way instead of forcing a break to fp32 in both chains.

Example {F1990607611}. Just suppose that we already hoisted the quant node to be right underneath the cat.

In a later pass, will hoist quant under single-user cat above the cat. This pass only duplicates the cat for each quant op user which has independent quant params.

Reviewed By: mcremon-meta

Differential Revision: D107174424
@DrJessop DrJessop force-pushed the export-D107174424 branch from 56bfbdb to 7bd12f9 Compare June 3, 2026 16:38
@meta-codesync meta-codesync Bot merged commit 9e394da into pytorch:main Jun 3, 2026
175 of 176 checks passed
Gasoonjia pushed a commit that referenced this pull request Jun 8, 2026
Differential Revision: D107174424

Pull Request resolved: #19925
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. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants