Skip to content

[Offload] Add CMake cache to be used in AMDGPU bot #119369

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
Dec 10, 2024

Conversation

jplehr
Copy link
Contributor

@jplehr jplehr commented Dec 10, 2024

Adds initial CMake cache definition that is similar to what we use in one of our production buidlbots. The goal is to consolidate the configurations and make them accessible.
This cache file is a first step and to prepare for full pipeline testing once the new bot comes online.

@llvmbot
Copy link
Member

llvmbot commented Dec 10, 2024

@llvm/pr-subscribers-offload

@llvm/pr-subscribers-backend-amdgpu

Author: Jan Patrick Lehr (jplehr)

Changes

Adds initial CMake cache definition that is similar to what we use in one of our production buidlbots. The goal is to consolidate the configurations and make them accessible.
This cache file is a first step and to prepare for full pipeline testing once the new bot comes online.


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

1 Files Affected:

  • (added) offload/cmake/caches/AMDGPUBot.cmake (+14)
diff --git a/offload/cmake/caches/AMDGPUBot.cmake b/offload/cmake/caches/AMDGPUBot.cmake
new file mode 100644
index 00000000000000..49a30dc6321f05
--- /dev/null
+++ b/offload/cmake/caches/AMDGPUBot.cmake
@@ -0,0 +1,14 @@
+set(LLVM_ENABLE_PROJECTS "clang;lld" CACHE STRING "")
+set(LLVM_ENABLE_RUNTIMES "compiler-rt;openmp;offload" CACHE STRING "")
+set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "")
+set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
+set(LLVM_LIT_ARGS "-vv --show-unsupported --timeout 100 --show-xfail -j 64" CACHE STRING "")
+# set(LLVM_RUNTIME_TARGETS default;amdgcn-amd-amdhsa CACHE STRING "")
+set(LLVM_TARGETS_TO_BUILD X86;AMDGPU CACHE STRING "")
+
+set(CLANG_DEFAULT_LINKER "lld" CACHE STRING "")
+
+set(CMAKE_INSTALL_PREFIX /tmp/llvm.install.jpbot CACHE STRING "")
+set(CMAKE_BUILD_TYPE Release CACHE STRING "")
+set(CMAKE_C_COMPILER_LAUNCHER ccache CACHE STRING "")
+set(CMAKE_CXX_COMPILER_LAUNCHER ccache CACHE STRING "")

set(LLVM_ENABLE_RUNTIMES "compiler-rt;openmp;offload" CACHE STRING "")
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "")
set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
set(LLVM_LIT_ARGS "-vv --show-unsupported --timeout 100 --show-xfail -j 64" CACHE STRING "")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
set(LLVM_LIT_ARGS "-vv --show-unsupported --timeout 100 --show-xfail -j 64" CACHE STRING "")
set(LLVM_LIT_ARGS "-v --show-unsupported --timeout 100 --show-xfail -j 64" CACHE STRING "")

-vv is documented as a "Deprecated alias for -v".

set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
set(LLVM_LIT_ARGS "-vv --show-unsupported --timeout 100 --show-xfail -j 64" CACHE STRING "")
# set(LLVM_RUNTIME_TARGETS default;amdgcn-amd-amdhsa CACHE STRING "")
set(LLVM_TARGETS_TO_BUILD X86;AMDGPU CACHE STRING "")
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks weird with no quotes around X86;AMDGPU. Does CMake not require them?

Copy link
Contributor

Choose a reason for hiding this comment

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

AFAIK quotes are only necessary on the command line because bash interprets ; as an end of line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's my understanding too. However, I used quotes for a lot of things, so I can also add them there to have this less surprising.

set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "")
set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
set(LLVM_LIT_ARGS "-vv --show-unsupported --timeout 100 --show-xfail -j 64" CACHE STRING "")
# set(LLVM_RUNTIME_TARGETS default;amdgcn-amd-amdhsa CACHE STRING "")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why include commented out stuff?

Copy link
Contributor

Choose a reason for hiding this comment

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

Guess we don't want the AMDGPU libc/libc++ stuff on the bot?

Copy link
Contributor Author

@jplehr jplehr Dec 10, 2024

Choose a reason for hiding this comment

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

Not on this bot. And it appears to break something.

@jplehr jplehr force-pushed the feat/amdgpu-bot-cmake-cache branch 2 times, most recently from 92d27bb to 9dabdc1 Compare December 10, 2024 15:22
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "")
set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
set(LLVM_LIT_ARGS "-v --show-unsupported --timeout 100 --show-xfail -j 32" CACHE STRING "")
set(LLVM_TARGETS_TO_BUILD "X86;AMDGPU" CACHE STRING "")
Copy link
Contributor

Choose a reason for hiding this comment

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

even though we don't support ARM yet, it still might be better to be a little bit future proof by using host.


set(CLANG_DEFAULT_LINKER "lld" CACHE STRING "")

set(CMAKE_INSTALL_PREFIX /tmp/llvm.install.jpbot CACHE STRING "")
Copy link
Contributor

Choose a reason for hiding this comment

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

If this file is purely for testing, I'd add the document to the beginning of this file; otherwise it doesn't make sense to me to force this.

set(CMAKE_INSTALL_PREFIX /tmp/llvm.install.jpbot CACHE STRING "")
set(CMAKE_BUILD_TYPE Release CACHE STRING "")
set(CMAKE_C_COMPILER_LAUNCHER ccache CACHE STRING "")
set(CMAKE_CXX_COMPILER_LAUNCHER ccache CACHE STRING "")
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a brief doc string as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, not sure what to document here other than state "kind of obvious" things.

Copy link
Contributor

@shiltian shiltian Dec 10, 2024

Choose a reason for hiding this comment

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

Yeah, that's a fair point. I wish CMake could make it an optional argument. "" really doesn't look nice. Up to you then,

Adds initial CMake cache definition that is similar to what we use in
one of our production buidlbots. The goal is to consolidate the
configurations and make them accessible.
This cache file is a first step and to prepare for full pipeline
testing once the new bot comes online.
@jplehr jplehr force-pushed the feat/amdgpu-bot-cmake-cache branch from 9dabdc1 to 7d82a6d Compare December 10, 2024 16:08
@jplehr jplehr merged commit 74486dc into llvm:main Dec 10, 2024
6 checks passed
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