Skip to content

Commit 95d6080

Browse files
authored
[Offload] Adds buildbot for CMake cache file (#344)
The buildbot uses the offload/cmake/cache/AMDGPUBot.cmake file to create the build config. It uses an annotated builder for that and only performs the build step as most of the post-commit issues are build problems and not test errors.
1 parent 527a161 commit 95d6080

File tree

3 files changed

+67
-30
lines changed

3 files changed

+67
-30
lines changed

buildbot/osuosl/master/config/builders.py

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1952,35 +1952,15 @@
19521952
add_openmp_lit_args=["--time-tests", "--timeout 100"],
19531953
)},
19541954

1955-
{'name' : "offload-runtime-openmp-amdgpu",
1955+
{'name' : "amdgpu-offload-ubuntu-22-cmake-build-only",
19561956
'tags' : ["openmp"],
1957-
'workernames' : ["rocm-worker-hw-03"],
1958-
'builddir': "offload-runtime-openmp-amdgpu",
1959-
'factory' : OpenMPBuilder.getOpenMPCMakeBuildFactory(
1960-
clean=True,
1961-
enable_runtimes=['openmp', 'offload'],
1962-
depends_on_projects=['llvm', 'clang', 'flang', 'lld', 'offload', 'openmp'],
1963-
extraCmakeArgs=[
1964-
"-DCMAKE_BUILD_TYPE=Release",
1965-
"-DCLANG_DEFAULT_LINKER=lld",
1966-
"-DLLVM_TARGETS_TO_BUILD=X86;AMDGPU",
1967-
"-DLLVM_ENABLE_ASSERTIONS=ON",
1968-
"-DCMAKE_C_COMPILER_LAUNCHER=ccache",
1969-
"-DCMAKE_CXX_COMPILER_LAUNCHER=ccache",
1970-
],
1971-
env={
1972-
'HSA_ENABLE_SDMA':'0',
1973-
},
1974-
install=True,
1975-
testsuite=False,
1976-
testsuite_sollvevv=False,
1977-
extraTestsuiteCmakeArgs=[
1978-
"-DTEST_SUITE_SOLLVEVV_OFFLOADING_CFLAGS=-fopenmp-targets=amdgcn-amd-amdhsa;-Xopenmp-target=amdgcn-amd-amdhsa",
1979-
"-DTEST_SUITE_SOLLVEVV_OFFLOADING_LDLAGS=-fopenmp-targets=amdgcn-amd-amdhsa;-Xopenmp-target=amdgcn-amd-amdhsa",
1980-
],
1981-
add_lit_checks=["check-clang", "check-flang", "check-offload"],
1982-
add_openmp_lit_args=["--time-tests", "--timeout 100"],
1983-
)},
1957+
'workernames' : ["rocm-docker-ubu-22"],
1958+
'builddir': "bbot-build",
1959+
'factory' : AnnotatedBuilder.getAnnotatedBuildFactory(
1960+
script="amdgpu-offload-cmake.py",
1961+
checkout_llvm_sources=True,
1962+
script_interpreter=None
1963+
)},
19841964

19851965
{'name' : "openmp-offload-libc-amdgpu-runtime",
19861966
'tags' : ["openmp"],

buildbot/osuosl/master/config/workers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,15 +357,16 @@ def get_all():
357357

358358
# OpenMP on AMDGPU, Ubuntu 18.04.5, Intel(R) Xeon(R) Gold 5218 @ 2.30GHz with 64GB Memory, 1 Vega20 GPU with 16GB Memory
359359
create_worker("omp-vega20-0", properties={'jobs': 32}, max_builds=1),
360+
# OpenMP / Offload / libc on AMDGPU
360361
create_worker("omp-vega20-1", properties={'jobs': 32}, max_builds=1),
361-
362362
# Flang OpenMP on AMDGPU, Ubuntu 22.04.3, AMD(R) EPYC 9354 @ 2.5GHz with 512GB Memory, 1 MI210 GPU with 64GB Memory
363363
create_worker("rocm-worker-hw-01", properties={'jobs': 64}, max_builds=1),
364364
create_worker("rocm-worker-hw-02", properties={'jobs': 64}, max_builds=1),
365-
create_worker("rocm-worker-hw-03", properties={'jobs': 64}, max_builds=1),
366365
create_worker("rocm-worker-hw-04-sles", properties={'jobs': 32}, max_builds=1),
367366
create_worker("rocm-worker-hw-04-rhel-9_4", properties={'jobs': 32}, max_builds=1),
368367
create_worker("rocm-worker-hw-04-rhel-8_8", properties={'jobs': 32}, max_builds=1),
368+
# Containerized build-only, using llvm-project/offload/cmake/caches/AMDGPUbot.cmake
369+
create_worker("rocm-docker-ubu-22", properties={'jobs': 32}, max_builds=1),
369370

370371
# AMD ROCm support, Ubuntu 18.04.6, AMD Ryzen @ 1.5 GHz, MI200 GPU
371372
create_worker("mi200-buildbot", max_builds=1),
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/usr/bin/python
2+
3+
import argparse
4+
import os
5+
import subprocess
6+
import sys
7+
import traceback
8+
import util
9+
from contextlib import contextmanager
10+
11+
12+
def main(argv):
13+
source_dir = os.path.join("..", "llvm-project")
14+
offload_base_dir = os.path.join(source_dir, "offload")
15+
of_cmake_cache_base_dir = os.path.join(offload_base_dir, "cmake/caches")
16+
17+
with step("cmake", halt_on_fail=True):
18+
# TODO make the name of the cache file an argument to the script.
19+
cmake_cache_file = os.path.join(of_cmake_cache_base_dir, "AMDGPUBot.cmake")
20+
21+
# Use Ninja as the generator.
22+
# The other important settings alrady come from the CMake CMake
23+
# cache file inside LLVM
24+
cmake_args = ["-GNinja", "-C %s" % cmake_cache_file]
25+
26+
run_command(["cmake", os.path.join(source_dir, "llvm")] + cmake_args)
27+
28+
with step("build cmake config"):
29+
run_command(["ninja"])
30+
31+
32+
@contextmanager
33+
def step(step_name, halt_on_fail=False):
34+
util.report("@@@BUILD_STEP {}@@@".format(step_name))
35+
if halt_on_fail:
36+
util.report("@@@HALT_ON_FAILURE@@@")
37+
try:
38+
yield
39+
except Exception as e:
40+
if isinstance(e, subprocess.CalledProcessError):
41+
util.report("{} exited with return code {}.".format(e.cmd, e.returncode))
42+
util.report("The build step threw an exception...")
43+
traceback.print_exc()
44+
45+
util.report("@@@STEP_FAILURE@@@")
46+
finally:
47+
sys.stdout.flush()
48+
49+
50+
def run_command(cmd, directory="."):
51+
util.report_run_cmd(cmd, cwd=directory)
52+
53+
54+
if __name__ == "__main__":
55+
sys.path.append(os.path.dirname(__file__))
56+
sys.exit(main(sys.argv))

0 commit comments

Comments
 (0)