Skip to content

Conversation

@VisruthSK
Copy link
Member

@VisruthSK VisruthSK commented Dec 26, 2025

Fixes #1040 by offering the option to use the qs2 format which performed well in tests across model sizes.

@VisruthSK VisruthSK changed the title Add qs2 fast option for saving models objects Add qs2 option for saving models objects Dec 26, 2025
@VisruthSK VisruthSK marked this pull request as draft December 26, 2025 06:53
@VisruthSK VisruthSK changed the title Add qs2 option for saving models objects Add qs2 option for saving model objects Dec 26, 2025
@VisruthSK VisruthSK marked this pull request as ready for review December 30, 2025 17:16
@VisruthSK
Copy link
Member Author

VisruthSK commented Dec 30, 2025

Should be good once #1127 is merged.

@jgabry
Copy link
Member

jgabry commented Dec 30, 2025

Ok once #1127 is merged let's pull in those changes and then I can review this one. Looks like checks are passing for #1127 but a few haven't finished yet.

@codecov-commenter
Copy link

codecov-commenter commented Dec 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.28%. Comparing base (6606bc2) to head (1d4bb91).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1125      +/-   ##
==========================================
+ Coverage   87.14%   87.28%   +0.14%     
==========================================
  Files          14       14              
  Lines        5973     5955      -18     
==========================================
- Hits         5205     5198       -7     
+ Misses        768      757      -11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@VisruthSK VisruthSK requested a review from jgabry December 31, 2025 06:52
@jgabry
Copy link
Member

jgabry commented Dec 31, 2025

The code changes look great. I haven't had a chance to actually try it yet, but I'll do that sometime soon. I also still need to take a look at the vignette changes.

Comment on lines -506 to -518
Storage is even faster if you discard results you do not need to save.
The following example saves only posterior draws and discards
sampler diagnostics, user-specified initial values, and profiling data.

```{r save_object_qs_small, eval = FALSE}
# Load posterior draws into the fitted model object and omit other output.
fit$draws()
# Save the object to a file.
qs::qsave(x = fit, file = "fit.qs")
# Read the object.
fit2 <- qs::qread("fit.qs")
Copy link
Member

Choose a reason for hiding this comment

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

I realized that this section of the vignette was outdated even before your changes. This doesn't really work to omit other output anymore (unrelated to your changes).

I think people can either save the whole fit object or they can choose to just save the posterior draws themselves separate from the fit object if they want to avoid saving the other contents of the object.

So I kept your changes to the vignette that show how to use save_object with the new format, but I'm just going to delete this second section.

@jgabry
Copy link
Member

jgabry commented Jan 2, 2026

For reasons unrelated to the new qs2 format I deleted one section of the vignette (see comment above). I think this is ready to be merged now once it finishes running the checks again. Thanks @VisruthSK!

@jgabry
Copy link
Member

jgabry commented Jan 2, 2026

The failure on macOS-latest (release) is unrelated, so I'll go ahead and merge now. The two macOS ones have these intermittent failures on GHA with several of the install_cmdstan tests. Not even failures to install, just different console output than we're expecting.

@jgabry jgabry merged commit 9e9d513 into master Jan 2, 2026
17 of 19 checks passed
@jgabry jgabry deleted the use-qs2 branch January 2, 2026 21:14
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.

possibly speed up save_object

4 participants