Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/test_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,26 @@ jobs:
echo "HSA_XNACK=1" >> $GITHUB_ENV
echo "ASAN_SYMBOLIZER_PATH=${{ env.OUTPUT_ARTIFACTS_DIR }}/llvm/bin/llvm-symbolizer" >> $GITHUB_ENV

# Hotswap smoke test: hotswap is built by default (THEROCK_ENABLE_HOTSWAP=ON), so the
# tool must be present in the artifacts. Load it via HSA_TOOLS_LIB so ROCr/CLR exercise
# the tool-load path during hip-tests (which load code objects on the GPU). The entry
# trampoline rewrite is opt-in, so enable AMD_COMGR_HOTSWAP_ENTRY_TRAMPOLINES here to
# exercise gfx1250 same-stepping dispatch-entry redirection. The tool is inert on
# non-gfx1250 targets, so this is a regression guard that enabling it does not perturb
# existing results. A missing tool means a broken/misconfigured build, so fail loudly
# rather than silently skipping.
- name: Enable hotswap tool loading
if: ${{ runner.os == 'Linux' && fromJSON(inputs.component).job_name == 'hip-tests' }}
run: |
hotswap_tool="${{ env.OUTPUT_ARTIFACTS_DIR }}/lib/libhsa-hotswap.so"
if [ ! -f "$hotswap_tool" ]; then
echo "::error::Hotswap tool not found at $hotswap_tool. THEROCK_ENABLE_HOTSWAP is on by default, so it should be present in the artifacts."
exit 1
fi
echo "Loading hotswap tool via HSA_TOOLS_LIB: $hotswap_tool"
echo "HSA_TOOLS_LIB=$hotswap_tool" >> $GITHUB_ENV
echo "AMD_COMGR_HOTSWAP_ENTRY_TRAMPOLINES=1" >> $GITHUB_ENV

- name: Test
id: test
timeout-minutes: ${{ fromJSON(inputs.component).timeout_minutes }}
Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Branch follows the weekly format: amd-compiler-YYYY-MM-DD
[submodule "llvm-project"]
path = compiler/amd-llvm
url = https://github.com/ROCm/llvm-project.git
url = https://github.com/harsh-amd/llvm-project.git
# Branch follows the weekly format: amd-compiler-YYYY-MM-DD
[submodule "rocm-cmake"]
path = base/rocm-cmake
Expand All @@ -20,7 +20,7 @@
branch = develop
[submodule "rocm-systems"]
path = rocm-systems
url = https://github.com/ROCm/rocm-systems.git
url = https://github.com/harsh-amd/rocm-systems.git
branch = develop
[submodule "spirv-llvm-translator"]
path = compiler/spirv-llvm-translator
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ option(THEROCK_COMPOSABLE_KERNEL_FOR_MIOPEN_ONLY

option(THEROCK_BUILD_LLVM_TOOLS "Enables building all LLVM tools (not just minimum required)" OFF)
option(THEROCK_BUILD_LLVM_TESTS "Enables building LLVM LIT tests" OFF)
option(THEROCK_ENABLE_HOTSWAP "Enables COMGR hotswap rewriting and the ROCR HSA hotswap tool" ON)

set(THEROCK_SANITIZER "" CACHE STRING "Enable project wide sanitizer build ('ASAN' for host+device, 'HOST_ASAN' for host-only)")

Expand Down
6 changes: 6 additions & 0 deletions compiler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ if(THEROCK_ENABLE_COMPILER)
# version script, avoiding symbol interposition issues.
##############################################################################

set(_comgr_hotswap_cmake_args)
if(THEROCK_ENABLE_HOTSWAP)
list(APPEND _comgr_hotswap_cmake_args -DCOMGR_ENABLE_HOTSWAP_TRANSPILE=ON)
endif()

therock_cmake_subproject_declare(amd-comgr
USE_DIST_AMDGPU_TARGETS
NO_INSTALL_RPATH # See manual handling in the pre_hook.
Expand All @@ -174,6 +179,7 @@ if(THEROCK_ENABLE_COMPILER)
-DTHEROCK_BUILD_COMGR_TESTS=${THEROCK_BUILD_COMGR_TESTS}
"-DLLVM_VERSION_SUFFIX=-rocm${ROCM_MAJOR_VERSION}"
-DLLVM_ENABLE_SYMBOL_VERSIONING=ON
${_comgr_hotswap_cmake_args}
BUILD_DEPS
rocm-cmake
RUNTIME_DEPS
Expand Down
2 changes: 1 addition & 1 deletion compiler/amd-llvm
Submodule amd-llvm updated 71 files
+40 −1 amd/comgr/CMakeLists.txt
+2 −2 amd/comgr/src/comgr-compiler.cpp
+3 −2 amd/comgr/src/comgr-disassembly.cpp
+5 −0 amd/comgr/src/comgr-env.cpp
+3 −0 amd/comgr/src/comgr-env.h
+294 −87 amd/comgr/src/comgr-hotswap-b0a0.cpp
+704 −0 amd/comgr/src/comgr-hotswap-displacement.cpp
+351 −31 amd/comgr/src/comgr-hotswap-elf.cpp
+352 −0 amd/comgr/src/comgr-hotswap-entry-trampoline.cpp
+302 −31 amd/comgr/src/comgr-hotswap-internal.h
+30 −3 amd/comgr/src/comgr-hotswap-llvm.cpp
+745 −0 amd/comgr/src/comgr-hotswap-patch-f32-to-e5m3.cpp
+48 −15 amd/comgr/src/comgr-hotswap-patch-inplace.cpp
+597 −108 amd/comgr/src/comgr-hotswap-patch-trampoline.cpp
+5 −5 amd/comgr/src/comgr-hotswap-patch-vop3px2-src2.cpp
+17 −17 amd/comgr/src/comgr-hotswap-patch-wmma-hazard.cpp
+757 −0 amd/comgr/src/comgr-hotswap-patch-wmma-scale16.cpp
+679 −0 amd/comgr/src/comgr-hotswap-patch-wmma-split.cpp
+36 −0 amd/comgr/src/comgr-hotswap-patches.def
+151 −10 amd/comgr/src/comgr-hotswap.cpp
+54 −0 amd/comgr/src/hotswap/CMakeLists.txt
+71 −0 amd/comgr/src/hotswap/README.md
+65 −0 amd/comgr/src/hotswap/code_object_utils.h
+36 −0 amd/comgr/src/hotswap/raise_failure.h
+106 −0 amd/comgr/src/hotswap/raiser.cpp
+48 −0 amd/comgr/src/hotswap/raiser.h
+20 −0 amd/comgr/test-lit/hotswap-barrier-isfirst.s
+145 −0 amd/comgr/test-lit/hotswap-cvt-f32-fp8.s
+273 −0 amd/comgr/test-lit/hotswap-cvt-fp8-bytesel.s
+229 −0 amd/comgr/test-lit/hotswap-cvt-fp8-modifiers.s
+123 −0 amd/comgr/test-lit/hotswap-cvt-fp8-multi.s
+135 −0 amd/comgr/test-lit/hotswap-cvt-fp8-nosled.s
+169 −0 amd/comgr/test-lit/hotswap-cvt-pk-fp8.s
+148 −0 amd/comgr/test-lit/hotswap-cvt-sr-fp8.s
+60 −0 amd/comgr/test-lit/hotswap-inplace-saddr.s
+58 −0 amd/comgr/test-lit/hotswap-kernel-entry-trampoline-multi.s
+90 −0 amd/comgr/test-lit/hotswap-kernel-entry-trampoline.s
+83 −0 amd/comgr/test-lit/hotswap-trampoline-addtid-nosled.s
+196 −0 amd/comgr/test-lit/hotswap-trampoline-addtid.s
+7 −7 amd/comgr/test-lit/hotswap-trampoline-ds-multi.s
+1 −6 amd/comgr/test-lit/hotswap-trampoline-ds-nosled.s
+88 −0 amd/comgr/test-lit/hotswap-trampoline-ds-nostride64-multi.s
+364 −0 amd/comgr/test-lit/hotswap-trampoline-ds-nostride64.s
+10 −9 amd/comgr/test-lit/hotswap-trampoline-ds-nowait.s
+118 −0 amd/comgr/test-lit/hotswap-trampoline-ds-pipelined.s
+14 −24 amd/comgr/test-lit/hotswap-trampoline-ds.s
+148 −0 amd/comgr/test-lit/hotswap-trampoline-ds2-offset-overflow.s
+69 −0 amd/comgr/test-lit/hotswap-trampoline-tensor-liveness.s
+201 −0 amd/comgr/test-lit/hotswap-trampoline-tensor-multi.s
+79 −0 amd/comgr/test-lit/hotswap-trampoline-tensor-nosled.s
+213 −0 amd/comgr/test-lit/hotswap-trampoline-tensor.s
+0 −2 amd/comgr/test-lit/hotswap-wmma-hazard-partial.s
+0 −2 amd/comgr/test-lit/hotswap-wmma-hazard.s
+187 −0 amd/comgr/test-lit/hotswap-wmma-scale16.s
+95 −0 amd/comgr/test-lit/hotswap-wmma-split-and-hazard.s
+42 −0 amd/comgr/test-lit/hotswap-wmma-split-fp-imm.s
+38 −0 amd/comgr/test-lit/hotswap-wmma-split-int-imm.s
+47 −0 amd/comgr/test-lit/hotswap-wmma-split-matrix-a-reuse.s
+38 −0 amd/comgr/test-lit/hotswap-wmma-split-matrix-b-reuse.s
+43 −0 amd/comgr/test-lit/hotswap-wmma-split-msplit-fp-imm.s
+39 −0 amd/comgr/test-lit/hotswap-wmma-split-msplit-neg-lo.s
+61 −0 amd/comgr/test-lit/hotswap-wmma-split-multi-wmma.s
+38 −0 amd/comgr/test-lit/hotswap-wmma-split-neg-hi-k.s
+48 −0 amd/comgr/test-lit/hotswap-wmma-split-neg-lo-k.s
+51 −0 amd/comgr/test-lit/hotswap-wmma-split-src2-eq-dst.s
+229 −0 amd/comgr/test-lit/hotswap-wmma-split.s
+41 −6 amd/comgr/test-unit/CMakeLists.txt
+396 −0 amd/comgr/test-unit/HotswapElfTest.cpp
+705 −2 amd/comgr/test-unit/HotswapMCTest.cpp
+106 −0 amd/comgr/test-unit/RaiserScaffoldingTest.cpp
+38 −0 amd/comgr/test-unit/comgr-test-elf-utils.h
32 changes: 32 additions & 0 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,37 @@ if(THEROCK_ENABLE_CORE_RUNTIME)
LIB_NAMES libhsa-runtime64.so
)

set(_core_runtime_hotswap_subproject_deps)
if(THEROCK_ENABLE_HOTSWAP AND NOT WIN32)
############################################################################
# HSA HotSwap tool
############################################################################

therock_cmake_subproject_declare(hsa-hotswap
EXTERNAL_SOURCE_DIR "${THEROCK_ROCM_SYSTEMS_SOURCE_DIR}/projects/hotswap"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/hsa-hotswap"
BACKGROUND_BUILD
DISABLE_AMDGPU_TARGETS
COMPILER_TOOLCHAIN
"${_system_toolchain}"
RUNTIME_DEPS
ROCR-Runtime
amd-comgr
INTERFACE_LINK_DIRS
"lib"
INTERFACE_INSTALL_RPATH_DIRS
"lib"
)
therock_cmake_subproject_glob_c_sources(hsa-hotswap SUBDIRS .)
therock_cmake_subproject_activate(hsa-hotswap)
list(APPEND _core_runtime_hotswap_subproject_deps hsa-hotswap)

therock_test_validate_shared_lib(
PATH hsa-hotswap/dist/lib
LIB_NAMES libhsa-hotswap.so
)
endif()

##############################################################################
# rocminfo
##############################################################################
Expand All @@ -165,6 +196,7 @@ if(THEROCK_ENABLE_CORE_RUNTIME)
set(_core_runtime_subproject_deps
ROCR-Runtime
rocminfo
${_core_runtime_hotswap_subproject_deps}
)
set(_core_runtime_artifact_components
dbg
Expand Down
Loading