Skip to content

[Compiler] Rename compiler ROCM target to HIP - #18477

Closed
nithinsubbiah wants to merge 1 commit into
iree-org:mainfrom
nithinsubbiah:rename_rocm_target
Closed

nithinsubbiah wants to merge 1 commit into
iree-org:mainfrom
nithinsubbiah:rename_rocm_target

Conversation

@nithinsubbiah

Copy link
Copy Markdown
Collaborator

As a follow-up to #17710, this patch renames the compiler target backend from ROCM to HIP to be consistent with driver.

User-facing changes:
IREE_TARGET_BACKEND_ROCM to IREE_TARGET_BACKEND_HIP
iree-hal-target-backends=rocm to iree-hal-target-backends=hip

@benvanik

Copy link
Copy Markdown
Collaborator

IIRC we didn't want to do this? (I think Lei told me ROCM and HIP were independent? did someone change their mind? :)

@nithinsubbiah

Copy link
Copy Markdown
Collaborator Author

They are indeed independent. We wanted to be consistent with the backend names and thus I started working on it. But happy to hear thoughts on moving forward
cc: @antiagainst @ScottTodd

@benvanik

Copy link
Copy Markdown
Collaborator

Mostly just thinking about HSA: it will be using the same codegen pipeline but not targeting HIP, so if there's a better name for what it is that'd be ideal ("ROCDL" may have been what Lei mentioned before). There will be a HIP IREE::HAL::TargetDevice and HSA IREE::HAL::TargetDevice that share the same codegen backend.

@stellaraccident

Copy link
Copy Markdown
Collaborator

I'm not sure there's a better answer. Both rocm and hip names refer to software stacked above. If we were naming from scratch, we would name like llvm: "amdgpu". From that perspective, I would rename the runtime driver "amdgpu-hip". That's what I call it in shortfin fwiw.

@qedawkins

Copy link
Copy Markdown
Contributor

Ok you all type too fast. +1 to amdgpu-hip, or maybe amdgpu-llvm. Either way it would be nice to switch away from "rocm."

@kuhar

kuhar commented Sep 10, 2024

Copy link
Copy Markdown
Member

FWIW, the bespoke clang is called hipcc too

@benvanik

Copy link
Copy Markdown
Collaborator

AMDGPU may work, but ROCm as the umbrella also makes sense (HIP and ROCr/HSA are both under the ROCm umbrella) and is equivalent to CUDA.

@benvanik

Copy link
Copy Markdown
Collaborator

(basically, I don't want inconsistency and I don't want the compiler side that targets multiple runtime implementations named after a particular runtime implementation)

@kuhar

kuhar commented Sep 10, 2024

Copy link
Copy Markdown
Member

AMDGPU alone is also the ultimate backend for spirv/vulkan with amdvlk. If they ever implement offline shader compilation, we will have a name collision with that.

@qedawkins

Copy link
Copy Markdown
Contributor

IIUC AMDGPU is the name of the target in llvm right? https://llvm.org/docs/AMDGPUUsage.html

So maybe amdgpu-llvm for clarity? I kind of like the idea of being consistent with the llvm backend we're targeting and also differntiating from spir-v.

@kuhar

kuhar commented Sep 10, 2024 •

Copy link
Copy Markdown
Member

IIUC AMDGPU is the name of the target in llvm right? https://llvm.org/docs/AMDGPUUsage.html

So maybe amdgpu-llvm for clarity? I kind of like the idea of being consistent with the llvm backend we're targeting and also differntiating from spir-v.

amdgpu is the name of the backend, the two targets are amdgcn--amdpal (graphics/vulkan) and amdgcn-amd-hsa (hip/rocm)

@kuhar

kuhar commented Sep 10, 2024

Copy link
Copy Markdown
Member

IMO hip and amdgpu-hip are the two least problematic names

@benvanik

benvanik commented Sep 10, 2024 •

Copy link
Copy Markdown
Collaborator

reminder: hip != hsa, and we'll be using the same thing for hsa - in my dreams we end up deleting our hip HAL - hip is problematic :)

(the name here is for us - it doesn't have to match LLVM or anyone else - it's just what we call our target)

@kuhar

kuhar commented Sep 10, 2024

Copy link
Copy Markdown
Member

OK, I give up, naming proves hard again 🙃

@benvanik

Copy link
Copy Markdown
Collaborator

yeah, we're in the ROC* name playground that is certifiably inscrutable - there's no good names :P

@nithinsubbiah

nithinsubbiah commented Sep 10, 2024 •

Copy link
Copy Markdown
Collaborator Author

What if we go with amdgpu-rocm for the compiler target thereby encompassing both hip and hsa runtime drivers, and also skirting the potential name clash with vulkan.

Unless someone has a strong reason to not have rocm keyword anywhere

@qedawkins

Copy link
Copy Markdown
Contributor

Also tangential question, could we have aliased names for target backends? e.g. if I put in hip or hsa as the compiler backend it would alias to amdgpu-rocm or whatever we choose to call it. If so I'd prefer to lean into a more llvm focused name because it makes the C++ very clear that it's going to hand the executables off to llvm.

@qedawkins

Copy link
Copy Markdown
Contributor

Also tangential question, could we have aliased names for target backends? e.g. if I put in hip or hsa as the compiler backend it would alias to amdgpu-rocm or whatever we choose to call it. If so I'd prefer to lean into a more llvm focused name because it makes the C++ very clear that it's going to hand the executables off to llvm.

My only problem with rocm is that I've never really understood what it is :P

@benvanik

Copy link
Copy Markdown
Collaborator

rocm == cuda (effectively) - an umbrella term for the entire suite of libraries/tools/languages/etc

@stellaraccident

Copy link
Copy Markdown
Collaborator

I think the stem can defensively be amdgpu or rocm. I prefer the first as it is more descriptive of a physical thing that will always be that thing.

@kuhar

kuhar commented Sep 10, 2024

Copy link
Copy Markdown
Member

Also tangential question, could we have aliased names for target backends? e.g. if I put in hip or hsa as the compiler backend it would alias to amdgpu-rocm or whatever we choose to call it. If so I'd prefer to lean into a more llvm focused name because it makes the C++ very clear that it's going to hand the executables off to llvm.

the llvm command line flag library supports aliases

@av-maslov

Copy link
Copy Markdown

Could you write - how? I tried to rebuild with this flag, but it is not recognized

@ScottTodd

Copy link
Copy Markdown
Member

Could you write - how? I tried to rebuild with this flag, but it is not recognized

Please file issues for support questions to help keep pull request code reviews focused on the code. To your question, configure CMake with -DIREE_TARGET_BACKEND_ROCM=ON in the list of options. We would need to see what you tried and the logs to debug further.

@benvanik

Copy link
Copy Markdown
Collaborator

(closing as stale)

@benvanik benvanik closed this Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants