Closed patrick-kidger closed 3 years ago
Thanks, will try to think about this. I actually don't need the @inbounds
there at all, since that loop is quite slow. Let me delete that and maybe if it gives the bug again it will be more helpful.
Sounds good. If I'm running this from PySR, how should I install the updated SymbolicRegression.jl? I've not dug into how PySR manages its Julia dependencies.
You can use a local copy of SymbolicRegression.jl with the PySR argument: julia_project="../SymbolicRegression.jl"
to point to the root of the SymbolicRegression.jl repo. This lets you use the master branch copy! It's good for working on the backend but testing with the Python frontend.
Okay, looks like this is indeed a bounds error. A few of the arrays have (maxsize,) shape, so if an equation has too large a size, it will get a bounds error. The mutation functions are supposed to check whether or not the equation is too big, but it seems like the simplification (?) part is simplifying to a larger equation sometimes... Anyways I fixed this now! Will be in 0.5.3.
Also - I should add that the julia_project
can point to any environment, rather than just the SymbolicRegression.jl repo. As long as the Manifest.toml file points to the right SymbolicRegression.jl version, it should be good to go with a local copy.
Closing this, let me know if this comes up again!
Whilst calling from PySR a segmentation fault is thrown.
The stack trace points to this line:
https://github.com/MilesCranmer/SymbolicRegression.jl/blob/c686d58175ecbc193c79a1d7a60f5aac3ece5931/src/SymbolicRegression.jl#L247
which is conspicuously marked
@inbounds
. So I'm suspecting, but cannot prove, that this is a bug in SymbolicRegression.jl. (Although in principle it could be a bug in Julia itself.)I don't have a lot more to offer than that, I'm afraid. Obviously this occurs nondeterministically, and it's only happened once so far, so I don't know if I can reproduce it.
pysr.pysr
called withalpha=0.2, procs=16, populations=100, niterations=100, loss="L1DistLoss()", binary_operators=["plus", "mult", "sub"], unary_operators=["cos", "exp", "sin"]