Skip to content

[MLIR][AMDGPU] Switch to code object version 5 #79144

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 1 commit into from
Jan 23, 2024
Merged

Conversation

saiislam
Copy link
Contributor

As AMDGPU backend has moved to cov5 as default, mlir should also switch to it.

As AMDGPU backend has moved to cov5 as default, mlir
should also switch to it.
@llvmbot
Copy link
Member

llvmbot commented Jan 23, 2024

@llvm/pr-subscribers-mlir-llvm

@llvm/pr-subscribers-mlir

Author: Saiyedul Islam (saiislam)

Changes

As AMDGPU backend has moved to cov5 as default, mlir should also switch to it.


Full diff: https://github.com/llvm/llvm-project/pull/79144.diff

1 Files Affected:

  • (modified) mlir/lib/Target/LLVM/ROCDL/Target.cpp (+1-1)
diff --git a/mlir/lib/Target/LLVM/ROCDL/Target.cpp b/mlir/lib/Target/LLVM/ROCDL/Target.cpp
index a589e5cbbb6198..cdcef1d6b459c6 100644
--- a/mlir/lib/Target/LLVM/ROCDL/Target.cpp
+++ b/mlir/lib/Target/LLVM/ROCDL/Target.cpp
@@ -238,7 +238,7 @@ void SerializeGPUModuleBase::addControlVariables(
   addControlVariable("__oclc_wavefrontsize64", wave64);
 
   llvm::Type *i32Ty = llvm::Type::getInt32Ty(module.getContext());
-  int abi = 400;
+  int abi = 500;
   abiVer.getAsInteger(0, abi);
   llvm::GlobalVariable *abiVersion = new llvm::GlobalVariable(
       module, i32Ty, true, llvm::GlobalValue::LinkageTypes::LinkOnceODRLinkage,

Copy link
Contributor

@arsenm arsenm left a comment

Choose a reason for hiding this comment

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

I would have hoped leaving it at 4 would have worked, but maybe this is missing something else from the controls. Is it not emitting the module flag?

@fabianmcg
Copy link
Contributor

LGTM!

I would have hoped leaving it at 4 would have worked, but maybe this is missing something else from the controls. Is it not emitting the module flag?

I haven't tested ROCM 6.0. As far as remember, it was still working with ROCM 5.6 and 5.7. However, I'll test it and see if there's a missing control variable.

@saiislam saiislam merged commit 9edd1c4 into llvm:main Jan 23, 2024
@krzysz00
Copy link
Contributor

@arsenm We haven't historically been setting that module flag

@krzysz00
Copy link
Contributor

(also, does this commit address SerializeToHsaco as well?)

@saiislam
Copy link
Contributor Author

(also, does this commit address SerializeToHsaco as well?)

If we mean this change, then yes it has been done.
addControlConstant("__oclc_ABI_version", 500, 32);

@arsenm
Copy link
Contributor

arsenm commented Jan 23, 2024

@arsenm We haven't historically been setting that module flag

So yes. Without the flag you are subject to the default of the backend which is now mismatched with the device lib link. You should just set both for next time

@krzysz00
Copy link
Contributor

IIRC, when the code for this was initially written (and so when it was ported into its current form) there wasn't such a flag to set or no one involved knew about it.

I can get this fixed in a followup patch

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.

5 participants