parallel sampling by default in PyStan

151 views
Skip to first unread message

Allen Riddell

unread,
Sep 26, 2013, 9:17:30 AM9/26/13
to stan...@googlegroups.com
Hi everyone,

I was thinking about making the PyStan's sampling() do its work in parallel by
default (on as many cores as are available). Has this been discussed for RStan?
Are there good reasons not to do this?

Thanks,

-a

Jiqiang Guo

unread,
Sep 26, 2013, 10:27:29 AM9/26/13
to stan...@googlegroups.com

Not in rstan.  One reason is windows does not supply multiple processes as good as Unix-ish systems for R.  Then I would like to make the coding simple and leave it to users.

Jiqiang

--
You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Marcus Brubaker

unread,
Sep 26, 2013, 12:41:50 PM9/26/13
to stan...@googlegroups.com
I'd say if it's easy/plausible to do in PyStan, go for it.  I don't see a reason RStan and PyStan have to maintain feature parity and parallel sampling of chains would be a great feature to have.

Cheers,
Marcus

Bob Carpenter

unread,
Sep 26, 2013, 12:57:40 PM9/26/13
to stan...@googlegroups.com
Jiqiang brings up an important point. It should work across
platforms. But no reason it couldn't be parallel by default
on some platforms and serial on others. Or maybe Python has
a wrapper to make it easy to parallelize on Windows?

Daniel is going to put together a list of functions that
we're hoping all the interfaces to Stan can support. (That
would be command-line, R, Python, etc.)

- Bob


On 9/26/13 12:41 PM, Marcus Brubaker wrote:
> I'd say if it's easy/plausible to do in PyStan, go for it. I don't see a reason RStan and PyStan have to maintain
> feature parity and parallel sampling of chains would be a great feature to have.
>
> Cheers,
> Marcus
>
>
> On Thu, Sep 26, 2013 at 10:27 AM, Jiqiang Guo <guo...@gmail.com <mailto:guo...@gmail.com>> wrote:
>
> Not in rstan. One reason is windows does not supply multiple processes as good as Unix-ish systems for R. Then I
> would like to make the coding simple and leave it to users.
>
> Jiqiang
>
> On Sep 26, 2013 9:17 AM, "Allen Riddell" <a...@ariddell.org <mailto:a...@ariddell.org>> wrote:
>
> Hi everyone,
>
> I was thinking about making the PyStan's sampling() do its work in parallel by
> default (on as many cores as are available). Has this been discussed for RStan?
> Are there good reasons not to do this?
>
> Thanks,
>
> -a
>
> --
> You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> stan-dev+u...@googlegroups.com <mailto:stan-dev%2Bunsu...@googlegroups.com>.
> For more options, visit https://groups.google.com/groups/opt_out.
>
> --
> You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> stan-dev+u...@googlegroups.com <mailto:stan-dev%2Bunsu...@googlegroups.com>.

Ross Boylan

unread,
Sep 26, 2013, 4:07:07 PM9/26/13
to stan...@googlegroups.com, ro...@biostat.ucsf.edu
It's not stan-specific, but the standard R parallel library does not
use all available cores by default; it uses 2 (e.g., function
mclapply()). This can be overridden. Of course, if you only have 2,
that is all.

For my own use I didn't want to use all cores because a) I wanted to
leave some headroom for other tasks and b) hyperthreading makes it
appear I have more processors than I really do.

I don't know if such considerations went into the design of the
defaults for the parallel library.

Ross Boylan
Reply all
Reply to author
Forward
0 new messages