Skip to content

[compiler-rt][AMDGPU] Build the device profile runtime#3023

Closed
lfmeadow wants to merge 1 commit into
ROCm:amd-stagingfrom
lfmeadow:users/lmeadows/gpu-profile-runtime
Closed

[compiler-rt][AMDGPU] Build the device profile runtime#3023
lfmeadow wants to merge 1 commit into
ROCm:amd-stagingfrom
lfmeadow:users/lmeadows/gpu-profile-runtime

Conversation

@lfmeadow

@lfmeadow lfmeadow commented Jun 23, 2026

Copy link
Copy Markdown

What

Enable the compiler-rt profile component for the amdgcn-amd-amdhsa runtimes build in GPU.cmake (COMPILER_RT_BUILD_PROFILE + COMPILER_RT_PROFILE_BAREMETAL ON).

Why

GPU.cmake had COMPILER_RT_BUILD_PROFILE OFF, so the device profile runtime (amdgcn-amd-amdhsa/libclang_rt.profile.a) was never built and HIP device PGO had no device runtime to link/collect. Matches upstream AMDGPU.cmake.

Test

Built TheRock; confirmed amdgcn-amd-amdhsa/libclang_rt.profile.a is produced and defines __llvm_profile_instrument_gpu and __llvm_profile_sections.

@jhuber6 jhuber6 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Didn't this file get deleted upstream, why's it still here? You're probably looking for AMDGPU.cmake.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Enables building the compiler-rt profile runtime for AMDGPU device (amdgcn-amd-amdhsa) builds by turning on the profile component and selecting the baremetal profile configuration in the GPU cache file. This provides the missing device-side libclang_rt.profile.a needed for HIP device PGO instrumentation/linking.

Changes:

  • Turn on COMPILER_RT_BUILD_PROFILE in compiler-rt/cmake/caches/GPU.cmake.
  • Enable COMPILER_RT_PROFILE_BAREMETAL to build the minimal/baremetal profile runtime appropriate for GPU device environments.

@lfmeadow

Copy link
Copy Markdown
Author

Didn't this file get deleted upstream, why's it still here? You're probably looking for AMDGPU.cmake.

It's in TheRock build, it was removed upstream, but then reverted back in amd-staging because build scripts still reference it.

As best i can tell:

compiler-rt/cmake/caches/AMDGPU.cmake
compiler-rt/cmake/caches/GPU.cmake
compiler-rt/cmake/caches/NVPTX.cmake

dad7442aff5c 2024-07-10 Joseph Huber  [compiler-rt] Initial support for builtins on GPU targets (#95304)
fd069a46bf77 2026-03-10 Joseph Huber  [copmiler-rt] Initial support for building profile library on the GPU (#185552)
e73d8f8fc59a 2026-03-24 Joseph Huber  [compiler-rt] Support unit tests for the GPU build (#187895)
d8ba56ce3f98 2026-04-03 Joseph Huber  [compiler-rt] Split the GPU.cmake cache file to AMDGPU and NVPTX (#190349)
7dd9d30ac172 2026-04-03 Ron Lieberman  Revert "[compiler-rt] Split the GPU.cmake cache file to AMDGPU and NVPTX (#190349)"
2b2d44461856 2026-04-08 Joseph Huber  Reapply "[compiler-rt] Split the GPU.cmake cache file to AMDGPU and NVPTX (#190349)" (#2080)
c3a1536c67b9 2026-04-14 Joseph Huber  Reapply "[compiler-rt] Enable minimal ubsan for GPU targets (#188289)" (#2170)
fe15dce69707 2026-04-14 Joseph Huber  Revert "Reapply "[compiler-rt] Enable minimal ubsan for GPU targets (#188289)…"
6eafa59bcebf 2026-04-28 Joseph Huber  Reapply "Reapply "[compiler-rt] Enable minimal ubsan for GPU targets (#188289)…" (#2260)
d54f3c88e640 2026-06-22 Larry Meadows  Enable device-side PGO libraries.

@jhuber6

jhuber6 commented Jun 23, 2026

Copy link
Copy Markdown

Didn't this file get deleted upstream, why's it still here? You're probably looking for AMDGPU.cmake.

It's in TheRock build, it was removed upstream, but then reverted back in amd-staging because build scripts still reference it.

As best i can tell:

compiler-rt/cmake/caches/AMDGPU.cmake
compiler-rt/cmake/caches/GPU.cmake
compiler-rt/cmake/caches/NVPTX.cmake

dad7442aff5c 2024-07-10 Joseph Huber  [compiler-rt] Initial support for builtins on GPU targets (#95304)
fd069a46bf77 2026-03-10 Joseph Huber  [copmiler-rt] Initial support for building profile library on the GPU (#185552)
e73d8f8fc59a 2026-03-24 Joseph Huber  [compiler-rt] Support unit tests for the GPU build (#187895)
d8ba56ce3f98 2026-04-03 Joseph Huber  [compiler-rt] Split the GPU.cmake cache file to AMDGPU and NVPTX (#190349)
7dd9d30ac172 2026-04-03 Ron Lieberman  Revert "[compiler-rt] Split the GPU.cmake cache file to AMDGPU and NVPTX (#190349)"
2b2d44461856 2026-04-08 Joseph Huber  Reapply "[compiler-rt] Split the GPU.cmake cache file to AMDGPU and NVPTX (#190349)" (#2080)
c3a1536c67b9 2026-04-14 Joseph Huber  Reapply "[compiler-rt] Enable minimal ubsan for GPU targets (#188289)" (#2170)
fe15dce69707 2026-04-14 Joseph Huber  Revert "Reapply "[compiler-rt] Enable minimal ubsan for GPU targets (#188289)…"
6eafa59bcebf 2026-04-28 Joseph Huber  Reapply "Reapply "[compiler-rt] Enable minimal ubsan for GPU targets (#188289)…" (#2260)
d54f3c88e640 2026-06-22 Larry Meadows  Enable device-side PGO libraries.

Can we fix that instead of perpetuating its zombie existence? I unfortunately don't know how to make changes to The Rock.

@lfmeadow

Copy link
Copy Markdown
Author

Superseded by the consolidation approach: #3027 (remove redundant GPU.cmake) + ROCm/TheRock#6055 (point amdgcn runtimes cache at AMDGPU.cmake). Closing in favor of those.

@lfmeadow lfmeadow closed this Jun 23, 2026
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.

4 participants