Skip to content

Instantly share code, notes, and snippets.

@SteveBronder
Last active October 18, 2019 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SteveBronder/8a3fe3b5ea1b71eb192f9e3053afa333 to your computer and use it in GitHub Desktop.
Save SteveBronder/8a3fe3b5ea1b71eb192f9e3053afa333 to your computer and use it in GitHub Desktop.
library(gh)
library(data.table)
# Cycles through the PR pages grabbing useful info
all_prs = list()[30 * 12]
stan_math_prs = list()[30 * 12]
for (i in 1:12) {
stan_math_prs[[i]] = gh("GET https://api.github.com/repos/stan-dev/math/pulls?state=closed", type = "public", page = i)
}
for (i in 1:12) {
all_prs[[i]] = lapply(stan_math_prs[[i]], function(x) {
if (is.null(x$merged_at)) {
merged_date = NA
} else {
merged_date = x$merged_at
}
return(data.table(closed_date = x$closed_at, merged_date = merged_date, branch = x$head$ref,
title = x$title, user = x$user$login,
pr_url = x$html_url, user_url = x$user$html_url, pr_number = x$number))
})
}
all_pr_dt = rbindlist(lapply(all_prs, rbindlist))
release_pr_dt = all_pr_dt[merged_date > "2019-07-18"]
## Attempts to label fix or feature
release_pr_dt[grepl("bug", branch), type := "fix"]
release_pr_dt[grepl("fix", branch), type := "fix"]
release_pr_dt[grepl("clang", branch), type := "fix"]
release_pr_dt[grepl("cleanup", branch), type := "fix"]
release_pr_dt[grepl("refactor", branch), type := "fix"]
release_pr_dt[grepl("opencl", branch), type := "fix"]
release_pr_dt[grepl("matrix_cl", branch), type := "fix"]
release_pr_dt[grepl("test", branch), type := "fix"]
release_pr_dt[grepl("feature", branch), type := "feature"]
release_pr_dt[grepl("Feature", title), type := "feature"]
release_pr_dt[grepl("gpu", tolower(branch)), type := "feature"]
release_pr_dt[grepl("cpu", tolower(branch)), type := "feature"]
release_pr_dt[is.na(type)]
release_pr_dt[, pr_url := paste0("(", pr_url, ")")]
release_pr_dt[, user_url := paste0("(", user_url, ")")]
release_pr_dt[, user := paste0("[", user, "]")]
release_pr_dt[, pr_number := paste0("[#", pr_number, "]")]
# This was reverted
release_pr_dt = release_pr_dt[title != "implement GPU caching"]
release_pr_dt = release_pr_dt[!grepl("Revert", title)]
# Make the graphs
release_table = release_pr_dt[, .(type = type, Contributor = paste0(user, user_url, " : (", pr_number, pr_url, ")"), Title = title)]
feature_table = release_table[type == "feature"]
fix_table = release_table[type == "fix"]
feature_table[, type := NULL]
fix_table[, type := NULL]
knitr::kable(feature_table)
knitr::kable(fix_table)
rbindlist(all_prs[[1]])
all_prs[[1]][1]
all_prs[[1]][20]

Quite a lot happened in this release!

Features

PR #1180 brought the Intel TBB into Stan as a dependency, which we will be using in the future for CPU parallelism all across Stan! The TBB is an excellent framework that will let Stan utilize nested parallelism across the algorithms and gradient evaluations. The licensing for the Intel TBB library is under the Apache 2.0 license. This dependency implies an additional restriction as compared to the new BSD license alone. The Apache 2.0 license is incompatible with GPL-2 licensed code if the software if distributing the software as a unitary binary. Refer to the Apache 2.0 evaluation page on the Stan Math wiki.

With @t4c1's large contributions, we now have GPU/OpenCL support for many of our glm functions! @rok-cesnovar added an OpenCL reverse mode specialization for multiplication and mdivide_left_tri while @t4c1 added the OpenCL specialization for gp_exp_quad_cov.

Some other nice features include @andrjohns vectorizing the Dirichlet distribution, @IvanYashchuk implementing a reverse mode specialization for inverse, and @yizhang-yiz with @charlesm93 adding fixed point algebra solvers based on Sundial's KINSOL scheme.

Internally, @bob-carpenter added a new AD testing framework, which both replaced 18,539 of code with 2,500 and simultaneously increased our test coverage! @Stevebronder added a type traits metaprogramming scheme so that we can make use of more generic templating in a lot of our code. Last but not least, @andrjohns standardized a lot of our code to use standard library functions instead of our hand-rolled methods.

Fixes

@wds15 patched the way we use lgamma so that it's faster in concurrent settings. A speedy patch came in from @t4c1 when @jgabry reported intercept only glm specializations with size zero matrices could give the wrong output. We had several patches and code cleanups in the OpenCL code, mostly testing and improving the type trait system around the OpenCL methods. @nhuurre patched log_sum_exp and log_diff_exp so that the methods respected boundary conditions a bit better. Stan also now uses clang-tidy, which gives us an automated way to keep the code base standardized.

Features List

Contributor Title
bob-carpenter : (#1384) Feature/1382 remove fvar nan checks
wds15 : (#1376) integrate Intel TBB
yizhang-yiz : (#1371) Feature fp solver
t4c1 : (#1366) Gpu ordered_logistic_glm_lpmf and categorical_logit_glm_lpmf
t4c1 : (#1365) Gpu neg_binomial_2_log_glm
andrjohns : (#1363) Issue 1362 - Vectorised Dirichlet distribution
rok-cesnovar : (#1355) Feature/issue 1354 Implement matrix_cl overloads for rep_vector, rep_row_vector and rep_matrix
rok-cesnovar : (#1353) Revert GPU caching
t4c1 : (#1350) Gpu poisson bernoulli glms
SteveBronder : (#1344) Adds require_* template type traits
charlesm93 : (#1339) Feature/issue 1115 newton solver
IvanYashchuk : (#1334) Implemented reverse mode for inverse
t4c1 : (#1333) Implement normal_id_glm_lpdf in OpenCL
rok-cesnovar : (#1329) Feature/Issue 1294 Rewrite the test-math-dependencies script in Python
SteveBronder : (#1323) Adds const ref and ref returns for to_var/fvar methods
andrjohns : (#1318) Issue 1010 - Replace hand-coded math with standard library c++11 functions
rok-cesnovar : (#1303) Feature/issue 1221 Use OpenCL in rev/mdivide_left_tri
andrjohns : (#1296) issue 1279 - Remove deprecated Eigen content from math headers
t4c1 : (#1293) OpenCL matrix multiplication optimizations
andrjohns : (#1283) Refactor rev/mat with eigen plugin methods
SteveBronder : (#1281) Add a double template to matrix_cl
bob-carpenter : (#1262) Feature/1258 ad test core
t4c1 : (#1252) Implement ordinal regression GLM (ordered_logistic_glm_lpmf)
t4c1 : (#1206) opencl prim gp_exp_quad_cov
rok-cesnovar : (#1305) Feature/issue 1221 Use OpenCL in rev/multiply
rok-cesnovar : (#1278) Feature/1221 OpenCL primitive multiply
t4c1 : (#1299) mdivide_right_tri can use OpenCL
wds15 : (#1180) Feature/intel tbb lib

Fixes

Contributor Title
wds15 : (#1401) Bugfix/tbb cleanup
t4c1 : (#1399) bugfix intercept only GLMs
wds15 : (#1395) allow spaces in path leading to stan-directory in makefiles
SteveBronder : (#1392) Add /lib/tbb/** to the .gitignore
rok-cesnovar : (#1375) Fix bug in stack_alloc_test
rok-cesnovar : (#1369) Bugfix/remove unused vectorize test
rok-cesnovar : (#1364) Reorganize /opencl and add missing matrix_cl overloads
rok-cesnovar : (#1361) Remove const qualifier from matrix_cl rows & cols
t4c1 : (#1358) Split opencl glm function
SteveBronder : (#1356) Bugfix for making matrix_cls from temporaries
SteveBronder : (#1341) Refactor Type Traits
SteveBronder : (#1340) Refactor/clang tidy cleanup
SteveBronder : (#1337) Update OpenCL Headers
SteveBronder : (#1331) Moves if statements for scal/prob/beta-binomial out of for loops
rok-cesnovar : (#1330) Remove EXPECT_DEATH unit tests that fail when -NDEBUG is set
SteveBronder : (#1327) Adds clang-tidy to makefile
t4c1 : (#1314) fix matrix_cl_view test
t4c1 : (#1311) Fixed matrix_cl copying and moving
rok-cesnovar : (#1310) Cleanup/issue #1301 remove unnecessary Boost and other compiler flags
rok-cesnovar : (#1304) Re-apply #1278 OpenCL prim multiply
SteveBronder : (#1298) make key of map for opencl kernel options into a string
SteveBronder : (#1291) Changes all prim files to use *_return_type_t instead of typename *_return_type
nhuurre : (#1290) Bugfix/646 log_sum_exp and log_diff_exp boundaries
SteveBronder : (#1289) Refactor for enable_if functions
SteveBronder : (#1286) Removes extra loops in Jacobian calculations
t4c1 : (#1266) Added triangularity attribute to matrix_cl
t4c1 : (#1261) GLM tests improvements
wds15 : (#1255) Bugfix/issue 1250 lgamma
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment