Skip to content

Commit 7d8bb9d

Browse files
committed
Merge remote-tracking branch 'origin/develop' into feature/elementwise_checks_part_2
2 parents e5a7fa8 + d48a487 commit 7d8bb9d

2,962 files changed

Lines changed: 217354 additions & 18566 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: stan-dev
2+
custom: https://mc-stan.org/support/

.github/ISSUE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ If this is a **feature request**, show what you expect to happen if the feature
2525

2626

2727
#### Current Version:
28-
v3.1.0
28+
v3.2.0

.github/workflows/main.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Windows RTools 3.5
2+
3+
on:
4+
push:
5+
branches: [ develop ]
6+
paths-ignore:
7+
- 'doygen/**'
8+
- 'hooks/**'
9+
- 'licenses/**'
10+
- 'LICENSE.md'
11+
- 'README.md'
12+
- 'RELEASE-NOTES.txt'
13+
jobs:
14+
full:
15+
name: Full unit tests
16+
runs-on: windows-latest
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
- uses: actions/setup-python@v2
21+
with:
22+
python-version: '2.x'
23+
- name: Download RTools
24+
run: Invoke-WebRequest -Uri https://cran.rstudio.com/bin/windows/Rtools/Rtools35.exe -OutFile ./R35.exe
25+
- name: Install RTools
26+
shell: powershell
27+
run: Start-Process -FilePath ./R35.exe -ArgumentList /VERYSILENT -NoNewWindow -Wait
28+
- name: PATH Setup
29+
shell: powershell
30+
run: echo "::add-path::C:/Rtools/bin"
31+
- name: PATH Setup
32+
shell: powershell
33+
run: echo "::add-path::C:/Rtools/mingw_64/bin"
34+
- name: Print g++ version
35+
shell: powershell
36+
run: g++ --version
37+
- name: Print g++ path
38+
shell: powershell
39+
run: Get-Command g++ | Select-Object -ExpandProperty Definition
40+
- name: Print mingw32-make version
41+
shell: powershell
42+
run: mingw32-make --version
43+
- name: Print mingw32-make path
44+
shell: powershell
45+
run: Get-Command mingw32-make | Select-Object -ExpandProperty Definition
46+
- name: Build Math libs
47+
shell: powershell
48+
run: mingw32-make -f make/standalone math-libs
49+
- name: Add TBB to PATH
50+
shell: powershell
51+
run: echo "::add-path::D:/a/math/math/lib/tbb"
52+
- name: Run full unit tests
53+
shell: powershell
54+
run: python.exe runTests.py -j2 test/unit -f test/unit/
55+
- name: Upload gtest_output xml
56+
uses: actions/upload-artifact@v2
57+
if: failure()
58+
with:
59+
name: gtest_outputs_xml
60+
path: '**/*_test.xml'

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,7 @@ compile_commands.json
8989

9090
# Ignore things made with tbb
9191
lib/tbb/**
92+
93+
# gdb debug history
94+
.gdb_history
95+

Jenkinsfile

Lines changed: 111 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ def deleteDirWin() {
2626
}
2727

2828
def skipRemainingStages = false
29+
def runGpuAsync = false
30+
def openClGpuLabel = "gpu"
2931

3032
def utils = new org.stan.Utils()
3133

@@ -45,13 +47,10 @@ String stan_pr() { params.stan_pr ?: ( env.CHANGE_TARGET == "master" ? "downstre
4547
pipeline {
4648
agent none
4749
parameters {
48-
string(defaultValue: '', name: 'cmdstan_pr',
49-
description: 'PR to test CmdStan upstream against e.g. PR-630')
50-
string(defaultValue: '', name: 'stan_pr',
51-
description: 'PR to test Stan upstream against e.g. PR-630')
52-
booleanParam(defaultValue: false, description:
53-
'Run additional distribution tests on RowVectors (takes 5x as long)',
54-
name: 'withRowVector')
50+
string(defaultValue: '', name: 'cmdstan_pr', description: 'PR to test CmdStan upstream against e.g. PR-630')
51+
string(defaultValue: '', name: 'stan_pr', description: 'PR to test Stan upstream against e.g. PR-630')
52+
booleanParam(defaultValue: false, name: 'withRowVector', description: 'Run additional distribution tests on RowVectors (takes 5x as long)')
53+
booleanParam(defaultValue: false, name: 'gpu_async', description: 'Run the OpenCL tests on both a sync (AMD) GPU and an async (NVIDIA) one.')
5554
}
5655
options {
5756
skipDefaultCheckout()
@@ -150,13 +149,21 @@ pipeline {
150149
stage('Verify changes') {
151150
agent { label 'linux' }
152151
steps {
153-
script {
152+
script {
154153

155154
retry(3) { checkout scm }
156155
sh 'git clean -xffd'
157156

158157
def paths = ['stan', 'make', 'lib', 'test', 'runTests.py', 'runChecks.py', 'makefile', 'Jenkinsfile', '.clang-format'].join(" ")
159158
skipRemainingStages = utils.verifyChanges(paths)
159+
160+
if(!utils.verifyChanges(["stan/math/opencl", "test/unit/math/opencl"].join(" ")) || params.gpu_async){
161+
runGpuAsync = true
162+
openClGpuLabel = "gpu-no-async"
163+
}
164+
else{
165+
runGpuAsync = false
166+
}
160167
}
161168
}
162169
}
@@ -175,15 +182,29 @@ pipeline {
175182
}
176183
post { always { deleteDir() } }
177184
}
178-
stage('Linux Unit with MPI') {
179-
agent { label 'linux && mpi' }
185+
stage('Full Unit Tests') {
186+
agent any
187+
when {
188+
expression {
189+
!skipRemainingStages
190+
}
191+
}
180192
steps {
181-
deleteDir()
182-
unstash 'MathSetup'
183-
sh "echo CXX=${MPICXX} >> make/local"
184-
sh "echo CXX_TYPE=gcc >> make/local"
185-
sh "echo STAN_MPI=true >> make/local"
186-
runTests("test/unit")
193+
script {
194+
if (isUnix()) {
195+
deleteDir()
196+
unstash 'MathSetup'
197+
runTests("test/unit/math/prim")
198+
runTests("test/unit/math/rev")
199+
runTests("test/unit")
200+
} else {
201+
deleteDirWin()
202+
unstash 'MathSetup'
203+
runTestsWin("test/unit/math/prim")
204+
runTestsWin("test/unit/math/rev")
205+
runTestsWin("test/unit")
206+
}
207+
}
187208
}
188209
post { always { retry(3) { deleteDir() } } }
189210
}
@@ -194,8 +215,21 @@ pipeline {
194215
}
195216
}
196217
parallel {
197-
stage('Full unit with GPU') {
198-
agent { label "gpu" }
218+
stage('MPI tests') {
219+
agent { label 'linux && mpi' }
220+
steps {
221+
deleteDir()
222+
unstash 'MathSetup'
223+
sh "echo CXX=${MPICXX} >> make/local"
224+
sh "echo CXX_TYPE=gcc >> make/local"
225+
sh "echo STAN_MPI=true >> make/local"
226+
runTests("test/unit/math/prim/functor")
227+
runTests("test/unit/math/rev/functor")
228+
}
229+
post { always { retry(3) { deleteDir() } } }
230+
}
231+
stage('OpenCL tests') {
232+
agent { label openClGpuLabel }
199233
steps {
200234
deleteDir()
201235
unstash 'MathSetup'
@@ -204,7 +238,38 @@ pipeline {
204238
sh "echo OPENCL_PLATFORM_ID=0>> make/local"
205239
sh "echo OPENCL_DEVICE_ID=${OPENCL_DEVICE_ID}>> make/local"
206240
sh "make -j${env.PARALLEL} test-headers"
207-
runTests("test/unit")
241+
runTests("test/unit/math/opencl")
242+
runTests("test/unit/math/prim/fun/gp_exp_quad_cov_test")
243+
runTests("test/unit/math/prim/fun/mdivide_left_tri_test")
244+
runTests("test/unit/math/prim/fun/mdivide_right_tri_test")
245+
runTests("test/unit/math/prim/fun/multiply_test")
246+
runTests("test/unit/math/rev/fun/mdivide_left_tri_test")
247+
runTests("test/unit/math/rev/fun/multiply_test")
248+
}
249+
post { always { retry(3) { deleteDir() } } }
250+
}
251+
stage('OpenCL tests async') {
252+
agent { label "gpu-async" }
253+
when {
254+
expression {
255+
runGpuAsync
256+
}
257+
}
258+
steps {
259+
deleteDir()
260+
unstash 'MathSetup'
261+
sh "echo CXX=${env.CXX} -Werror > make/local"
262+
sh "echo STAN_OPENCL=true>> make/local"
263+
sh "echo OPENCL_PLATFORM_ID=0>> make/local"
264+
sh "echo OPENCL_DEVICE_ID=${OPENCL_DEVICE_ID}>> make/local"
265+
sh "make -j${env.PARALLEL} test-headers"
266+
runTests("test/unit/math/opencl")
267+
runTests("test/unit/math/prim/fun/gp_exp_quad_cov_test")
268+
runTests("test/unit/math/prim/fun/mdivide_left_tri_test")
269+
runTests("test/unit/math/prim/fun/mdivide_right_tri_test")
270+
runTests("test/unit/math/prim/fun/multiply_test")
271+
runTests("test/unit/math/rev/fun/mdivide_left_tri_test")
272+
runTests("test/unit/math/rev/fun/multiply_test")
208273
}
209274
post { always { retry(3) { deleteDir() } } }
210275
}
@@ -238,13 +303,28 @@ pipeline {
238303
stage('Threading tests') {
239304
agent any
240305
steps {
241-
deleteDir()
242-
unstash 'MathSetup'
243-
sh "echo CXX=${env.CXX} -Werror > make/local"
244-
sh "echo CPPFLAGS+=-DSTAN_THREADS >> make/local"
245-
runTests("test/unit -f thread")
246-
sh "find . -name *_test.xml | xargs rm"
247-
runTests("test/unit -f map_rect")
306+
script {
307+
if (isUnix()) {
308+
deleteDir()
309+
unstash 'MathSetup'
310+
sh "echo CXX=${env.CXX} -Werror > make/local"
311+
sh "echo CPPFLAGS+=-DSTAN_THREADS >> make/local"
312+
sh "export STAN_NUM_THREADS=4"
313+
runTests("test/unit -f thread")
314+
sh "find . -name *_test.xml | xargs rm"
315+
runTests("test/unit -f map_rect")
316+
sh "find . -name *_test.xml | xargs rm"
317+
runTests("test/unit -f reduce_sum")
318+
} else {
319+
deleteDirWin()
320+
unstash 'MathSetup'
321+
bat "echo CXX=${env.CXX} -Werror > make/local"
322+
bat "echo CXXFLAGS+=-DSTAN_THREADS >> make/local"
323+
runTestsWin("test/unit -f thread", false)
324+
runTestsWin("test/unit -f map_rect", false)
325+
runTestsWin("test/unit -f reduce_sum", false)
326+
}
327+
}
248328
}
249329
post { always { retry(3) { deleteDir() } } }
250330
}
@@ -258,21 +338,10 @@ pipeline {
258338
runTestsWin("test/unit", false)
259339
}
260340
}
261-
stage('Windows Threading') {
262-
agent { label 'windows' }
263-
steps {
264-
deleteDirWin()
265-
unstash 'MathSetup'
266-
bat "echo CXX=${env.CXX} -Werror > make/local"
267-
bat "echo CXXFLAGS+=-DSTAN_THREADS >> make/local"
268-
runTestsWin("test/unit -f thread")
269-
runTestsWin("test/unit -f map_rect")
270-
}
271-
}
272341
}
273342
}
274343
stage('Additional merge tests') {
275-
when {
344+
when {
276345
allOf {
277346
anyOf {
278347
branch 'develop'
@@ -309,12 +378,12 @@ pipeline {
309378
}
310379
}
311380
stage('Upstream tests') {
312-
when {
381+
when {
313382
allOf {
314-
expression {
315-
env.BRANCH_NAME ==~ /PR-\d+/
383+
expression {
384+
env.BRANCH_NAME ==~ /PR-\d+/
316385
}
317-
expression {
386+
expression {
318387
!skipRemainingStages
319388
}
320389
}

0 commit comments

Comments
 (0)