Skip to content

[ROCm][Windows] Fix compile torchvision image for ROCm #8897

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

Merged
merged 2 commits into from
Feb 20, 2025

Conversation

tvukovic-amd
Copy link
Contributor

@tvukovic-amd tvukovic-amd commented Feb 3, 2025

moved PyInit_image definition to common.cpp since image.cpp is not used

cc @jeffdaily @jithunnair-amd

Copy link

pytorch-bot bot commented Feb 3, 2025

🔗 Helpful Links

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

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

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

@facebook-github-bot
Copy link

Hi @tvukovic-amd!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@tvukovic-amd tvukovic-amd changed the title Fix compile torchvision image for ROCm [ROCm][Windows] Fix compile torchvision image for ROCm Feb 3, 2025
@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@jeffdaily
Copy link
Contributor

@tvukovic-amd I tried building your PR branch on ubuntu and got the error:

/var/lib/jenkins/vision/torchvision/csrc/io/image/image_hip.cpp:35:41: error: ‘decode_jpegs_hip’ was not declared in this scope; did you mean ‘decode_jpegs_cuda’?
   35 |         .op("image::decode_jpegs_hip", &decode_jpegs_hip)                                                                          |                                         ^~~~~~~~~~~~~~~~
      |                                         decode_jpegs_cuda

@tvukovic-amd tvukovic-amd force-pushed the fix_compile_image_with_rocm branch from 57f214f to 829b58a Compare February 7, 2025 17:28
Copy link
Contributor

@jeffdaily jeffdaily left a comment

Choose a reason for hiding this comment

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

Build for ROCm on ubuntu confirmed.

@NicolasHug
Copy link
Member

Thanks for the PR @tvukovic-amd. Before we merge this, can you help me understand why we are removing image.cpp from the sources, and also why the "hipified" source doesn't contain the proper PyInit_image definition?

vision/setup.py

Lines 284 to 285 in 085c7fd

# we need to exclude this in favor of the hipified source
sources.remove(image_dir / "image.cpp")

@tvukovic-amd
Copy link
Contributor Author

  • image.cpp is removed from sources only in ROCm case in this PR.
  • "hipified" source doesn't contain the proper PyInit_image definition because it is defined in image.cpp, so I moved it to common.cpp in image directory. This is Windows specific definition which wasn't recognized on PR mentioned since it was tested on ROCm on Linux.

@NicolasHug
Copy link
Member

@tvukovic-amd can you please merge with main so we can merge this?

@NicolasHug
Copy link
Member

Hm, I'm not sure what's going on but it looks like something went wrong with the merge, I see 173 lines added on the diff.

@tvukovic-amd tvukovic-amd force-pushed the fix_compile_image_with_rocm branch 3 times, most recently from 829b58a to bbcef3a Compare February 20, 2025 14:15
@NicolasHug NicolasHug merged commit 0f506f1 into pytorch:main Feb 20, 2025
1 check passed
Copy link

Hey @NicolasHug!

You merged this PR, but no labels were added.
The list of valid labels is available at https://github.com/pytorch/vision/blob/main/.github/process_commit.py

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.

4 participants