- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Rmath broken #8874
Comments
cc: @rfourquet |
I believe this is because Rmath is using the dSFMT's global RNG and that is no longer being initialized. Initializing the global RNG will solve the immediate problem, but we should try to get rid of using Rmath's RNGs during the course of the 0.4 release. Will get to doing this in the next few hours unless @rfourquet or someone else beats me to it. |
is this because Rmath has an evil license? |
I'm going to not have time to look at this for the next few days. |
Can't we just use the quantile function of all the distributions where we haven't implemented our own |
@andreasnoack Generating a random number can be much more efficient than computing quantile. Using quantile is just a fallback when you have no other ways. |
We are developing our own samplers, but at this point some important distributions still rely on Rmath. |
I know. It was only meant as a temporary fix until we have our own implementations. I don't think that it is likely that Rmath get synced with the global RNG again. |
Why don't we take this as an opportunity to get rid of Rmath from Base julia? From what I can tell, we would need:
|
I think that is a good idea. Du you have a place where the missing RNGs are tracked? |
Is there a replacement for the incomplete beta function in Rmath? Getting a version of the incomplete beta that is comparable in coverage and accuracy to the one in Rmath has always been a roadblock to removal of Rmath. |
Grepping for _jl_dist in src/univariate produces
Those all need to be replaced before Rmath can be removed. |
I think the plan is to keep Rmath as a dependency because of the special functions. The important step now is to get rid of the dependence of the RNGs as they cannot be synced with the global state anymore. That should be much easier than matching the special functions. |
@davidavdav We want to move away from Rmath to have a pure julia implementation that is more flexible to work with, and also avoids using GPL for a foundational library. |
The reason Rmath is included in Base is just for convenience, so that Distributions works out of the box for people coming to Julia from R, sort of a good first date expereince. We can make the BinDeps process smooth, but it will still end up turning people away. We certainly don't want to ship Rmath in 0.4. If we don't use the Rmath RNGs, then we no longer need the forked version either, and can use the stock version that ships on linux distros, etc. |
@ViralBShah seems like the RNG issue is the only reason for privileging Distributions over any other package with binary dependencies. (If github stars are still our best proxy for usage, there are several other packages more popular than Distributions that have to rely on BinDeps right now.) If the RNG's are going to be decoupled so Rmath can be used with fewer modifications relative to upstream, seems it might be time to revisit its bundling with base. |
Originally, we started with some of this stuff in Base. Then we got packages and distributions moved there. Rmath stayed mainly because it linked with our dSFMT and its RNGs used the same stream of random numbers as Julia. So, there is a little bit of history in having started out in Base. Other packages did not have this legacy. Now that the tight linkages are no longer there, it is perfectly reasonable to stop bundling it in base. I am happy to stop doing that as soon as we have a decent BinDeps version and binaries wherever possible. I do think we should have a julia distribution that includes lots of packages with their binary dependencies with documentation and tests, but that is a separate project altogether. |
I can help with BinDeps, writing a WinRPM spec file, etc. Is Distributions.jl ready to use unpatched rmath? That would be a bit easier as far as using distribution binaries goes, and getting the opensuse maintainers to agree to the package request for WinRPM once it's ready.
Agreed. |
The thing is that unpatched Rmath has slow RNGs. But it can definitely be used as is. |
We can go with the unlatched one since Distributions.jl will soon stop using the Rmath RNGs. |
We are working on gradually removing the use of Rmath in Distributions.jl, one function/distribution at a time. It is going to take quite a while. Before that we wish Rmath stays as it is. |
Isn't moving moving Rmath to a package-specific binary dependency a natural step in that direction? |
IIUC, the problem is that, from a new Rmath.jl Julia package, it would be nicer to use a pre-built Rmath using BinDeps so that people don't need to compile it when they installed Julia from binaries (so that they don't need a C compiler, etc.). But for that it shouldn't use a custom Rmath, which isn't available as a package in distributions, and wouldn't be easily accepted by OpenSuSE/WinRPM maintainers (what @tkelman said). This is probably what @lindahua is worried about, since not using a custom Rmath would mean losing performance for random numbers generation. |
Yes. Though we could just put up a dll of our custom version somewhere if we need to, so it's not a hard requirement. |
With recent changes in Julia 0.4, Rmath is now broken:
For example, using Rmath to generate random numbers, we get:
Some important distributions in Distributions.jl are still relying on R-math for random number generations.
This is related: JuliaStats/Distributions.jl#293
cc: @simonbyrne, @ViralBShah
The text was updated successfully, but these errors were encountered: