From 707ad0025f3fea189f8861ff741861c45aac786f Mon Sep 17 00:00:00 2001 From: Illia Silin <98187287+illsilin@users.noreply.github.com> Date: Mon, 16 Oct 2023 08:40:26 -0700 Subject: [PATCH] Add hipTensor build and test to CK CI. (#990) * add a hipTensor test to CI * use jenkins git plugin * change hipTensor folder location in CI * change the git method for hipTensor * run tests usign ctest * check the hipTensor contents * only build hipTensor on MI100/200 * pull hipTensor as zip archive * fix jenkins syntax * add path to the CK installation * combine build commands into one shell * change jenkins syntax for CK installer path * try different syntax * allow unzip overwrite * fix jenkins file syntax * remove any old versions of hipTensor before building * add option to select hipTensor branch for testing --- Dockerfile | 1 + Jenkinsfile | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/Dockerfile b/Dockerfile index 75ca0c7f9f..eb3305a42e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,6 +49,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --allow- vim \ nano \ zlib1g-dev \ + zip \ openssh-server \ clang-format-12 \ kmod && \ diff --git a/Jenkinsfile b/Jenkinsfile index 60a53c54fb..38bd3d7df4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -526,6 +526,26 @@ def Build_CK(Map conf=[:]){ stash "ckprofiler_0.2.0_amd64.deb" } } + if (params.hipTensor_test && navi_node == 0 ){ + //build and test hipTensor + sh """#!/bin/bash + rm -rf "${params.hipTensor_branch}".zip + rm -rf hipTensor-"${params.hipTensor_branch}" + wget https://github.com/ROCmSoftwarePlatform/hipTensor/archive/refs/heads/"${params.hipTensor_branch}".zip + unzip -o "${params.hipTensor_branch}".zip + """ + dir("hipTensor-${params.hipTensor_branch}"){ + sh """#!/bin/bash + mkdir -p build + ls -ltr + CC=hipcc CXX=hipcc cmake -Bbuild . -D CMAKE_PREFIX_PATH="/opt/rocm;${env.WORKSPACE}/install" + cmake --build build -- -j + """ + } + dir("hipTensor-${params.hipTensor_branch}/build"){ + sh 'ctest' + } + } } } } @@ -654,6 +674,15 @@ pipeline { name: "DL_KERNELS", defaultValue: false, description: "Select whether to build DL kernels (default: OFF)") + booleanParam( + name: "hipTensor_test", + defaultValue: true, + description: "Use the CK build to verify hipTensor build and tests (default: ON)") + string( + name: 'hipTensor_branch', + defaultValue: 'mainline', + description: 'Specify which branch of hipTensor to use (default: mainline)') + } environment{ dbuser = "${dbuser}"