Skip to content
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

LLVM_ENABLE_RUNTIMES=flang-rt for amdgpu-offload-* #402

Merged
merged 1 commit into from
Mar 5, 2025

Conversation

Meinersbur
Copy link
Member

@Meinersbur Meinersbur commented Mar 4, 2025

Add depends_on_projects=['flang-rt'], and checks=['check-flang-rt'] to the amdgpu-offload-* builders. The prepares the removal of the "projects" build of the flang runtime in llvm/llvm-project#124126.

The corresponding change in the LLVM repository is llvm/llvm-project#129692

Affected builders (production):

Affected workers (production):

Admins listed for those workers:

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@Meinersbur
Copy link
Member Author

Meinersbur commented Mar 4, 2025

Unfortunately, the annotated builders are impossible to check locally using instructions from https://llvm.org/docs/HowToAddABuilder.html#testing-a-builder-config-locally, as the build instructions are taken directly from multiple main directories on github.com:

  • The buildbot master takes the builder configuration which contain the instruction for the worker to execute amdgpu-offload-cmake.py.
  • The worker checks out llvm-zorg from its public repository and executes amdgpu-offload-cmake.py from there (NOT the locally modified version of it). It contains instructions to pre-populate the CMake cache from file AMDGPUBot.cmake.
  • The worker also checks out llvm-project from its public repository which contains the AMDGPUBot.cmake file.

Running the unchanged/main worktree gets me the following error:

Running: cmake ../llvm-project/llvm -GNinja "-C ../llvm-project/offload/cmake/caches/AMDGPUBot.cmake"
Current working directory cannot be established.
['cmake', '../llvm-project/llvm', '-GNinja', '-C ../llvm-project/offload/cmake/caches/AMDGPUBot.cmake'] exited with return code 1.

I think this is because amdgpu-offload-cmake.py is deleting its own current work directory [sic!], after which the cwd file descriptor refers to a non-existing directory which CMake cannot cope with. I cannot verify this assumption without modifying the upstream repositories.

The in-production buildbot workers may not see the issue because the rmtree fails deleting some file, keeping the cwd file descriptor the same.

@Meinersbur Meinersbur marked this pull request as ready for review March 4, 2025 14:21
@Meinersbur Meinersbur requested a review from jplehr March 4, 2025 14:21
@jplehr
Copy link
Contributor

jplehr commented Mar 4, 2025

I have a setup for local testing and can take a swing at it for a test.

@jplehr
Copy link
Contributor

jplehr commented Mar 4, 2025

I think this is because amdgpu-offload-cmake.py is deleting its own current work directory [sic!], after which the cwd file descriptor refers to a non-existing directory which CMake cannot cope with.

That is not quite the intended behavior, but after looking at the code, I believe you are right. Let me put up a patch that does what it should do more reasonably.

jplehr added a commit to jplehr/llvm-zorg that referenced this pull request Mar 4, 2025
As pointed out in llvm#402 the former
solution deleted the CWD from within that directory, rendering the state
quite useless and resulting in errors on execution.

The approach in here creates a temp directory, changes to it, removes
the old CWD, recreates it, and changes back to that directory. I opted
for this solution as, oddly enough, I had some trouble removing the
  enumerated list of files in the buildtree.
jplehr added a commit that referenced this pull request Mar 4, 2025
As pointed out in #402 the former
solution deleted the CWD from within that directory, rendering the state
quite useless and resulting in errors on execution.

The approach in here creates a temp directory, changes to it, removes
the old CWD, recreates it, and changes back to that directory. I opted
for this solution as, oddly enough, I had some trouble removing the
  enumerated list of files in the buildtree.
Copy link
Contributor

@jplehr jplehr left a comment

Choose a reason for hiding this comment

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

LGTM
Depending on the activity with the flang-rt, we may want to land this prior to the change to the CMake cache, such that the scheduler is already aware of the dependency.

@Meinersbur Meinersbur merged commit c2ab1fd into main Mar 5, 2025
3 checks passed
Meinersbur added a commit to llvm/llvm-project that referenced this pull request Mar 7, 2025
…129692)

Enable the LLVM_ENABLE_RUNTIMES=flang-rt build of the Fortran runtime
for the amdgpu-offload-* buildbots. This pre-population cmake cache
files is referred to by the llvm-zorg annotated builder factory
[script](https://github.com/llvm/llvm-zorg/blob/872f477610d83821c9f1368c969006789b21011b/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py#L26).

The corresponding change in llvm-zorg is
llvm/llvm-zorg#402
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Mar 7, 2025
…-offload-* (#129692)

Enable the LLVM_ENABLE_RUNTIMES=flang-rt build of the Fortran runtime
for the amdgpu-offload-* buildbots. This pre-population cmake cache
files is referred to by the llvm-zorg annotated builder factory
[script](https://github.com/llvm/llvm-zorg/blob/872f477610d83821c9f1368c969006789b21011b/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py#L26).

The corresponding change in llvm-zorg is
llvm/llvm-zorg#402
Meinersbur added a commit to llvm/llvm-project that referenced this pull request Mar 13, 2025
…ffload-*" (#130274)

Enable the LLVM_ENABLE_RUNTIMES=flang-rt build of the Fortran runtime
for the amdgpu-offload-* buildbots. This pre-population cmake cache
files is referred to by the llvm-zorg annotated builder factory
[script](https://github.com/llvm/llvm-zorg/blob/872f477610d83821c9f1368c969006789b21011b/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py#L26).

The corresponding change in llvm-zorg is
llvm/llvm-zorg#402

This reverts commit e296fb8.

The worker of amdgpu-offload-rhel-8-cmake-build-only has been updated
with a newer version of Ninja that supports Fortran.
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Mar 13, 2025
…or amdgpu-offload-*" (#130274)

Enable the LLVM_ENABLE_RUNTIMES=flang-rt build of the Fortran runtime
for the amdgpu-offload-* buildbots. This pre-population cmake cache
files is referred to by the llvm-zorg annotated builder factory
[script](https://github.com/llvm/llvm-zorg/blob/872f477610d83821c9f1368c969006789b21011b/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py#L26).

The corresponding change in llvm-zorg is
llvm/llvm-zorg#402

This reverts commit e296fb8.

The worker of amdgpu-offload-rhel-8-cmake-build-only has been updated
with a newer version of Ninja that supports Fortran.
frederik-h pushed a commit to frederik-h/llvm-project that referenced this pull request Mar 18, 2025
…ffload-*" (llvm#130274)

Enable the LLVM_ENABLE_RUNTIMES=flang-rt build of the Fortran runtime
for the amdgpu-offload-* buildbots. This pre-population cmake cache
files is referred to by the llvm-zorg annotated builder factory
[script](https://github.com/llvm/llvm-zorg/blob/872f477610d83821c9f1368c969006789b21011b/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py#L26).

The corresponding change in llvm-zorg is
llvm/llvm-zorg#402

This reverts commit e296fb8.

The worker of amdgpu-offload-rhel-8-cmake-build-only has been updated
with a newer version of Ninja that supports Fortran.
jph-13 pushed a commit to jph-13/llvm-project that referenced this pull request Mar 21, 2025
…lvm#129692)

Enable the LLVM_ENABLE_RUNTIMES=flang-rt build of the Fortran runtime
for the amdgpu-offload-* buildbots. This pre-population cmake cache
files is referred to by the llvm-zorg annotated builder factory
[script](https://github.com/llvm/llvm-zorg/blob/872f477610d83821c9f1368c969006789b21011b/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py#L26).

The corresponding change in llvm-zorg is
llvm/llvm-zorg#402
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.

None yet

2 participants