cmdstanr icon indicating copy to clipboard operation
cmdstanr copied to clipboard

WSL - Run `cmdstan` and models under WSL filesystem

Open andrjohns opened this issue 3 years ago • 2 comments

Submission Checklist

  • [x] Run unit tests
  • [x] Declare copyright holder and agree to license (see below)

Summary

This PR refactors the WSL functionality introduced in #677 so that cmdstan is built and stored within the WSL installation, and the model execution occurs exclusively within the WSL installation as well.

This is possible due to functionality for accessing the WSL filesystem from Windows via the //wsl$/ network path. This allows for cmdstanr to execute models through WSL, and then access the generated .csv files from the windows session. This is also reflected in the cmdstan path, for example:

> library(cmdstanr)
This is cmdstanr version 0.5.3
- CmdStanR documentation and vignettes: mc-stan.org/cmdstanr
- CmdStan path: //wsl$/Ubuntu-22.04/home/andrew/.cmdstan/cmdstan-2.30.1
- CmdStan version: 2.30.1

My anecdotal experience so far is a noticeable decrease in both cmdstan installation time, as well as model compilation time

Copyright and Licensing

Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company): Andrew Johnson

By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:

  • Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
  • Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

andrjohns avatar Aug 25 '22 08:08 andrjohns

Codecov Report

Merging #696 (71c0ea7) into master (53084da) will decrease coverage by 2.11%. The diff coverage is 35.52%.

@@            Coverage Diff             @@
##           master     #696      +/-   ##
==========================================
- Coverage   90.56%   88.44%   -2.12%     
==========================================
  Files          12       12              
  Lines        3890     4017     +127     
==========================================
+ Hits         3523     3553      +30     
- Misses        367      464      +97     
Impacted Files Coverage Δ
R/run.R 94.54% <16.66%> (-0.74%) :arrow_down:
R/utils.R 73.52% <18.33%> (-13.35%) :arrow_down:
R/model.R 90.62% <43.75%> (-1.12%) :arrow_down:
R/fit.R 97.43% <50.00%> (-0.75%) :arrow_down:
R/install.R 62.01% <50.00%> (-0.93%) :arrow_down:
R/path.R 76.82% <59.45%> (+5.77%) :arrow_up:
R/args.R 97.92% <69.23%> (-0.75%) :arrow_down:
R/csv.R 97.66% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov-commenter avatar Aug 26 '22 16:08 codecov-commenter

Closing to run workflows in my own fork

andrjohns avatar Oct 24 '22 11:10 andrjohns

Thanks Andrew! Will do another release this week, hopefully with some other minor features.

rok-cesnovar avatar Oct 29 '22 06:10 rok-cesnovar

Great! I've just got one more PR to fix the WSL CI tests hanging, will have that in a couple days

andrjohns avatar Oct 29 '22 08:10 andrjohns