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

Primitive implementation for serialization #258

Merged
merged 6 commits into from
Dec 12, 2024
Merged

Conversation

sunxd3
Copy link
Member

@sunxd3 sunxd3 commented Dec 11, 2024

#254

@miguelbiron pretty much what you suggested, but I added evaluation_env to the serialization just so that the deserialized model has the same values as the model before.

sunxd3 and others added 3 commits December 11, 2024 07:33
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@miguelbiron
Copy link
Collaborator

Awesome!!

@coveralls
Copy link

coveralls commented Dec 11, 2024

Pull Request Test Coverage Report for Build 12298872685

Details

  • 1 of 16 (6.25%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.5%) to 71.385%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/model.jl 0 15 0.0%
Totals Coverage Status
Change from base Build 12278854347: -0.5%
Covered Lines: 1402
Relevant Lines: 1964

💛 - Coveralls

@yebai yebai requested a review from penelopeysm December 11, 2024 19:32
Copy link
Member

@penelopeysm penelopeysm left a comment

Choose a reason for hiding this comment

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

Just a couple of small questions.

Project.toml Outdated Show resolved Hide resolved
test/model.jl Show resolved Hide resolved
sunxd3 and others added 3 commits December 12, 2024 06:41
Co-authored-by: Penelope Yong <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Contributor

Benchmark results on macOS (aarch64)

BridgeStan not found at location specified by $BRIDGESTAN environment variable, downloading version 2.5.0 to /Users/runner/.bridgestan/bridgestan-2.5.0
Done!
Model dogs produces error: ErrorException("log_density() failed with unknown exception\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.0834 7.68033 56.042 274.959
pumps 12 10 0.882576 1.38158 8.764 21.417
dogs 2 720 NA NA 138.562 256.541
seeds 26 21 2.14738 2.86578 24.375 56.0
surgical_realistic 14 12 1.19096 1.81769 19.125 29.958
magnesium 108 96 10.9165 12.125 118.042 205.917
salm 22 18 3.863 4.5 18.375 44.917
equiv 15 20 3.40113 4.2985 16.333 52.125
dyes 9 30 1.57021 2.08338 10.229 43.041
stacks 6 21 1.25 1.94643 18.5 48.625
epil 303 236 39.75 43.708 237.083 628.896
blockers 47 44 2.5 3.14062 46.5 81.208
oxford 244 240 11.292 13.75 269.312 461.605
lsat 1006 5000 109.875 158.833 1410.65 2941.02
bones 33 422 74.792 85.417 429.375 421.5
mice 20 65 6.729 8.5 22.125 82.0
kidney 64 58 8.611 11.8335 68.5 184.791
leuk 18 714 16.458 21.708 258.375 502.333
leukfr 40 714 23.5 29.084 279.209 621.958

Benchmark results on Ubuntu (x64)

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.5284 8.172 76.2125 85.229
pumps 12 10 1.00569 1.31064 12.0275 6.52975
dogs 2 720 NA NA 174.556 153.958
seeds 26 21 2.44283 3.08689 26.57 19.918
surgical_realistic 14 12 1.28152 1.60911 15.68 8.44233
magnesium 108 96 10.615 12.278 129.151 73.246
salm 22 18 2.36275 3.019 23.584 13.0545
equiv 15 20 2.52655 3.4765 20.398 15.249
dyes 9 30 0.997533 1.3425 12.6785 14.1815
stacks 6 21 1.16936 1.70082 23.253 16.411
epil 303 236 33.563 39.493 294.536 244.642
blockers 47 44 3.25833 3.72313 63.869 28.463
oxford 244 240 16.3955 19.036 366.074 171.255
lsat 1006 5000 181.879 222.666 1998.1 1199.84
bones 33 422 72.996 91.14 431.261 237.845
mice 20 65 7.33125 9.43433 30.026 39.042
kidney 64 58 10.956 16.371 69.26 69.771
leuk 18 714 21.29 26.991 209.561 195.425
leukfr 40 714 23.945 31.919 241.14 264.404

@miguelbiron
Copy link
Collaborator

Hey @sunxd3 -- Anything we can do on our end to help this PR get merged?

@sunxd3
Copy link
Member Author

sunxd3 commented Dec 12, 2024

Could you give it a quick review, I don't have things to add now, can merge!

@penelopeysm penelopeysm self-requested a review December 12, 2024 17:50
@sunxd3
Copy link
Member Author

sunxd3 commented Dec 12, 2024

Thanks Penny!

@miguelbiron
Copy link
Collaborator

LGTM!

@sunxd3 sunxd3 merged commit f51144c into master Dec 12, 2024
15 checks passed
@sunxd3 sunxd3 deleted the sunxd/serialization branch December 12, 2024 17:51
@miguelbiron
Copy link
Collaborator

Thanks everyone!

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