Files
rocm-systems/.jenkins/Jenkinsfile
T
Maneesh Gupta 81c12ab01d Better handle failures in CI infra (#3098)
* Update Jenkinsfile
* Update tests/catch/unit/CMakeLists.txt
2022-11-23 12:34:02 +05:30

132 líneas
6.3 KiB
Groovy

def hipBuildTest(String backendLabel) {
node(backendLabel) {
stage("Source sync ${backendLabel}") {
// Checkout hip repository with the PR patch
dir("${WORKSPACE}/hip") {
checkout scm
env.HIP_DIR = "${WORKSPACE}" + "/hip"
}
// Clone hipamd repository
dir("${WORKSPACE}/hipamd") {
git branch: 'develop',
url: 'https://github.com/ROCm-Developer-Tools/hipamd'
}
// Clone vdi and opencl for only amd backend server
if (backendLabel =~ /.*amd.*/) {
dir("${WORKSPACE}/ROCm-OpenCL-Runtime") {
git branch:'develop',
url: 'https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime'
env.OPENCL_DIR = "${WORKSPACE}" + "/ROCm-OpenCL-Runtime"
}
dir("${WORKSPACE}/ROCclr") {
git branch:'develop',
url: 'https://github.com/ROCm-Developer-Tools/ROCclr'
env.ROCclr_DIR = "${WORKSPACE}" + "/ROCclr"
}
}
}
stage("Build - HIT framework ${backendLabel}") {
// Running the build on hipamd workspace
dir("${WORKSPACE}/hipamd") {
sh """#!/usr/bin/env bash
set -x
rm -rf build
mkdir build
cd build
# Check if backend label contains string "amd" or backend host is a server with amd gpu
if [[ $backendLabel =~ amd ]]; then
cmake -DHIP_CATCH_TEST=0 -DHIP_COMMON_DIR=$HIP_DIR -DAMD_OPENCL_PATH=\$OPENCL_DIR -DROCCLR_PATH=\$ROCclr_DIR -DCMAKE_PREFIX_PATH="/opt/rocm/" -DCMAKE_INSTALL_PREFIX=\$PWD/install ..
else
cmake -DHIP_CATCH_TEST=0 -DHIP_PLATFORM=nvidia -DHIP_COMMON_DIR=$HIP_DIR -DCMAKE_INSTALL_PREFIX=\$PWD/install ..
fi
make install -j\$(nproc)
if [[ $backendLabel =~ amd ]]; then
make build_tests -j\$(nproc)
else
HIP_COMPILER=nvcc HIP_PLATFORM=nvidia make build_tests -j\$(nproc)
fi
"""
}
}
timeout(time: 1, unit: 'HOURS') {
stage("HIP Unit Tests - HIT framework ${backendLabel}") {
dir("${WORKSPACE}/hipamd/build") {
sh """#!/usr/bin/env bash
set -x
# Check if backend label contains string "amd" or backend host is a server with amd gpu
if [[ $backendLabel =~ amd ]]; then
sleep 120
LLVM_PATH=/opt/rocm/llvm ctest --overwrite BuildDirectory=. --output-junit hiptest_output_hit_amd.xml -E 'cooperative_streams_least_capacity.tst|cooperative_streams_half_capacity.tst|cooperative_streams_full_capacity.tst|grid_group_data_sharing.tst|hipIpcMemAccessTest.tst|p2p_copy_coherency.tst'
else
ctest --overwrite BuildDirectory=. --output-junit hiptest_output_hit_nvidia.xml
fi
"""
}
}
}
stage("Build - Catch2 framework ${backendLabel}") {
// Running the build on hipamd workspace
dir("${WORKSPACE}/hipamd") {
sh """#!/usr/bin/env bash
set -x
mkdir -p build
cd build
# Check if backend label contains string "amd" or backend host is a server with amd gpu
if [[ $backendLabel =~ amd ]]; then
export HT_CONFIG_FILE="$HIP_DIR/tests/catch/hipTestMain/config/config_amd_linux.json"
cmake -DHIP_CATCH_TEST=1 -DCI_DISABLE_TESTBUILD=1 -DHIP_PATH=\$PWD/install -DHIP_COMMON_DIR=$HIP_DIR -DAMD_OPENCL_PATH=\$OPENCL_DIR -DROCCLR_PATH=\$ROCclr_DIR -DCMAKE_PREFIX_PATH="/opt/rocm/" -DCMAKE_INSTALL_PREFIX=\$PWD/install ..
else
export HIP_PLATFORM=nvidia
export HIP_COMPILER=nvcc
export HIP_RUNTIME=cuda
cmake -DHIP_CATCH_TEST=1 -DHIP_PATH=\$PWD/install -DHIP_COMMON_DIR=$HIP_DIR -DCMAKE_INSTALL_PREFIX=\$PWD/install ..
fi
make install -j\$(nproc)
if [[ $backendLabel =~ amd ]]; then
make build_tests -j\$(nproc)
else
HIP_COMPILER=nvcc HIP_PLATFORM=nvidia make build_tests -j\$(nproc)
fi
"""
}
}
timeout(time: 1, unit: 'HOURS') {
stage("HIP Unit Tests - Catch2 framework ${backendLabel}") {
dir("${WORKSPACE}/hipamd/build") {
sh """#!/usr/bin/env bash
set -x
# Check if backend label contains string "amd" or backend host is a server with amd gpu
if [[ $backendLabel =~ amd ]]; then
sleep 120
export HT_CONFIG_FILE="$HIP_DIR/tests/catch/hipTestMain/config/config_amd_linux.json"
LLVM_PATH=/opt/rocm/llvm ctest --overwrite BuildDirectory=. --output-junit hiptest_output_catch_amd.xml -E 'Unit_hipGraphChildGraphNodeGetGraph_Functional|Unit_hipGraphExecMemcpyNodeSetParamsFromSymbol_Negative|Unit_hipPtrGetAttribute_Simple|Unit_hipStreamPerThread_DeviceReset_2'
else
ctest --overwrite BuildDirectory=. --output-junit hiptest_output_catch_nvidia.xml
fi
"""
}
}
}
}
}
timestamps {
node('external-bootstrap') {
skipDefaultCheckout()
// labels belonging to each backend - AMD, NVIDIA
String[] labels = ['hip-amd-vg20-ubu1804', 'hip-nvidia-rtx5000-ubu1804']
buildMap = [:]
labels.each { backendLabel ->
echo "backendLabel: ${backendLabel}"
buildMap[backendLabel] = { hipBuildTest(backendLabel) }
}
buildMap['failFast'] = false
parallel buildMap
}
}