Skip to content

Conversation

YufengShi-dudu
Copy link
Collaborator

@YufengShi-dudu YufengShi-dudu commented Jun 19, 2025

  • In MatchWhereSelfDtypePass, target_dtype was initialized with fp32. This works when at least one of the inputs is fp32. But when both inputs are int32, the pass will incorrectly insert int32->fp32 casts. These casts are unnecessary and may introduce operand dtype mismatch issues.
  • Fix it by initializing target_dtype with input_dtype.

Change-Id: Id67aed8e90f886dc2f2491946847ad01702d5aa5

cc @digantdesai @freddan80 @per @zingo @oscarandersson8218

- In MatchWhereSelfDtypePass, target_dtype was initialized with fp32.
  This works when at least one of the inputs is fp32. But when both
  inputs are int32, the pass will incorrectly insert int32->fp32
  casts. These casts are unnecessary and may introduce operand
  dtype mismatch issues.
- Fix it by initializing target_dtype with input_dtype.

Change-Id: Id67aed8e90f886dc2f2491946847ad01702d5aa5
Signed-off-by: Yufeng Shi <yufeng.shi@arm.com>
@YufengShi-dudu YufengShi-dudu requested a review from zingo June 19, 2025 12:02
@YufengShi-dudu YufengShi-dudu added partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm ciflow/trunk labels Jun 19, 2025
Copy link

pytorch-bot bot commented Jun 19, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit b042484 with merge base 994752e (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 Jun 19, 2025
@YufengShi-dudu
Copy link
Collaborator Author

Unrelated fail: macos-job
@zingo

@zingo zingo added the release notes: arm Changes to the ARM backend delegate label Jun 19, 2025
@zingo zingo merged commit 10f0d22 into pytorch:main Jun 19, 2025
336 of 341 checks passed
hinriksnaer pushed a commit to hinriksnaer/executorch that referenced this pull request Jun 26, 2025
…lf (pytorch#11816)

- In MatchWhereSelfDtypePass, target_dtype was initialized with fp32.
This works when at least one of the inputs is fp32. But when both inputs
are int32, the pass will incorrectly insert int32->fp32 casts. These
casts are unnecessary and may introduce operand dtype mismatch issues.
- Fix it by initializing target_dtype with input_dtype.

Signed-off-by: Yufeng Shi <yufeng.shi@arm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm release notes: arm Changes to the ARM backend delegate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants