From 461e644c4f5b776e992c07895d8e5ac8bbb84d14 Mon Sep 17 00:00:00 2001 From: "Rosa, Ada" Date: Wed, 29 Apr 2026 22:37:26 +0000 Subject: [PATCH 1/8] build(rocjitsu): add rocjitsu to build system Co-authored-by: Copilot --- BUILD_TOPOLOGY.toml | 20 +++++++++++++ CMakeLists.txt | 1 + rocjitsu/CMakeLists.txt | 50 +++++++++++++++++++++++++++++++++ rocjitsu/artifact-rocjitsu.toml | 8 ++++++ 4 files changed, 79 insertions(+) create mode 100644 rocjitsu/CMakeLists.txt create mode 100644 rocjitsu/artifact-rocjitsu.toml diff --git a/BUILD_TOPOLOGY.toml b/BUILD_TOPOLOGY.toml index aae9b93f896..e2dd300cd79 100644 --- a/BUILD_TOPOLOGY.toml +++ b/BUILD_TOPOLOGY.toml @@ -192,6 +192,10 @@ artifact_groups = ["fusilli-libs"] description = "Profiler applications (depends on profiler-core)" artifact_groups = ["profiler-apps"] +[build_stages.rocjitsu] +description = "ROCm simulation and instrumentation tools" +artifact_groups = ["rocjitsu"] + [build_stages.media-libs] description = "Media Libraries" artifact_groups = ["media-libs"] @@ -327,6 +331,13 @@ type = "generic" artifact_group_deps = ["third-party-sysdeps", "base", "core-runtime", "hip-runtime"] source_sets = ["amd-mesa", "rocm-systems"] +[artifact_groups.rocjitsu] +description = "ROCm simulation, virtualization, and instrumentation tools" +type = "generic" +artifact_group_deps = [] +source_sets = ["rocm-systems"] +disable_platforms = ["windows"] + # ============================================================================== # ARTIFACTS - The actual build outputs that can be transmitted between stages # ============================================================================== @@ -777,3 +788,12 @@ type = "target-neutral" artifact_deps = ["amd-llvm", "amd-dbgapi", "sysdeps-gmp", "sysdeps-mpfr", "sysdeps-expat", "sysdeps-ncurses"] feature_group = "DEBUG_TOOLS" # Part of DEBUG_TOOLS, enabled by default via THEROCK_ENABLE_ALL disable_platforms = ["windows"] + +# --- ROCm Simulation Tools --- + +[artifacts.rocjitsu] +artifact_group = "rocjitsu" +type = "target-neutral" +artifact_deps = [] +feature_group = "ROCJITSU" +disable_platforms = ["windows"] diff --git a/CMakeLists.txt b/CMakeLists.txt index ef81dd4d578..a9f927808db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -507,6 +507,7 @@ add_subdirectory(math-libs) add_subdirectory(ml-libs) add_subdirectory(iree-libs) add_subdirectory(media-libs) +add_subdirectory(rocjitsu) if(THEROCK_BUILD_TESTING) add_subdirectory(examples) diff --git a/rocjitsu/CMakeLists.txt b/rocjitsu/CMakeLists.txt new file mode 100644 index 00000000000..1e824a5c579 --- /dev/null +++ b/rocjitsu/CMakeLists.txt @@ -0,0 +1,50 @@ +# Copyright Advanced Micro Devices, Inc. +# SPDX-License-Identifier: MIT + +# ROCm Simulation Tools (rocjitsu) + +if(THEROCK_ENABLE_ROCJITSU) + ############################################################################## + # rocjitsu + # + # ROCm Just-in-Time Suite: simulation, virtualization, and instrumentation + # tools for AMD GPU applications. Provides ISA-level execution of AMD GPU + # and RISC-V machine code from HIP fat binaries without requiring GPU + # hardware. + ############################################################################## + + therock_cmake_subproject_declare(rocjitsu + EXTERNAL_SOURCE_DIR "${THEROCK_ROCM_SYSTEMS_SOURCE_DIR}/experimental/rocjitsu" + BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/rocjitsu" + BACKGROUND_BUILD + CMAKE_ARGS + -DRJ_BUILD_GUI=OFF + -DBUILD_TESTING=${THEROCK_BUILD_TESTING} + ) + + therock_cmake_subproject_glob_c_sources(rocjitsu + SUBDIRS + lib + tools + tests + ) + + therock_cmake_subproject_activate(rocjitsu) + + therock_test_validate_shared_lib(PATH rocjitsu/dist/lib + LIB_NAMES + librocjitsu.so + ) + + therock_provide_artifact(rocjitsu + TARGET_NEUTRAL + DESCRIPTOR artifact-rocjitsu.toml + COMPONENTS + dbg + dev + lib + run + SUBPROJECT_DEPS + rocjitsu + ) +endif() diff --git a/rocjitsu/artifact-rocjitsu.toml b/rocjitsu/artifact-rocjitsu.toml new file mode 100644 index 00000000000..e5f78c3cd62 --- /dev/null +++ b/rocjitsu/artifact-rocjitsu.toml @@ -0,0 +1,8 @@ +# rocjitsu +[components.lib."rocjitsu/rocjitsu/stage"] +[components.dbg."rocjitsu/rocjitsu/stage"] +[components.dev."rocjitsu/rocjitsu/stage"] +[components.run."rocjitsu/rocjitsu/stage"] +include = [ + "share/rocjitsu/**", +] From f7cc9ed1ef45e5020d20b5d610dd7f7dfd3de7db Mon Sep 17 00:00:00 2001 From: "Rosa, Ada" Date: Wed, 29 Apr 2026 22:47:20 +0000 Subject: [PATCH 2/8] test(rocjitsu): add tests --- rocjitsu/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rocjitsu/CMakeLists.txt b/rocjitsu/CMakeLists.txt index 1e824a5c579..d0d382d0415 100644 --- a/rocjitsu/CMakeLists.txt +++ b/rocjitsu/CMakeLists.txt @@ -31,6 +31,10 @@ if(THEROCK_ENABLE_ROCJITSU) therock_cmake_subproject_activate(rocjitsu) + therock_cmake_subproject_build_test(rocjitsu + COMMAND "${CMAKE_CTEST_COMMAND}" --output-on-failure --no-tests=error + ) + therock_test_validate_shared_lib(PATH rocjitsu/dist/lib LIB_NAMES librocjitsu.so From dc5c1f45d244742c1329cc85f82bd619d4d26e9f Mon Sep 17 00:00:00 2001 From: "Rosa, Ada" Date: Thu, 30 Apr 2026 16:36:11 +0000 Subject: [PATCH 3/8] build(simulation): move rocjitsu into simulation group Move the rocjitsu TheRock wrapper under a new top-level simulation directory, include its artifact group in the compiler-runtime stage, and change its feature group to SIMULATION. Also update the rocjitsu artifact descriptor paths to match the new simulation/rocjitsu staging location. Co-authored-by: Copilot --- BUILD_TOPOLOGY.toml | 9 +++------ CMakeLists.txt | 3 ++- rocjitsu/artifact-rocjitsu.toml | 8 -------- {rocjitsu => simulation}/CMakeLists.txt | 4 ++-- simulation/artifact-rocjitsu.toml | 8 ++++++++ 5 files changed, 15 insertions(+), 17 deletions(-) delete mode 100644 rocjitsu/artifact-rocjitsu.toml rename {rocjitsu => simulation}/CMakeLists.txt (96%) create mode 100644 simulation/artifact-rocjitsu.toml diff --git a/BUILD_TOPOLOGY.toml b/BUILD_TOPOLOGY.toml index e2dd300cd79..e41d1ecf081 100644 --- a/BUILD_TOPOLOGY.toml +++ b/BUILD_TOPOLOGY.toml @@ -153,7 +153,8 @@ artifact_groups = [ "hip-runtime", "opencl-runtime", "profiler-core", - "rocrtst" + "rocrtst", + "rocjitsu" ] [build_stages.math-libs] @@ -192,10 +193,6 @@ artifact_groups = ["fusilli-libs"] description = "Profiler applications (depends on profiler-core)" artifact_groups = ["profiler-apps"] -[build_stages.rocjitsu] -description = "ROCm simulation and instrumentation tools" -artifact_groups = ["rocjitsu"] - [build_stages.media-libs] description = "Media Libraries" artifact_groups = ["media-libs"] @@ -795,5 +792,5 @@ disable_platforms = ["windows"] artifact_group = "rocjitsu" type = "target-neutral" artifact_deps = [] -feature_group = "ROCJITSU" +feature_group = "SIMULATION" disable_platforms = ["windows"] diff --git a/CMakeLists.txt b/CMakeLists.txt index a9f927808db..d69d2bef7ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -500,6 +500,8 @@ add_subdirectory(debug-tools) # Note that rocprofiler-register is in base and is what higher level clients # depend on. The profiler itself is independent. add_subdirectory(profiler) +# Simulation and instrumentation tools. +add_subdirectory(simulation) # Data center tools (RDC, etc.) add_subdirectory(dctools) add_subdirectory(comm-libs) @@ -507,7 +509,6 @@ add_subdirectory(math-libs) add_subdirectory(ml-libs) add_subdirectory(iree-libs) add_subdirectory(media-libs) -add_subdirectory(rocjitsu) if(THEROCK_BUILD_TESTING) add_subdirectory(examples) diff --git a/rocjitsu/artifact-rocjitsu.toml b/rocjitsu/artifact-rocjitsu.toml deleted file mode 100644 index e5f78c3cd62..00000000000 --- a/rocjitsu/artifact-rocjitsu.toml +++ /dev/null @@ -1,8 +0,0 @@ -# rocjitsu -[components.lib."rocjitsu/rocjitsu/stage"] -[components.dbg."rocjitsu/rocjitsu/stage"] -[components.dev."rocjitsu/rocjitsu/stage"] -[components.run."rocjitsu/rocjitsu/stage"] -include = [ - "share/rocjitsu/**", -] diff --git a/rocjitsu/CMakeLists.txt b/simulation/CMakeLists.txt similarity index 96% rename from rocjitsu/CMakeLists.txt rename to simulation/CMakeLists.txt index d0d382d0415..625b89d58d6 100644 --- a/rocjitsu/CMakeLists.txt +++ b/simulation/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright Advanced Micro Devices, Inc. # SPDX-License-Identifier: MIT -# ROCm Simulation Tools (rocjitsu) +# ROCm Simulation Tools if(THEROCK_ENABLE_ROCJITSU) ############################################################################## @@ -51,4 +51,4 @@ if(THEROCK_ENABLE_ROCJITSU) SUBPROJECT_DEPS rocjitsu ) -endif() +endif() \ No newline at end of file diff --git a/simulation/artifact-rocjitsu.toml b/simulation/artifact-rocjitsu.toml new file mode 100644 index 00000000000..8bad1fe4577 --- /dev/null +++ b/simulation/artifact-rocjitsu.toml @@ -0,0 +1,8 @@ +# rocjitsu +[components.lib."simulation/rocjitsu/stage"] +[components.dbg."simulation/rocjitsu/stage"] +[components.dev."simulation/rocjitsu/stage"] +[components.run."simulation/rocjitsu/stage"] +include = [ + "share/rocjitsu/**", +] \ No newline at end of file From af6d84d0df42a9ccf61c6dba4e6f3ebf0391823b Mon Sep 17 00:00:00 2001 From: "Rosa, Ada" Date: Thu, 30 Apr 2026 16:43:53 +0000 Subject: [PATCH 4/8] chore: fix whitespace --- simulation/CMakeLists.txt | 2 +- simulation/artifact-rocjitsu.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/simulation/CMakeLists.txt b/simulation/CMakeLists.txt index 625b89d58d6..e9f93a0a029 100644 --- a/simulation/CMakeLists.txt +++ b/simulation/CMakeLists.txt @@ -51,4 +51,4 @@ if(THEROCK_ENABLE_ROCJITSU) SUBPROJECT_DEPS rocjitsu ) -endif() \ No newline at end of file +endif() diff --git a/simulation/artifact-rocjitsu.toml b/simulation/artifact-rocjitsu.toml index 8bad1fe4577..3bcf9e305fb 100644 --- a/simulation/artifact-rocjitsu.toml +++ b/simulation/artifact-rocjitsu.toml @@ -5,4 +5,4 @@ [components.run."simulation/rocjitsu/stage"] include = [ "share/rocjitsu/**", -] \ No newline at end of file +] From b725282e4f784f0edb55717db33c43f5967f8013 Mon Sep 17 00:00:00 2001 From: "Rosa, Ada" Date: Thu, 30 Apr 2026 17:02:36 +0000 Subject: [PATCH 5/8] rocjitsu DISABLE_AMDGPU_TARGETS --- simulation/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/simulation/CMakeLists.txt b/simulation/CMakeLists.txt index e9f93a0a029..80cc39dbb81 100644 --- a/simulation/CMakeLists.txt +++ b/simulation/CMakeLists.txt @@ -14,6 +14,7 @@ if(THEROCK_ENABLE_ROCJITSU) ############################################################################## therock_cmake_subproject_declare(rocjitsu + USE_DIST_AMDGPU_TARGETS EXTERNAL_SOURCE_DIR "${THEROCK_ROCM_SYSTEMS_SOURCE_DIR}/experimental/rocjitsu" BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/rocjitsu" BACKGROUND_BUILD From 1967661b4b1a172456104191983153c7f2e4e2f8 Mon Sep 17 00:00:00 2001 From: "Rosa, Ada" Date: Thu, 30 Apr 2026 18:49:35 +0000 Subject: [PATCH 6/8] build(emulation): rename rocjitsu simulation wrapper Move the rocjitsu TheRock wrapper from simulation/ to emulation/, update artifact staging paths, and switch the generated feature group to EMULATION. --- BUILD_TOPOLOGY.toml | 6 +++--- CMakeLists.txt | 4 ++-- {simulation => emulation}/CMakeLists.txt | 2 +- emulation/artifact-rocjitsu.toml | 8 ++++++++ simulation/artifact-rocjitsu.toml | 8 -------- 5 files changed, 14 insertions(+), 14 deletions(-) rename {simulation => emulation}/CMakeLists.txt (98%) create mode 100644 emulation/artifact-rocjitsu.toml delete mode 100644 simulation/artifact-rocjitsu.toml diff --git a/BUILD_TOPOLOGY.toml b/BUILD_TOPOLOGY.toml index e41d1ecf081..c986f35def6 100644 --- a/BUILD_TOPOLOGY.toml +++ b/BUILD_TOPOLOGY.toml @@ -329,7 +329,7 @@ artifact_group_deps = ["third-party-sysdeps", "base", "core-runtime", "hip-runti source_sets = ["amd-mesa", "rocm-systems"] [artifact_groups.rocjitsu] -description = "ROCm simulation, virtualization, and instrumentation tools" +description = "ROCm emulation, virtualization, and instrumentation tools" type = "generic" artifact_group_deps = [] source_sets = ["rocm-systems"] @@ -786,11 +786,11 @@ artifact_deps = ["amd-llvm", "amd-dbgapi", "sysdeps-gmp", "sysdeps-mpfr", "sysde feature_group = "DEBUG_TOOLS" # Part of DEBUG_TOOLS, enabled by default via THEROCK_ENABLE_ALL disable_platforms = ["windows"] -# --- ROCm Simulation Tools --- +# --- ROCm Emulation Tools --- [artifacts.rocjitsu] artifact_group = "rocjitsu" type = "target-neutral" artifact_deps = [] -feature_group = "SIMULATION" +feature_group = "EMULATION" disable_platforms = ["windows"] diff --git a/CMakeLists.txt b/CMakeLists.txt index d69d2bef7ba..c9d1f07ff86 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -500,8 +500,8 @@ add_subdirectory(debug-tools) # Note that rocprofiler-register is in base and is what higher level clients # depend on. The profiler itself is independent. add_subdirectory(profiler) -# Simulation and instrumentation tools. -add_subdirectory(simulation) +# Emulation and instrumentation tools. +add_subdirectory(emulation) # Data center tools (RDC, etc.) add_subdirectory(dctools) add_subdirectory(comm-libs) diff --git a/simulation/CMakeLists.txt b/emulation/CMakeLists.txt similarity index 98% rename from simulation/CMakeLists.txt rename to emulation/CMakeLists.txt index 80cc39dbb81..45f36971c42 100644 --- a/simulation/CMakeLists.txt +++ b/emulation/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright Advanced Micro Devices, Inc. # SPDX-License-Identifier: MIT -# ROCm Simulation Tools +# ROCm Emulation Tools if(THEROCK_ENABLE_ROCJITSU) ############################################################################## diff --git a/emulation/artifact-rocjitsu.toml b/emulation/artifact-rocjitsu.toml new file mode 100644 index 00000000000..470fe8e9b21 --- /dev/null +++ b/emulation/artifact-rocjitsu.toml @@ -0,0 +1,8 @@ +# rocjitsu +[components.lib."emulation/rocjitsu/stage"] +[components.dbg."emulation/rocjitsu/stage"] +[components.dev."emulation/rocjitsu/stage"] +[components.run."emulation/rocjitsu/stage"] +include = [ + "share/rocjitsu/**", +] diff --git a/simulation/artifact-rocjitsu.toml b/simulation/artifact-rocjitsu.toml deleted file mode 100644 index 3bcf9e305fb..00000000000 --- a/simulation/artifact-rocjitsu.toml +++ /dev/null @@ -1,8 +0,0 @@ -# rocjitsu -[components.lib."simulation/rocjitsu/stage"] -[components.dbg."simulation/rocjitsu/stage"] -[components.dev."simulation/rocjitsu/stage"] -[components.run."simulation/rocjitsu/stage"] -include = [ - "share/rocjitsu/**", -] From e335f155e1ac3a8b3d011592b518bd8a4f1270f3 Mon Sep 17 00:00:00 2001 From: "Rosa, Ada" Date: Thu, 30 Apr 2026 19:53:56 +0000 Subject: [PATCH 7/8] build_tools: add rocjitsu artifact installer support --- build_tools/install_rocm_from_artifacts.py | 12 ++++++++++++ docs/development/installing_artifacts.md | 1 + 2 files changed, 13 insertions(+) diff --git a/build_tools/install_rocm_from_artifacts.py b/build_tools/install_rocm_from_artifacts.py index dbe9d045298..7e769cc162e 100644 --- a/build_tools/install_rocm_from_artifacts.py +++ b/build_tools/install_rocm_from_artifacts.py @@ -36,6 +36,7 @@ [--rccl | --no-rccl] [--rocdecode | --no-rocdecode] [--rocjpeg | --no-rocjpeg] + [--rocjitsu | --no-rocjitsu] [--rocprofiler-compute | --no-rocprofiler-compute] [--rocprofiler-sdk | --no-rocprofiler-sdk ] [--rocprofiler-systems | --no-rocprofiler-systems] @@ -360,6 +361,7 @@ def retrieve_artifacts_by_run_id(args): args.rccl, args.rocdecode, args.rocjpeg, + args.rocjitsu, args.rocprofiler_compute, args.rocprofiler_sdk, args.rocprofiler_systems, @@ -425,6 +427,9 @@ def retrieve_artifacts_by_run_id(args): argv.append("rocjpeg_test") argv.append("base_dev") argv.append("amd-llvm_dev") + if args.rocjitsu: + extra_artifacts.append("rocjitsu") + argv.append("rocjitsu_run") if args.hipblasltprovider: extra_artifacts.append("hipblasltprovider") if args.prim: @@ -747,6 +752,13 @@ def main(argv): action=argparse.BooleanOptionalAction, ) + artifacts_group.add_argument( + "--rocjitsu", + default=False, + help="Include 'rocjitsu' artifacts", + action=argparse.BooleanOptionalAction, + ) + artifacts_group.add_argument( "--hipblasltprovider", default=False, diff --git a/docs/development/installing_artifacts.md b/docs/development/installing_artifacts.md index 6617ca080ff..9704feb0105 100644 --- a/docs/development/installing_artifacts.md +++ b/docs/development/installing_artifacts.md @@ -43,6 +43,7 @@ Choose one of these options to specify where to install from: | `--rccl` | Flag | Include RCCL artifacts | | `--rocdecode` | Flag | Include rocDecode artifacts (Linux only) | | `--rocjpeg` | Flag | Include rocJPEG artifacts (Linux only) | +| `--rocjitsu` | Flag | Include rocjitsu artifacts (Linux only) | | `--rocwmma` | Flag | Include rocWMMA artifacts | | `--tests` | Flag | Include test artifacts for enabled components | From 02891cc3da0a7bc8772822d494f4842e54f6c8b7 Mon Sep 17 00:00:00 2001 From: "Rosa, Ada" Date: Mon, 4 May 2026 18:02:18 +0000 Subject: [PATCH 8/8] Support rocjitsu source in emulation or experimental Prefer rocm-systems/emulation/rocjitsu when present, and fall back to rocm-systems/experimental/rocjitsu for existing checkouts. Emit a clear configure error if neither source layout is available. Co-authored-by: Copilot --- emulation/CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/emulation/CMakeLists.txt b/emulation/CMakeLists.txt index 45f36971c42..80cc1f486fc 100644 --- a/emulation/CMakeLists.txt +++ b/emulation/CMakeLists.txt @@ -13,9 +13,17 @@ if(THEROCK_ENABLE_ROCJITSU) # hardware. ############################################################################## + if(EXISTS "${THEROCK_ROCM_SYSTEMS_SOURCE_DIR}/emulation/rocjitsu/CMakeLists.txt") + set(_rocjitsu_source_dir "${THEROCK_ROCM_SYSTEMS_SOURCE_DIR}/emulation/rocjitsu") + elseif(EXISTS "${THEROCK_ROCM_SYSTEMS_SOURCE_DIR}/experimental/rocjitsu/CMakeLists.txt") + set(_rocjitsu_source_dir "${THEROCK_ROCM_SYSTEMS_SOURCE_DIR}/experimental/rocjitsu") + else() + message(FATAL_ERROR "rocjitsu source directory not found under rocm-systems/emulation or rocm-systems/experimental") + endif() + therock_cmake_subproject_declare(rocjitsu USE_DIST_AMDGPU_TARGETS - EXTERNAL_SOURCE_DIR "${THEROCK_ROCM_SYSTEMS_SOURCE_DIR}/experimental/rocjitsu" + EXTERNAL_SOURCE_DIR "${_rocjitsu_source_dir}" BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/rocjitsu" BACKGROUND_BUILD CMAKE_ARGS