Skip to content

Commit 08e81b1

Browse files
authored
Merge pull request #15 from SC-SGS/bugfixes
Bugfixes
2 parents db15b40 + 9bd8789 commit 08e81b1

File tree

13 files changed

+373
-15
lines changed

13 files changed

+373
-15
lines changed

.jenkins/Jenkinsfile-AMD-tests

Lines changed: 314 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,314 @@
1+
#!groovy
2+
3+
def buildbadge = addEmbeddableBadgeConfiguration(id: "Jenkins", subject: "Jenkins Tests", status: "skipped")
4+
5+
if (currentBuild.getBuildCauses().toString().contains('BranchIndexingCause')) {
6+
print "INFO: Build on ${env.BRANCH_NAME}/${env.BUILD_NUMBER} triggered by branch indexing..."
7+
if (env.BRANCH_NAME != "master") {
8+
if (env.BUILD_NUMBER != "1") { // Always execute first build to load this configuration and thus the triggers
9+
print "INFO: Build on ${env.BRANCH_NAME}/${env.BUILD_NUMBER} skipped due being triggered by Branch Indexing instead of SCM change!"
10+
buildbadge.setStatus('skipped')
11+
currentBuild.result = 'ABORTED'
12+
return // early exit to avoid redundant builds
13+
}
14+
}
15+
} else {
16+
print "INFO: Build on ${env.BRANCH_NAME}/${env.BUILD_NUMBER} triggered by SCM change..."
17+
print "Proceeding!"
18+
}
19+
20+
21+
pipeline {
22+
agent { label 'sgs_amd_gpu_node' }
23+
24+
options {
25+
buildDiscarder(
26+
logRotator(
27+
daysToKeepStr: "21",
28+
numToKeepStr: "50",
29+
artifactDaysToKeepStr: "21",
30+
artifactNumToKeepStr: "50"
31+
)
32+
)
33+
disableConcurrentBuilds()
34+
}
35+
36+
triggers {
37+
githubPush() // Trigger by push to respective github branch
38+
pollSCM 'H/30 * * * *' // Fallback polling solution as some pushes are somehow lost
39+
}
40+
41+
environment {
42+
GITHUB_TOKEN = credentials('GITHUB_TOKEN')
43+
BRANCH_NAME = "${env.BRANCH_NAME}"
44+
}
45+
46+
stages {
47+
stage('init') {
48+
steps {
49+
dir('plssvm') {
50+
sh '''
51+
gitlab_token=$(echo ${GITHUB_TOKEN} | cut -f2 -d':')
52+
curl --verbose\
53+
--request POST \
54+
--url "https://api.github.com/repos/SC-SGS/PLSSVM/statuses/$GIT_COMMIT" \
55+
--header "Content-Type: application/json" \
56+
--header "authorization: Bearer ${gitlab_token}" \
57+
--data "{
58+
\\"state\\": \\"pending\\",
59+
\\"context\\": \\"jenkins-ctest-amd\\",
60+
\\"description\\": \\"Jenkins CI Job: jenkins-ctest-amd\\",
61+
\\"target_url\\": \\"https://simsgs.informatik.uni-stuttgart.de/jenkins/view/PLSSVM/job/PLSSVM/job/Github-AMD/job/${BRANCH_NAME}/$BUILD_NUMBER\\"
62+
}"
63+
'''
64+
}
65+
}
66+
}
67+
stage('checkout') {
68+
steps {
69+
dir('plssvm') {
70+
checkout scm
71+
}
72+
}
73+
}
74+
stage('setup python'){
75+
steps{
76+
sh '''
77+
/usr/bin/python3.8 -m pip install --user arff
78+
/usr/bin/python3.8 -m pip install --user pandas
79+
/usr/bin/python3.8 -m pip install --user sklearn
80+
/usr/bin/python3.8 -m pip install --user argparse
81+
'''
82+
}
83+
}
84+
stage('build plssvm Release') {
85+
steps {
86+
dir('plssvm') {
87+
sh '''
88+
source /import/sgs.local/scratch/breyerml/spack/share/spack/setup-env.sh
89+
module use /home/breyerml/.modulefiles/
90+
module load plssvm/pcsgs09/hip
91+
module load plssvm/pcsgs09/dpcpp
92+
module load cmake-3.22.2-gcc-9.3.0-wi6mnc2
93+
mkdir -p build/Release
94+
cd build/Release
95+
rm -rf *
96+
cmake -DCMAKE_BUILD_TYPE=Release -DPLSSVM_TARGET_PLATFORMS="cpu:avx2;amd:gfx906" -DCMAKE_CXX_COMPILER=clang++ -DPLSSVM_ENABLE_HIP_BACKEND=ON -DPLSSVM_ENABLE_ASSERTS=ON -DPLSSVM_ENABLE_SYCL_BACKEND=OFF ../../
97+
make -j4
98+
'''
99+
}
100+
}
101+
}
102+
stage('run tests Release') {
103+
steps {
104+
dir('plssvm') {
105+
warnError('Release tests failed!') {
106+
sh '''
107+
source /import/sgs.local/scratch/breyerml/spack/share/spack/setup-env.sh
108+
module use /home/breyerml/.modulefiles/
109+
module load plssvm/pcsgs09/hip
110+
module load plssvm/pcsgs09/dpcpp
111+
cd build/Release
112+
ctest -j4 --no-compress-output -T Test
113+
'''
114+
}
115+
}
116+
}
117+
}
118+
stage('build plssvm hipSYCL Release') {
119+
steps {
120+
dir('plssvm') {
121+
sh '''
122+
source /import/sgs.local/scratch/breyerml/spack/share/spack/setup-env.sh
123+
module use /home/breyerml/.modulefiles/
124+
module load plssvm/pcsgs09/hipsycl
125+
module load cmake-3.22.2-gcc-9.3.0-wi6mnc2
126+
mkdir -p build/Release_hip
127+
cd build/Release_hip
128+
rm -rf *
129+
cmake -DCMAKE_BUILD_TYPE=Release -DPLSSVM_TARGET_PLATFORMS="cpu:avx2;amd:gfx906" -DCMAKE_CXX_COMPILER=clang++ -DPLSSVM_ENABLE_OPENMP_BACKEND=OFF -DPLSSVM_ENABLE_HIP_BACKEND=OFF -DPLSSVM_ENABLE_CUDA_BACKEND=OFF -DPLSSVM_ENABLE_OPENCL_BACKEND=OFF -DPLSSVM_ENABLE_SYCL_BACKEND=ON -DPLSSVM_ENABLE_ASSERTS=ON ../../
130+
make -j4
131+
'''
132+
}
133+
}
134+
}
135+
stage('run tests hipSYCL Release') {
136+
steps {
137+
dir('plssvm') {
138+
warnError('hipSYCL Release tests failed!') {
139+
sh '''
140+
source /import/sgs.local/scratch/breyerml/spack/share/spack/setup-env.sh
141+
module use /home/breyerml/.modulefiles/
142+
module load plssvm/pcsgs09/hipsycl
143+
cd build/Release_hip
144+
ctest -j4 --no-compress-output -T Test
145+
'''
146+
}
147+
}
148+
}
149+
}
150+
stage('build plssvm DPC++ Release') {
151+
steps {
152+
dir('plssvm') {
153+
sh '''
154+
source /import/sgs.local/scratch/breyerml/spack/share/spack/setup-env.sh
155+
module use /home/breyerml/.modulefiles/
156+
module load plssvm/pcsgs09/dpcpp
157+
module load cmake-3.22.2-gcc-9.3.0-wi6mnc2
158+
mkdir -p build/Release_dpcpp
159+
cd build/Release_dpcpp
160+
rm -rf *
161+
cmake -DCMAKE_BUILD_TYPE=Release -DPLSSVM_TARGET_PLATFORMS="amd:gfx906" -DCMAKE_CXX_COMPILER=clang++ -DPLSSVM_ENABLE_OPENMP_BACKEND=OFF -DPLSSVM_ENABLE_HIP_BACKEND=OFF -DPLSSVM_ENABLE_CUDA_BACKEND=OFF -DPLSSVM_ENABLE_OPENCL_BACKEND=OFF -DPLSSVM_ENABLE_SYCL_BACKEND=ON -DPLSSVM_ENABLE_ASSERTS=ON ../../
162+
make -j4
163+
'''
164+
}
165+
}
166+
}
167+
stage('run tests DPC++ Release') {
168+
steps {
169+
dir('plssvm') {
170+
warnError('DPC++ Release tests failed!') {
171+
sh '''
172+
source /import/sgs.local/scratch/breyerml/spack/share/spack/setup-env.sh
173+
module use /home/breyerml/.modulefiles/
174+
module load plssvm/pcsgs09/dpcpp
175+
cd build/Release_dpcpp
176+
ctest -j4 --no-compress-output -T Test
177+
'''
178+
}
179+
}
180+
}
181+
}
182+
stage('build plssvm Debug') {
183+
steps {
184+
dir('plssvm') {
185+
sh '''
186+
source /import/sgs.local/scratch/breyerml/spack/share/spack/setup-env.sh
187+
module use /home/breyerml/.modulefiles/
188+
module load plssvm/pcsgs09/hip
189+
module load plssvm/pcsgs09/dpcpp
190+
module load cmake-3.22.2-gcc-9.3.0-wi6mnc2
191+
mkdir -p build/Debug_cov
192+
cd build/Debug_cov
193+
rm -rf *
194+
cmake -DPLSSVM_TARGET_PLATFORMS="cpu:avx2;amd:gfx906" -DCMAKE_CXX_COMPILER=clang++ -DPLSSVM_ENABLE_SYCL_BACKEND=OFF ../../
195+
make -j4
196+
'''
197+
}
198+
}
199+
}
200+
stage('build plssvm hipSYCL Debug') {
201+
steps {
202+
dir('plssvm') {
203+
sh '''
204+
source /import/sgs.local/scratch/breyerml/spack/share/spack/setup-env.sh
205+
module use /home/breyerml/.modulefiles/
206+
module load plssvm/pcsgs09/hipsycl
207+
module load cmake-3.22.2-gcc-9.3.0-wi6mnc2
208+
mkdir -p build/Debug_hip
209+
cd build/Debug_hip
210+
rm -rf *
211+
cmake -DCMAKE_BUILD_TYPE=Debug -DPLSSVM_TARGET_PLATFORMS="cpu:avx2;amd:gfx906" -DCMAKE_CXX_COMPILER=clang++ -DPLSSVM_ENABLE_OPENMP_BACKEND=OFF -DPLSSVM_ENABLE_CUDA_BACKEND=OFF -DPLSSVM_ENABLE_OPENCL_BACKEND=OFF -DPLSSVM_ENABLE_SYCL_BACKEND=ON ../../
212+
make -j4
213+
'''
214+
}
215+
}
216+
}
217+
/*
218+
stage('build plssvm DPC++ Debug') {
219+
steps {
220+
dir('plssvm') {
221+
sh '''
222+
source /import/sgs.local/scratch/breyerml/spack/share/spack/setup-env.sh
223+
module use /home/breyerml/.modulefiles/
224+
module load plssvm/pcsgs09/dpcpp
225+
mkdir -p build/Debug_dpcpp
226+
cd build/Debug_dpcpp
227+
rm -rf *
228+
cmake -DCMAKE_BUILD_TYPE=Debug -DPLSSVM_TARGET_PLATFORMS="nvidia:sm_80" -DCMAKE_CXX_COMPILER=clang++ -DPLSSVM_ENABLE_OPENMP_BACKEND=OFF -DPLSSVM_ENABLE_CUDA_BACKEND=ON -DPLSSVM_ENABLE_OPENCL_BACKEND=OFF -DPLSSVM_ENABLE_SYCL_BACKEND=ON ../../
229+
make -j4
230+
'''
231+
}
232+
}
233+
}
234+
*/
235+
}
236+
post {
237+
always {
238+
// Process the CTest xml output with the xUnit plugin
239+
xunit (
240+
testTimeMargin: '3000',
241+
thresholdMode: 1,
242+
thresholds: [
243+
skipped(failureThreshold: '0'),
244+
failed(failureThreshold: '0')
245+
],
246+
tools: [CTest(
247+
pattern: 'plssvm/build/*/Testing/**/*.xml',
248+
deleteOutputFiles: true,
249+
failIfNotNew: false,
250+
skipNoTestFiles: true,
251+
stopProcessingIfError: true
252+
)]
253+
)
254+
255+
}
256+
success {
257+
script {
258+
buildbadge.setStatus('success')
259+
}
260+
sh '''
261+
gitlab_token=$(echo ${GITHUB_TOKEN} | cut -f2 -d':')
262+
curl --verbose\
263+
--request POST \
264+
--url "https://api.github.com/repos/SC-SGS/PLSSVM/statuses/$GIT_COMMIT" \
265+
--header "Content-Type: application/json" \
266+
--header "authorization: Bearer ${gitlab_token}" \
267+
--data "{
268+
\\"state\\": \\"success\\",
269+
\\"context\\": \\"jenkins-ctest-amd\\",
270+
\\"description\\": \\"Jenkins CI Job: jenkins-ctest-amd\\",
271+
\\"target_url\\": \\"https://simsgs.informatik.uni-stuttgart.de/jenkins/view/PLSSVM/job/PLSSVM/job/Github-AMD/job/${BRANCH_NAME}/$BUILD_NUMBER\\"
272+
}"
273+
'''
274+
}
275+
failure {
276+
script {
277+
buildbadge.setStatus('failing')
278+
}
279+
sh '''
280+
gitlab_token=$(echo ${GITHUB_TOKEN} | cut -f2 -d':')
281+
curl --verbose\
282+
--request POST \
283+
--url "https://api.github.com/repos/SC-SGS/PLSSVM/statuses/$GIT_COMMIT" \
284+
--header "Content-Type: application/json" \
285+
--header "authorization: Bearer ${gitlab_token}" \
286+
--data "{
287+
\\"state\\": \\"failure\\",
288+
\\"context\\": \\"jenkins-ctest-amd\\",
289+
\\"description\\": \\"Jenkins CI Job: jenkins-ctest-amd\\",
290+
\\"target_url\\": \\"https://simsgs.informatik.uni-stuttgart.de/jenkins/view/PLSSVM/job/PLSSVM/job/Github-AMD/job/${BRANCH_NAME}/$BUILD_NUMBER\\"
291+
}"
292+
'''
293+
}
294+
aborted {
295+
script {
296+
buildbadge.setStatus('aborted')
297+
}
298+
sh '''
299+
gitlab_token=$(echo ${GITHUB_TOKEN} | cut -f2 -d':')
300+
curl --verbose\
301+
--request POST \
302+
--url "https://api.github.com/repos/SC-SGS/PLSSVM/statuses/$GIT_COMMIT" \
303+
--header "Content-Type: application/json" \
304+
--header "authorization: Bearer ${gitlab_token}" \
305+
--data "{
306+
\\"state\\": \\"error\\",
307+
\\"context\\": \\"jenkins-ctest-amd\\",
308+
\\"description\\": \\"Jenkins CI Job: jenkins-ctest-amd\\",
309+
\\"target_url\\": \\"https://simsgs.informatik.uni-stuttgart.de/jenkins/view/PLSSVM/job/PLSSVM/job/Github-AMD/job/${BRANCH_NAME}/$BUILD_NUMBER\\"
310+
}"
311+
'''
312+
}
313+
}
314+
}

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
cmake_minimum_required(VERSION 3.18)
88

99
project("PLSSVM - Parallel Least Squares Support Vector Machine"
10-
VERSION 1.1.0
10+
VERSION 1.1.1
1111
LANGUAGES CXX
1212
DESCRIPTION "A Least Squares Support Vector Machine implementation using different backends.")
1313

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ The currently available frameworks (also called backends in our PLSSVM implement
3232
- [OpenMP](https://www.openmp.org/)
3333
- [CUDA](https://developer.nvidia.com/cuda-zone)
3434
- [OpenCL](https://www.khronos.org/opencl/)
35-
- [SYCL](https://www.khronos.org/sycl/) (tested implementations are [DPC++](https://github.com/intel/llvm) and [hipSYCL](https://github.com/illuhad/hipSYCL))
35+
- [SYCL](https://www.khronos.org/sycl/) (tested implementations are [DPC++](https://github.com/intel/llvm) and [hipSYCL](https://github.com/illuhad/hipSYCL); specifically the commits [faaba28](https://github.com/intel/llvm/tree/faaba28541138d7ad39a7fa85fa85b863560b45f) and [6962942](https://github.com/illuhad/hipSYCL/tree/6962942c430a7b221eb167b4272c29cf397cda06) respectivelly)
36+
37+
// tested with commit!
3638

3739
## Getting Started
3840

@@ -171,6 +173,7 @@ If `PLSSVM_ENABLE_TESTING` is set to `ON`, the following options can also be set
171173

172174
- `PLSSVM_GENERATE_TEST_FILE=ON|OFF` (default: `ON`): automatically generate test files
173175
- `PLSSVM_TEST_FILE_NUM_DATA_POINTS` (default: `5000`): the number of data points in the test file
176+
- `PLSSVM_TEST_FILE_NUM_FEATURES` (default: `2000`): the number of features per data point in the test file
174177

175178
If the SYCL backend is available and DPC++ is used, the option `PLSSVM_SYCL_DPCPP_USE_LEVEL_ZERO` can be used to select Level-Zero as the
176179
DPC++ backend instead of OpenCL.

include/plssvm/backends/OpenCL/q_kernel.cl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
* @brief Defines CUDA functions for generating the `q` vector.
1010
*/
1111

12+
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
13+
1214
/**
1315
* @brief Calculates the `q` vector using the linear C-SVM kernel.
1416
* @details Supports multi-GPU execution.
@@ -47,7 +49,7 @@ __kernel void device_kernel_q_poly(__global real_type *q, __global real_type *da
4749
for (int i = 0; i < num_cols; ++i) {
4850
temp += data_d[i * num_rows + index] * data_last[i];
4951
}
50-
q[index] = pow(gamma * temp + coef0, degree);
52+
q[index] = pown(gamma * temp + coef0, degree);
5153
}
5254

5355
/**

include/plssvm/backends/OpenCL/svm_kernel.cl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ __kernel void device_kernel_poly(__global const real_type *q, __global real_type
163163
real_type ret_jx = 0.0;
164164
#pragma unroll INTERNAL_BLOCK_SIZE
165165
for (kernel_index_type y = 0; y < INTERNAL_BLOCK_SIZE; ++y) {
166-
const real_type temp = (pow(gamma * matr[x][y] + coef0, degree) + QA_cost - q[i + y] - q[j + x]) * add;
166+
const real_type temp = (pown(gamma * matr[x][y] + coef0, degree) + QA_cost - q[i + y] - q[j + x]) * add;
167167
if (i + x > j + y) {
168168
// upper triangular matrix
169169
atomicAdd(&ret[i + y], temp * d[j + x]);

include/plssvm/backends/SYCL/csvm.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,15 @@ class csvm : public ::plssvm::detail::gpu_csvm<T, ::plssvm::sycl::detail::device
9494
/**
9595
* @copydoc plssvm::detail::gpu_csvm::run_q_kernel
9696
*/
97-
void run_q_kernel(std::size_t device, const ::plssvm::detail::execution_range &range, device_ptr_type &q_d, std::size_t num_features) final;
97+
void run_q_kernel(std::size_t device, [[maybe_unused]] const ::plssvm::detail::execution_range &range, device_ptr_type &q_d, std::size_t num_features) final;
9898
/**
9999
* @copydoc plssvm::detail::gpu_csvm::run_svm_kernel
100100
*/
101101
void run_svm_kernel(std::size_t device, const ::plssvm::detail::execution_range &range, const device_ptr_type &q_d, device_ptr_type &r_d, const device_ptr_type &x_d, const real_type add, std::size_t num_features) final;
102102
/**
103103
* @copydoc plssvm::detail::gpu_csvm::run_w_kernel
104104
*/
105-
void run_w_kernel(std::size_t device, const ::plssvm::detail::execution_range &range, device_ptr_type &w_d, const device_ptr_type &alpha_d, std::size_t num_features) final;
105+
void run_w_kernel(std::size_t device, [[maybe_unused]] const ::plssvm::detail::execution_range &range, device_ptr_type &w_d, const device_ptr_type &alpha_d, std::size_t num_features) final;
106106
/**
107107
* @copydoc plssvm::detail::gpu_csvm::run_predict_kernel
108108
*/

0 commit comments

Comments
 (0)