Repository navigation
Dockerfile - Add ROCm7.2 dockerfile #855
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
Open
Nguyen Vuong (normanvuong)
wants to merge
15
commits into
microsoft:main
Choose a base branch
from
normanvuong:nguyenvuong/rocm_7.2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+568
−1
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
f26b90c
Dockerfile - Add ROCm7.2 dockerfile
7bd824d
Dockerfile - Inherit CMAKE_POLICY_VERSION_MINIMUM for hipBLASLt confi…
addef07
Dockerfile - Cap OpenMPI build parallelism with NUM_MAKE_JOBS
53f0b89
Dockerfile - Refresh apt index before third_party ROCm build
8d72f6b
Dockerfile - Require CMake 3.24.4 for ROCm 7.2 image
fa2e0c0
Dockerfile - Require CMake 3.25.3 for ROCm 7.2 image
ac558ba
Merge upstream main into nguyenvuong/rocm_7.2
0e7eab8
Dockerfile - Address ROCm 7.2 review feedback
004909f
Merge branch 'main' into nguyenvuong/rocm_7.2
polarG 58d8392
Merge branch 'main' into nguyenvuong/rocm_7.2
polarG 0a707dd
Merge branch 'main' into nguyenvuong/rocm_7.2
polarG a8e1c76
Merge branch 'main' into nguyenvuong/rocm_7.2
gusui-msft 8e6d560
Merge branch 'main' into nguyenvuong/rocm_7.2
gusui-msft ffe9cc3
Merge branch 'main' into nguyenvuong/rocm_7.2
gusui-msft a8b45b4
Merge branch 'main' into nguyenvuong/rocm_7.2
normanvuong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,129 @@ | ||
| # Copyright (c) Microsoft Corporation. | ||
| # Licensed under the MIT License. | ||
|
|
||
| # Standalone CMake for building hipblaslt-bench against system-installed | ||
| # hipBLASLt, bypassing the upstream build system. | ||
| # | ||
| # Used by dockerfile/rocm7.2.x.dockerfile because the upstream 7.2 source | ||
| # tree pulls in AMD-internal "origami" headers and a new tensilelite-host | ||
| # C++ library that conflict with the goal of building only the bench tool. | ||
| # | ||
| # Place this file at the root of an upstream hipBLASLt source tree as the | ||
| # top-level CMakeLists.txt and configure it as a normal CMake project, e.g.: | ||
| # | ||
| # cp /path/to/this/file /path/to/hipBLASLt/CMakeLists.txt | ||
| # cmake -S /path/to/hipBLASLt -B /path/to/hipBLASLt/build -DCMAKE_HIP_ARCHITECTURES="gfx942;gfx950" | ||
| # cmake --build /path/to/hipBLASLt/build --target hipblaslt-bench | ||
|
|
||
| cmake_minimum_required(VERSION 3.21) | ||
| project(hipblaslt-bench-standalone LANGUAGES CXX HIP) | ||
|
|
||
| set(CMAKE_CXX_STANDARD 17) | ||
| set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
| set(CMAKE_HIP_STANDARD 17) | ||
| set(CMAKE_POSITION_INDEPENDENT_CODE ON) | ||
|
|
||
| if(NOT DEFINED ROCM_PATH) | ||
| if(DEFINED ENV{ROCM_PATH}) | ||
| set(ROCM_PATH "$ENV{ROCM_PATH}") | ||
| else() | ||
| set(ROCM_PATH "/opt/rocm") | ||
| endif() | ||
| endif() | ||
|
|
||
| # The directory containing this build script is the hipBLASLt source root. | ||
| set(HIPBLASLT_SRC "${CMAKE_CURRENT_SOURCE_DIR}") | ||
|
|
||
| # --- Dependencies (all from system / preinstalled) --- | ||
| find_package(hip REQUIRED) | ||
| find_package(hipblaslt CONFIG REQUIRED) | ||
| find_package(LAPACK REQUIRED) # also brings BLAS via implicit find_package(BLAS) | ||
| find_package(OpenMP REQUIRED) | ||
| find_package(rocm_smi) # optional | ||
|
|
||
| # Locate cblas explicitly (not part of LAPACK's standard targets). | ||
| # cblas_interface.cpp uses cblas_sgemm/dgemm so we need the C BLAS library. | ||
| find_library(CBLAS_LIBRARY NAMES cblas PATHS /usr/local/lib /usr/lib REQUIRED) | ||
| message(STATUS "Found CBLAS: ${CBLAS_LIBRARY}") | ||
|
|
||
| # --- The bench static helper library --- | ||
| # Mirrors the source list of upstream clients/common/src/CMakeLists.txt with | ||
| # rocRoller (mxDataGen.cpp) and BLIS (blis_interface.cpp) disabled. | ||
| set(HIPBLASLT_CLIENTS_COMMON_SOURCES | ||
| "${HIPBLASLT_SRC}/clients/common/src/singletons.cpp" | ||
| "${HIPBLASLT_SRC}/clients/common/src/utility.cpp" | ||
| "${HIPBLASLT_SRC}/clients/common/src/efficiency_monitor.cpp" | ||
| "${HIPBLASLT_SRC}/clients/common/src/cblas_interface.cpp" | ||
| "${HIPBLASLT_SRC}/clients/common/src/argument_model.cpp" | ||
| "${HIPBLASLT_SRC}/clients/common/src/hipblaslt_parse_data.cpp" | ||
| "${HIPBLASLT_SRC}/clients/common/src/hipblaslt_arguments.cpp" | ||
| "${HIPBLASLT_SRC}/clients/common/src/hipblaslt_random.cpp" | ||
| "${HIPBLASLT_SRC}/clients/common/src/hipblaslt_init_device.cpp" | ||
| ) | ||
| add_library(hipblaslt-clients-common STATIC ${HIPBLASLT_CLIENTS_COMMON_SOURCES}) | ||
|
|
||
| # These .cpp files are HIP code (use __device__/__host__, hip_runtime APIs, | ||
| # half/bfloat16 types). Compiling them as plain CXX with gcc fails. Force HIP. | ||
| set_source_files_properties(${HIPBLASLT_CLIENTS_COMMON_SOURCES} PROPERTIES LANGUAGE HIP) | ||
|
|
||
| target_include_directories(hipblaslt-clients-common | ||
| PUBLIC | ||
| "${HIPBLASLT_SRC}/clients/common/include" | ||
| "${HIPBLASLT_SRC}/clients/bench/include" | ||
| # Source's library/include comes BEFORE system include so we get | ||
| # hipblaslt_xfloat32.h (not shipped in the system install). | ||
| "${HIPBLASLT_SRC}/library/include" | ||
| # Internal headers used by clients (rocblaslt/rocblaslt-types.h etc.) | ||
| "${HIPBLASLT_SRC}/library/src/amd_detail/include" | ||
| "${HIPBLASLT_SRC}/library/src/amd_detail/rocblaslt/include" | ||
| "${HIPBLASLT_SRC}/library/src/amd_detail/rocblaslt/src/include" | ||
| # tensilelite headers used by clients (e.g. client/include/Utility.hpp). | ||
| "${HIPBLASLT_SRC}/tensilelite/include" | ||
| "${HIPBLASLT_SRC}/tensilelite" | ||
| ) | ||
|
|
||
| target_compile_definitions(hipblaslt-clients-common | ||
| PUBLIC | ||
| # Critical: in 7.2 the upstream build sets ROCM_USE_FLOAT16 only | ||
| # via the in-tree hipblaslt target's INTERFACE_COMPILE_DEFINITIONS. | ||
| # The system find_package(hipblaslt) does not propagate it. Without | ||
| # this, hipblasLtHalf is the struct version with no operator float, | ||
| # which breaks hipblaslt_ostream.hpp. | ||
| ROCM_USE_FLOAT16 | ||
| __HIP_PLATFORM_AMD__ | ||
| HIPBLASLT_BENCH | ||
| ) | ||
|
|
||
| target_link_libraries(hipblaslt-clients-common | ||
| PUBLIC | ||
| hip::host | ||
| hip::device | ||
| # Order matters: cblas -> lapack -> blas -> gfortran (lapack needs blas | ||
| # which needs Fortran runtime). | ||
| ${CBLAS_LIBRARY} | ||
| ${LAPACK_LIBRARIES} | ||
| ${BLAS_LIBRARIES} | ||
| gfortran | ||
| OpenMP::OpenMP_CXX | ||
| ) | ||
|
|
||
| if(rocm_smi_FOUND) | ||
| target_link_libraries(hipblaslt-clients-common PRIVATE rocm_smi64) | ||
| endif() | ||
|
|
||
| # Link against the system hipblaslt .so directly via library name to avoid | ||
| # inheriting INTERFACE_COMPILE_DEFINITIONS (HIPBLASLT_USE_ROCROLLER) from | ||
| # the imported roc::hipblaslt target. We only need linkage, not propagated | ||
| # defines. | ||
| target_link_directories(hipblaslt-clients-common PUBLIC "${ROCM_PATH}/lib") | ||
| target_link_libraries(hipblaslt-clients-common PUBLIC hipblaslt) | ||
|
|
||
| # --- The bench executable --- | ||
| add_executable(hipblaslt-bench | ||
| "${HIPBLASLT_SRC}/clients/bench/src/client.cpp" | ||
| ) | ||
| set_source_files_properties( | ||
| "${HIPBLASLT_SRC}/clients/bench/src/client.cpp" | ||
| PROPERTIES LANGUAGE HIP | ||
| ) | ||
| target_link_libraries(hipblaslt-bench PRIVATE hipblaslt-clients-common) | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.