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 6 and 8 argument overloads to wiener_lpdf #1411

Merged
merged 5 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,20 @@ def runPerformanceTests(String testsPath, String stancFlags = ""){
cd performance-tests-cmdstan/cmdstan
echo 'O=0' >> make/local
echo 'CXXFLAGS+=-Wall' >> make/local
make -j${env.PARALLEL} build; cd ..
./runPerformanceTests.py -j${env.PARALLEL} --runs=0 ${testsPath}
make -j${env.PARALLEL} build
"""

if (params.run_slow_perf_tests) {
sh """
cd performance-tests-cmdstan
./runPerformanceTests.py -j${env.PARALLEL} --runs=0 --no-ignore-models ${testsPath}
"""
} else {
sh """
cd performance-tests-cmdstan
./runPerformanceTests.py -j${env.PARALLEL} --runs=0 ${testsPath}
"""
}
}

def cleanCheckout() {
Expand All @@ -67,7 +78,7 @@ def cleanCheckout() {
userRemoteConfigs: scm.userRemoteConfigs,
])
}

sh 'git clean -xffd'
}

Expand All @@ -87,6 +98,7 @@ pipeline {
description: "Math PR to test against. Will check out this PR in the downstream Math repo.")
string(defaultValue: '', name: 'stanc_flags',
description: "Pass STANCFLAGS to make/local, default none")
booleanParam(name:"run_slow_perf_tests", defaultValue: false, description:"Run additional 'slow' performance tests")
string(defaultValue: '', name: 'build_multiarch_docker_tag', description: "Docker tag for the multiarch image")
}
options {
Expand Down
13 changes: 11 additions & 2 deletions src/middle/Stan_math_signatures.ml
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,11 @@ let distributions =
; (full_lpdf, "von_mises", [DVReal; DVReal; DVReal], SoA)
; (full_lpdf, "weibull", [DVReal; DVReal; DVReal], SoA)
; ([Lpdf], "wiener", [DVReal; DVReal; DVReal; DVReal; DVReal], SoA)
; ([Lpdf], "wishart_cholesky", [DMatrix; DReal; DMatrix], SoA)
; ([Lpdf], "wiener", [DReal; DReal; DReal; DReal; DReal; DReal], AoS)
; ( [Lpdf]
, "wiener"
, [DReal; DReal; DReal; DReal; DReal; DReal; DReal; DReal]
, AoS ); ([Lpdf], "wishart_cholesky", [DMatrix; DReal; DMatrix], SoA)
; ([Lpdf], "wishart", [DMatrix; DReal; DMatrix], SoA) ]

let basic_vectorized = UnaryVectorized IntsToReals
Expand Down Expand Up @@ -483,7 +487,12 @@ let pretty_print_all_math_sigs ppf () =

let pretty_print_all_math_distributions ppf () =
let open Fmt in
let pp_dist ppf (kinds, name, _, _) =
let distributions =
String.Map.of_alist_reduce
(List.map ~f:(fun (kinds, name, _, _) -> (name, kinds)) distributions)
~f:(fun v1 v2 -> v1 @ v2 |> Set.Poly.of_list |> Set.to_list)
|> Map.to_alist in
let pp_dist ppf (name, kinds) =
pf ppf "@[%s: %a@]" name
(list ~sep:comma Fmt.string)
(List.map ~f:(Fn.compose String.lowercase show_fkind) kinds) in
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions test/integration/signatures/stan_math_distributions.t
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Display all Stan math distributions exposed in the language
$ stanc --dump-stan-math-distributions
beta_binomial: lpmf, rng, ccdf, cdf
beta: lpdf, rng, ccdf, cdf
beta_proportion: lpdf, ccdf, cdf
bernoulli: lpmf, rng, ccdf, cdf
bernoulli_logit: lpmf, rng
bernoulli_logit_glm: lpmf
beta: lpdf, rng, ccdf, cdf
beta_binomial: lpmf, rng, ccdf, cdf
beta_proportion: lpdf, ccdf, cdf
binomial: lpmf, rng, ccdf, cdf
binomial_logit: lpmf
binomial_logit_glm: lpmf
Expand All @@ -28,8 +28,8 @@ Display all Stan math distributions exposed in the language
hypergeometric: lpmf, rng
inv_chi_square: lpdf, rng, ccdf, cdf
inv_gamma: lpdf, rng, ccdf, cdf
inv_wishart_cholesky: lpdf
inv_wishart: lpdf
inv_wishart_cholesky: lpdf
lkj_corr: lpdf
lkj_corr_cholesky: lpdf
lkj_cov: lpdf
Expand All @@ -38,13 +38,13 @@ Display all Stan math distributions exposed in the language
lognormal: lpdf, rng, ccdf, cdf
multi_gp: lpdf
multi_gp_cholesky: lpdf
multinomial: lpmf
multinomial_logit: lpmf
multi_normal: lpdf
multi_normal_cholesky: lpdf
multi_normal_prec: lpdf
multi_student_t: lpdf
multi_student_t_cholesky: lpdf
multinomial: lpmf
multinomial_logit: lpmf
neg_binomial: lpmf, rng, ccdf, cdf
neg_binomial_2: lpmf, rng, ccdf, cdf
neg_binomial_2_log: lpmf, rng
Expand All @@ -61,13 +61,13 @@ Display all Stan math distributions exposed in the language
poisson_log_glm: lpmf
rayleigh: lpdf, rng, ccdf, cdf
scaled_inv_chi_square: lpdf, rng, ccdf, cdf
skew_normal: lpdf, rng, ccdf, cdf
skew_double_exponential: lpdf, rng, ccdf, cdf
student_t: lpdf, rng, ccdf, cdf
skew_normal: lpdf, rng, ccdf, cdf
std_normal: lpdf, rng, ccdf, cdf
student_t: lpdf, rng, ccdf, cdf
uniform: lpdf, rng, ccdf, cdf
von_mises: lpdf, rng, ccdf, cdf
weibull: lpdf, rng, ccdf, cdf
wiener: lpdf
wishart_cholesky: lpdf
wishart: lpdf
wishart_cholesky: lpdf
2 changes: 2 additions & 0 deletions test/integration/signatures/stan_math_signatures.t
Original file line number Diff line number Diff line change
Expand Up @@ -20695,6 +20695,8 @@ Display all Stan math signatures exposed in the language
weibull_rng(array[] real, array[] int) => array[] real
weibull_rng(array[] real, array[] real) => array[] real
wiener_lpdf(real, real, real, real, real) => real
wiener_lpdf(real, real, real, real, real, real) => real
wiener_lpdf(real, real, real, real, real, real, real, real) => real
wiener_lpdf(real, real, real, real, vector) => real
wiener_lpdf(real, real, real, real, row_vector) => real
wiener_lpdf(real, real, real, real, array[] real) => real
Expand Down