Benchmarks: Build Pipeline - Support rocm in third_party/makefile (#140)

**Description**
Support rocm in third_party/makefile.

**Major Revision**
- Split rocm and cuda target in makefile
- Add target in dockerfile
This commit is contained in:
Yuting Jiang 2021-07-29 14:18:36 +08:00 коммит произвёл GitHub
Родитель 1ee8f7dcf5
Коммит c88ce05611
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 14 добавлений и 7 удалений

Просмотреть файл

@ -93,7 +93,7 @@ ENV PATH="${PATH}" \
WORKDIR ${SB_HOME}
ADD third_party third_party
RUN make -j -C third_party
RUN make -j -C third_party cuda
ADD . .
RUN python3 -m pip install .[nvidia,torch] && \

19
third_party/Makefile поставляемый
Просмотреть файл

@ -6,10 +6,13 @@
SB_MICRO_PATH ?= "/usr/local"
MPI_HOME_PATH ?= "/usr/local/mpi"
.PHONY: all cutlass bandwidthTest nccl_tests perftest fio
.PHONY: all cuda rocm common cuda_cutlass cuda_bandwidthTest cuda_nccl_tests cuda_perftest rocm_perftest fio
# Build all targets.
all: cutlass bandwidthTest nccl_tests perftest fio
all: cuda rocm
cuda: common cuda_cutlass cuda_bandwidthTest cuda_nccl_tests cuda_perftest
rocm: common rocm_perftest
common: fio
# Create $(SB_MICRO_PATH)/bin and $(SB_MICRO_PATH)/lib, no error if existing, make parent directories as needed.
sb_micro_path:
@ -17,7 +20,7 @@ sb_micro_path:
mkdir -p $(SB_MICRO_PATH)/lib
# Build cutlass.
cutlass:
cuda_cutlass:
ifneq (,$(wildcard cutlass/CMakeLists.txt))
cmake -DCMAKE_INSTALL_BINDIR=$(SB_MICRO_PATH)/bin -DCMAKE_INSTALL_LIBDIR=$(SB_MICRO_PATH)/lib -DCMAKE_BUILD_TYPE=Release \
-DCUTLASS_NVCC_ARCHS='70;80' -DCUTLASS_ENABLE_EXAMPLES=OFF -DCUTLASS_ENABLE_TESTS=OFF -S ./cutlass -B ./cutlass/build
@ -28,7 +31,7 @@ endif
# cuda-samples is released together with CUDA, they have the exact same version. Like v10.0, v11.1 and so on.
# The version we use is the released tag of cuda-samples which is consistent with the cuda version in the environment or docker.
# The Makefile of bandwidthTest does not have 'install' target, so need to copy bin to $(SB_MICRO_PATH)/bin/ and create $(SB_MICRO_PATH)/bin/ if not existing.
bandwidthTest: sb_micro_path
cuda_bandwidthTest: sb_micro_path
if [ -d cuda-samples ]; then rm -rf cuda-samples; fi
git clone -b v$(shell nvcc --version | grep 'release' | awk '{print $$6}' | cut -c2- | cut -d '.' -f1-2) https://github.com/NVIDIA/cuda-samples.git ./cuda-samples
cd ./cuda-samples/Samples/bandwidthTest && make clean && make TARGET_ARCH=x86_64 SMS="70 75 80 86"
@ -36,7 +39,7 @@ bandwidthTest: sb_micro_path
# Build nccl-tests.
# The version we use is commit 44df0bf from master branch, since it didn't update release tag for long time.
nccl_tests: sb_micro_path
cuda_nccl_tests: sb_micro_path
ifneq (,$(wildcard nccl-tests/Makefile))
cd ./nccl-tests && make MPI=1 MPI_HOME=$(MPI_HOME_PATH) -j
cp -v ./nccl-tests/build/* $(SB_MICRO_PATH)/bin/
@ -44,10 +47,14 @@ endif
# Build perftest.
# The version we use is the tag v4.5-0.2.
perftest:
cuda_perftest:
ifneq (,$(wildcard perftest/autogen.sh))
cd perftest && ./autogen.sh && ./configure CUDA_H_PATH=/usr/local/cuda/include/cuda.h --prefix=$(SB_MICRO_PATH) && make -j && make install
endif
rocm_perftest:
ifneq (,$(wildcard perftest/autogen.sh))
cd perftest && ./autogen.sh && ./configure --enable-rocm --with-rocm=/opt/rocm --prefix=$(SB_MICRO_PATH) && make -j && make install
endif
# Build FIO from commit 0313e9 (fio-3.27 tag).
fio: