Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 4 new OpenCL device functions #2176

Merged
merged 14 commits into from
Nov 12, 2020
Merged

Conversation

t4c1
Copy link
Contributor

@t4c1 t4c1 commented Oct 30, 2020

Summary

Adds new device functions: lgamma_stirling, lgamma_stirling_diff, lbeta and binomial_coefficient_log. All these are based on existing C++ implementations in Stan Math.

Tests

New device functions are tested.

Side Effects

None.

Release notes

Added 4 new OpenCL device functions: lgamma_stirling, lgamma_stirling_diff, lbeta and binomial_coefficient_log.

Checklist

  • Math issue Add OpenCL distributions #2152

  • Copyright holder: Tadej Ciglarič

    The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
    - Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
    - Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

  • the basic tests are passing

    • unit tests pass (to run, use: ./runTests.py test/unit)
    • header checks pass, (make test-headers)
    • dependencies checks pass, (make test-math-dependencies)
    • docs build, (make doxygen)
    • code passes the built in C++ standards checks (make cpplint)
  • the code is written in idiomatic C++ and changes are documented in the doxygen

  • the new changes are tested

@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
gp_pois_regr/gp_pois_regr.stan 3.11 3.09 1.01 0.65% faster
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 0.91 -9.7% slower
eight_schools/eight_schools.stan 0.12 0.12 1.0 0.36% faster
gp_regr/gp_regr.stan 0.17 0.17 1.0 -0.17% slower
irt_2pl/irt_2pl.stan 5.73 5.68 1.01 0.89% faster
performance.compilation 90.9 88.2 1.03 2.97% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 8.47 8.46 1.0 0.03% faster
pkpd/one_comp_mm_elim_abs.stan 28.64 30.24 0.95 -5.61% slower
sir/sir.stan 131.99 127.22 1.04 3.62% faster
gp_regr/gen_gp_data.stan 0.05 0.04 1.04 3.74% faster
low_dim_gauss_mix/low_dim_gauss_mix.stan 2.96 2.98 0.99 -0.67% slower
pkpd/sim_one_comp_mm_elim_abs.stan 0.39 0.38 1.0 0.09% faster
arK/arK.stan 1.82 1.8 1.01 1.35% faster
arma/arma.stan 0.7 0.7 0.99 -1.09% slower
garch/garch.stan 0.68 0.67 1.0 0.25% faster
Mean result: 0.998858454267

Jenkins Console Log
Blue Ocean
Commit hash: b3c0307


Machine information ProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010

CPU:
Intel(R) Xeon(R) CPU E5-1680 v2 @ 3.00GHz

G++:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

Clang:
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

@t4c1 t4c1 force-pushed the lbeta_device_functions branch from f849861 to 8f92188 Compare November 3, 2020 16:54
@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
gp_pois_regr/gp_pois_regr.stan 3.13 3.1 1.01 0.75% faster
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 0.98 -2.21% slower
eight_schools/eight_schools.stan 0.12 0.12 1.01 0.69% faster
gp_regr/gp_regr.stan 0.17 0.17 0.99 -1.21% slower
irt_2pl/irt_2pl.stan 5.69 5.62 1.01 1.3% faster
performance.compilation 91.19 88.26 1.03 3.22% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 8.49 8.46 1.0 0.32% faster
pkpd/one_comp_mm_elim_abs.stan 29.57 29.67 1.0 -0.32% slower
sir/sir.stan 143.95 144.3 1.0 -0.25% slower
gp_regr/gen_gp_data.stan 0.05 0.04 1.02 2.39% faster
low_dim_gauss_mix/low_dim_gauss_mix.stan 2.98 2.97 1.0 0.31% faster
pkpd/sim_one_comp_mm_elim_abs.stan 0.38 0.39 0.97 -3.52% slower
arK/arK.stan 1.79 1.81 0.99 -1.4% slower
arma/arma.stan 0.61 0.6 1.01 1.18% faster
garch/garch.stan 0.75 0.75 0.99 -0.72% slower
Mean result: 1.00062750827

Jenkins Console Log
Blue Ocean
Commit hash: 8f92188


Machine information ProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010

CPU:
Intel(R) Xeon(R) CPU E5-1680 v2 @ 3.00GHz

G++:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

Clang:
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

@rok-cesnovar rok-cesnovar self-requested a review November 4, 2020 10:16
Copy link
Member

@rok-cesnovar rok-cesnovar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to uncomment Jenkinsfile changes and then this is good to go.

Jenkinsfile Outdated
// runTests("test/unit/math/rev/functor")
// }
// post { always { retry(3) { deleteDir() } } }
// }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be uncommented back.

@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
gp_pois_regr/gp_pois_regr.stan 3.04 3.07 0.99 -0.95% slower
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 0.95 -4.9% slower
eight_schools/eight_schools.stan 0.12 0.11 1.02 2.27% faster
gp_regr/gp_regr.stan 0.17 0.17 1.0 0.48% faster
irt_2pl/irt_2pl.stan 5.69 5.76 0.99 -1.19% slower
performance.compilation 87.75 85.17 1.03 2.95% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 8.47 8.5 1.0 -0.32% slower
pkpd/one_comp_mm_elim_abs.stan 30.25 29.66 1.02 1.95% faster
sir/sir.stan 135.86 137.53 0.99 -1.23% slower
gp_regr/gen_gp_data.stan 0.04 0.04 1.0 0.14% faster
low_dim_gauss_mix/low_dim_gauss_mix.stan 2.97 2.98 1.0 -0.19% slower
pkpd/sim_one_comp_mm_elim_abs.stan 0.37 0.38 0.98 -1.86% slower
arK/arK.stan 1.77 1.76 1.0 0.15% faster
arma/arma.stan 0.6 0.61 0.99 -0.51% slower
garch/garch.stan 0.74 0.75 0.98 -1.53% slower
Mean result: 0.997181407867

Jenkins Console Log
Blue Ocean
Commit hash: 7b4a83b


Machine information ProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010

CPU:
Intel(R) Xeon(R) CPU E5-1680 v2 @ 3.00GHz

G++:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

Clang:
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

@rok-cesnovar rok-cesnovar merged commit 8225e27 into develop Nov 12, 2020
@rok-cesnovar rok-cesnovar deleted the lbeta_device_functions branch November 12, 2020 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants