Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Conversation

@jwfromm
Copy link
Contributor

@jwfromm jwfromm commented Aug 12, 2024

Summary:
This diff does some minor cleanup to enable d2go to compile for both Cuda and AMD. Specifically, we have automated hipification scripts that make cuda code compatible for AMD compilation. However, it was struggling with some of the names and imports in this repo. Changing the name "cuda" to "gpu" helped resolve some of those issues and making the header imports a little cleaner fixed the rest.

Reviewed By: jianyuh

Differential Revision: D61080247

Summary:
This diff extends several targets to be hip compatible and fixes a few silly hipification issues with those targets.

After these changes, all dependencies needed for the face enhancer can compile with AMD.

A few silly issues that I had to hack around, maybe we could improve hipification to avoid similar issues in the future:
* Some of the dependencies used sources in `src/cuda/**.cu`. Hipification tried to rename "cuda" to "hip" and broke the paths. I'm not sure where that rename happens so I just changed the directory from "cuda" to "gpu" to avoid the issue.
* One header import called `THCAtomics.cuh` was incorrectly being renamed to `THHAtomics.cuh`, which doesnt exist. Fortunately an equivalent import that doesnt have name issues was available.

We also might want to consider graduating the cpp_library_hip bazel helper out of fbgemm since it seems pretty generally useful.

For some of the targets, we needed to build a python cpp extension, which as far as I can tell we didnt have good hipification for yet. I added a new buck rule very similar to our standard cpp_library_hip rule that creates an extension instead. It's a little copy-pasted so if there are cleaner ways to work around this requirement let me know.

Reviewed By: jianyuh

Differential Revision: D61080247
@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 Aug 12, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D61080247

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 7739077.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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 Merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants