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

Further improve performance of logdensity evaluation #234

Merged
merged 9 commits into from
Nov 8, 2024

Conversation

sunxd3
Copy link
Member

@sunxd3 sunxd3 commented Nov 7, 2024

A source of type instability is the prepare_arg_values. This PR removes this function by modifying node functions to take evaluation_env directly and unpack within node functions, thus save the lookup and constructing keyword arguments step.

@coveralls
Copy link

coveralls commented Nov 7, 2024

Pull Request Test Coverage Report for Build 11730210167

Details

  • 58 of 66 (87.88%) changed or added relevant lines in 4 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.2%) to 75.054%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/model.jl 44 52 84.62%
Files with Coverage Reduction New Missed Lines %
src/model.jl 2 82.51%
Totals Coverage Status
Change from base Build 11651689911: -0.2%
Covered Lines: 1387
Relevant Lines: 1848

💛 - Coveralls

Copy link
Contributor

github-actions bot commented Nov 7, 2024

BridgeStan not found at location specified by $BRIDGESTAN environment variable, downloading version 2.5.0 to /home/runner/.bridgestan/bridgestan-2.5.0
Done!
Model dogs produces error: ErrorException("log_density() failed with exception: Exception: bernoulli_lpmf: Probability parameter is inf, but must be in the interval [0, 1] (in '/home/runner/work/JuliaBUGS.jl/JuliaBUGS.jl/benchmark/stan/bugs_examples/vol1/dogs/dogs.stan', line 37, column 6 to line 38, column 62)\n")

Model Parameter Count Data Count Stan Density Time (µs) Stan Density Gradient Time (µs) JuliaBUGS Density Time with Graph Walk (µs) JuliaBUGS Density Gradient Time with ReverseDiff.jl(compiled tape) (µs)
rats 65 150 5.4904 8.105 66.384 90.43
pumps 12 10 1.03514 1.343 11.151 6.239
dogs 2 720 NA NA 177.322 149.661
seeds 26 21 2.407 3.04244 27.261 19.306
surgical_realistic 14 12 1.26452 1.61972 15.129 8.526
magnesium 108 96 10.365 11.9575 126.788 88.491
salm 22 18 2.67227 3.29056 21.911 12.303
equiv 15 20 2.51109 3.41638 19.636 15.92
dyes 9 30 1.01046 1.33841 12.4485 12.924
stacks 6 21 1.12788 1.69432 22.663 14.607
epil 303 236 32.831 38.733 285.881 273.672
blockers 47 44 3.25156 3.71414 60.273 28.834
oxford 244 240 16.281 18.955 411.632 173.155
lsat 1006 5000 174.908 216.601 2025.34 1215.45
bones 33 422 72.877 90.169 427.904 191.95
mice 20 65 7.31125 9.40433 29.425 39.263
kidney 64 58 10.7045 16.19 69.149 69.77
leuk 18 714 20.489 26.69 208.556 196.849
leukfr 40 714 23.785 31.669 232.531 235.592

sunxd3 and others added 6 commits November 7, 2024 13:26
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@sunxd3 sunxd3 merged commit aaeed00 into master Nov 8, 2024
13 checks passed
@sunxd3 sunxd3 deleted the sunxd/perf_improv branch November 8, 2024 12:07
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.

2 participants