// Copyright © Advanced Micro Devices, Inc., or its affiliates. // SPDX-License-Identifier: MIT def rocmnode(name) { def node_name = 'rocmtest' if(name == 'fiji') { node_name = 'rocmtest && fiji'; } else if(name == 'vega') { node_name = 'rocmtest && vega'; } else if(name == 'vega10') { node_name = 'rocmtest && vega10'; } else if(name == 'vega20') { node_name = 'rocmtest && vega20'; } else if(name == 'gfx908') { node_name = 'gfx908'; } else { node_name = name } return node_name } def buildJob(compiler, flags, image, test, testargs){ env.HSA_ENABLE_SDMA=0 checkout scm def dockerOpts="--device=/dev/kfd --device=/dev/dri --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined" def retimage try { retimage = docker.build("${image}", "--build-arg PREFIX=/usr/local .") withDockerContainer(image: image, args: dockerOpts) { timeout(time: 5, unit: 'MINUTES') { sh 'PATH="/opt/rocm/opencl/bin/x86_64/:$PATH" clinfo' } } } catch(Exception ex) { retimage = docker.build("${image}", "--build-arg PREFIX=/usr/local --no-cache .") withDockerContainer(image: image, args: dockerOpts) { timeout(time: 5, unit: 'MINUTES') { sh 'PATH="/opt/rocm/opencl/bin/x86_64/:$PATH" clinfo' } } } withDockerContainer(image: image, args: dockerOpts + ' -v=/var/jenkins/:/var/jenkins') { timeout(time: 8, unit: 'HOURS') { sh "echo \$HSA_ENABLE_SDMA" // WORKAROUND_ISSUE_3192 Disabling MLIR for debug builds since MLIR generates sanitizer errors. sh "rm -rf build; mkdir build; cd build; export PATH=/opt/rocm/bin:$PATH; CXX=${compiler} CXXFLAGS='-Werror' cmake -DMIOPEN_GPU_SYNC=On -DMIOPEN_USE_MLIR=OFF -DMIOPEN_TEST_FLAGS='--disable-verification-cache' -DCMAKE_CXX_FLAGS_DEBUG='-g -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover=undefined' ${flags} .." sh "cd build; CTEST_PARALLEL_LEVEL=4 MIOPEN_VERIFY_CACHE_PATH=/var/jenkins/.cache/miopen/vcache dumb-init make -j\$(nproc) ${test}" sh "MIOPEN_LOG_LEVEL=6 ./build/bin/${test} ${testargs}" } } return retimage } pipeline { agent none environment{ image = "miopenrocm" buildflag = '-DBUILD_DEV=On -DMIOPEN_TEST_ALL=On -DCMAKE_BUILD_TYPE=releasewithdebug -DCMAKE_PREFIX_PATH=/opt/rocm' test = "test_conv2d" } stages{ stage("HIP Release Convolution fp32"){ parallel{ stage("2D pads_strides_dilations 0 0 1 1 1 1") { agent{ label rocmnode("vega") } steps{ buildJob("hcc", buildflag, image, test, '--all -n 4 --verbose --disable-verification-cache --pads_strides_dilations 0 0 1 1 1 1') } } /*stage("2D pads_strides_dilations 0 0 2 2 1 1") { agent{ label rocmnode("vega") } steps{ buildJob("hcc", buildflag, image, test, '--all -n 4 --verbose --disable-verification-cache --pads_strides_dilations 0 0 2 2 1 1') } }*/ stage("2D pads_strides_dilations 2 2 1 1 1 1") { agent{ label rocmnode("vega") } steps{ buildJob("hcc", buildflag, image, test, '--all -n 4 --verbose --disable-verification-cache --pads_strides_dilations 2 2 1 1 1 1') } } stage("2D pads_strides_dilations 3 3 2 2 1 1") { agent{ label rocmnode("vega") } steps{ buildJob("hcc", buildflag, image, test, '--all -n 4 --verbose --disable-verification-cache --pads_strides_dilations 3 3 2 2 1 1') } } stage("2D pads_strides_dilations 0 0 1 1 2 2") { agent{ label rocmnode("vega") } steps{ buildJob("hcc", buildflag, image, test, '--all -n 4 --verbose --disable-verification-cache --pads_strides_dilations 0 0 1 1 2 2') } } stage("2D pads_strides_dilations 2 2 1 1 4 3") { agent{ label rocmnode("vega") } steps{ buildJob("hcc", buildflag, image, test, '--all -n 4 --verbose --disable-verification-cache --pads_strides_dilations 2 2 1 1 4 3') } } stage("2D pads_strides_dilations 3 3 2 2 3 4") { agent{ label rocmnode("vega") } steps{ buildJob("hcc", buildflag, image, test, '--all -n 4 --verbose --disable-verification-cache --pads_strides_dilations 3 3 2 2 3 4') } } stage("2D pads_strides_dilations 1 1 1 1 1 1") { agent{ label rocmnode("vega") } steps{ buildJob("hcc", buildflag, image, test, '--all -n 4 --verbose --disable-verification-cache --pads_strides_dilations 1 1 1 1 1 1') } } /*stage("2D pads_strides_dilations 1 1 2 2 1 1") { agent{ label rocmnode("vega") } steps{ buildJob("hcc", buildflag, image, test, '--all -n 4 --verbose --disable-verification-cache --pads_strides_dilations 1 1 2 2 1 1') } }*/ /*stage("2D pads_strides_dilations 3 3 2 2 4 4") { agent{ label rocmnode("vega") } steps{ buildJob("hcc", buildflag, image, test, '--all -n 4 --verbose --disable-verification-cache --pads_strides_dilations 3 3 2 2 4 4') } }*/ /*stage("2D pads_strides_dilations 1 1 2 2 2 1") { agent{ label rocmnode("vega") } steps{ buildJob("hcc", buildflag, image, test, '--all -n 4 --verbose --disable-verification-cache --pads_strides_dilations 1 1 2 2 2 1') } }*/ } } } }