8000 [inductor] [bug fix] Fix `conv` on processing uint by shaoyuyoung · Pull Request #145136 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

[inductor] [bug fix] Fix conv on processing uint #145136

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

Closed
wants to merge 11 commits into from

Conversation

shaoyuyoung
Copy link
Contributor
@shaoyuyoung shaoyuyoung commented Jan 18, 2025

Copy link
pytorch-bot bot commented Jan 18, 2025

🔗 Helpful Links

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

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

❌ 30 New Failures

As of commit f5c60f2 with merge base 425804d (image):

NEW FAILURES - The following jobs have failed:

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

@shaoyuyoung
Copy link
Contributor Author

@pytorchbot label "topic: not user facing"

@pytorch-bot pytorch-bot bot added the topic: not user facing topic category label Jan 18, 2025
@shaoyuyoung
Copy link
Contributor Author
shaoyuyoung commented Jan 18, 2025

I am very sorry that I deleted the previous PR because of my misoperation :(

@shaoyuyoung
Copy link
Contributor Author
shaoyuyoung commented Jan 18, 2025

@jansel , mind retaking a look?
really sorry, please forgive me
It seems that I made a mess.... some third-party modules have been added :(

@shaoyuyoung
Copy link
Contributor Author

this time, it should be fine.
I will take care next time. :)

@shaoyuyoung shaoyuyoung requested a review from jansel January 20, 2025 04:57
@jansel
Copy link
Contributor
jansel commented Jan 20, 2025

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Jan 20, 2025
@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

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 1 mandatory check(s) failed. The first few are:

Dig deeper by viewing the failures on hud

Details for Dev Infra team Raised by workflow job

Failing merge rule: Core Maintainers

@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 20, 2025 21:40 Inactive
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 20, 2025 21:40 Inactive
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 20, 2025 21:40 Inactive
@shaoyuyoung
Copy link
Contributor Author

CI was broaken just now?

@jansel
Copy link
Contributor
jansel commented Jan 21, 2025

The lint errors are real. Not sure about the others, you could try rebasing.

@shaoyuyoung
Copy link
Contributor Author

The lint errors are real. Not sure about the others, you could try rebasing.

got it, I will investigate this :)

@shaoyuyoung
Copy link
Contributor Author

I have rewritten UT by testing this case on CPU.
But CI still fails on cpu_cpp_wrapper :(

Should I use @skip_if_cpp_wrapper on this UT?

@shaoyuyoung
Copy link
Contributor Author
shaoyuyoung commented Feb 6, 2025

It seems that regression testing fails on here (?)

BaseTest(
"test_qconv2d_dequant_promotion",
"cpu",
test_mkldnn_pattern_matcher.TestPatternMatcher(),
condition=torch.backends.mkldnn.is_available() and not IS_WINDOWS,
),

forgive me I can't understand why. :(

@jansel jansel self-requested a review February 6, 2025 21:32
@jansel
Copy link
Contributor
jansel commented Feb 7, 2025

What is the error from the cpu_cpp_wraper? Can you reproduce it locally?

@shaoyuyoung
Copy link
Contributor Author
shaoyuyoung commented Feb 7, 2025

CI reminds me this ut fails.
image

I have run the ut as follows locally

pytest -s -v test/inductor/test_cpu_cpp_wrapper.py -k test_qconv2d_add_relu_cpu_cpp_wrapper

It throws the error

RuntimeError: "conv" not implemented for 'torch.uint8'

I think maybe test_cpu_cpp_wraper uses torch.uint8?

My change adds the error check for conv with uint. Subsequently, these UTs fails

@jansel
Copy link
Contributor
jansel commented Feb 7, 2025

Did this previously work? I'm assuming the "q" in qconv2d is quantized, so maybe this is breaking that.

@shaoyuyoung
Copy link
Contributor Author

Did this previously work?

Sry, not sure about "this previously work". Do you mean whether this UT works in an older pytorch version or before my code change?

@jansel
Copy link
Contributor
jansel commented Feb 8, 2025

yes

@shaoyuyoung
Copy link
Contributor Author
shaoyuyoung commented Feb 10, 2025

Do you mean whether this UT works in an older pytorch version or before my code

I have done this and found that some UTs in test_cpu_cpp_wraper which consist qconv2d breaking my code change. I guess that qconv2d in inductor uses uint8? (conflicted UTs' log is below)

torch._dynamo.exc.BackendCompilerFailed: backend='inductor' raised:
RuntimeError: "conv" not implemented for 'torch.uint8'

how should we address this conflict? I think a "dirty" solution is to bring this type check to some other places instead of _meta_registrations (e.g., decomposition or lowering). But I'm not sure where is the optimization pass of conv

@jansel
Copy link
Contributor
jansel commented Feb 10, 2025

We shouldn't break the existing behavior. Might need to look more into what the test is doing.

@shaoyuyoung
Copy link
Contributor Author

Might need to look more into what the test is doing.

I'll try my best to investigate this.

Copy link
Contributor
@jansel jansel left a comment

Choose a reason for hiding this comment

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

Re-request review once I should take another look at this

@soulitzer soulitzer added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Feb 24, 2025
@shaoyuyoung shaoyuyoung marked this pull request as draft March 31, 2025 01:44
Copy link
Contributor

Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as Stale.
Feel free to remove the Stale label if you feel this was a mistake.
If you are unable to remove the Stale label please contact a maintainer in order to do so.
If you want the bot to never mark this PR stale again, add the no-stale label.
Stale pull requests will automatically be closed after 30 days of inactivity.

@github-actions github-actions bot added the Stale label May 30, 2025
@github-actions github-actions bot closed this Jun 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk Trigger trunk jobs on your pull request module: inductor open source Stale topic: not user facing topic category triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[inductor] [dtype propogation] conv1d,2d,3d pass the check when handling uint8,16,32,64 while eager throws the error
6 participants
0