Comments (5)
Quick update: it seems like adding @inbounds
to the following loop:
@inbounds for i=1:npopulations
seems to help significantly. This is one difference with the Threads code - I declare @inbounds
at the start of this loop.
It seems as though Julia might have been checking for race conditions otherwise. Yet, I know that race conditions aren't possible in this section of the code, since the hall of fame update is only done by the head worker, so @inbounds
seems to help the compiler realize that.
This is essentially a 2-3x speedup!
Also: I need to add a proper benchmark test. I like numpy's tool https://asv.readthedocs.io/en/stable/ since it can be used to measure speed regressions across a commit history.
from pysr.
Seems like there are still significant speed reductions with a recent commit... See the cycles per second of travis build 39: https://travis-ci.com/github/MilesCranmer/PySR/builds/186862848, which gives 5.030e+04 cycles per second.
But the most recent travis build https://travis-ci.com/github/MilesCranmer/PySR/builds/187199749 gets 1.870e+04 cycles per second for what (I think) is the same test...
from pysr.
Very strange... maybe it's a missing @async
somewhere?
See diff in julia/sr.jl here: 121e6ac...master
from pysr.
Okay, fixed on master. Will push new pip version soon.
The issue was the nested recursive threading introduced in 3a578d2.
Reading this post: https://julialang.org/blog/2019/07/multithreading/, where they do this same nested recursive threading to compute Fibonnaci numbers, made me think that it could be used for all operations on binary trees in PySR. It is supposed to be fine with millions of threads, and threads calling threads calling threads...
But for whatever reason it seems to have hurt the performance a lot - perhaps it doesn't play nice with Distributed also being used.
from pysr.
Benchmarks on v0.3.X with 4-core runs have been added to the benchmarks/
folder. They are copied below:
Version | Cycles/second |
---|---|
v0.3.2 | 37526 |
v0.3.3 | 38400 |
v0.3.4 | 28700 |
v0.3.5 | 32700 |
v0.3.6 | 25900 |
v0.3.7 | 26600 |
v0.3.8 | 7470 |
v0.3.9 | 6760 |
v0.3.10 | |
v0.3.11 | 19500 |
v0.3.12 | 19000 |
v0.3.13 | 15200 |
v0.3.14 | 14700 |
v0.3.15 | 42000 |
So v0.3.15 has gotten rid of the speed regressions throughout v0.3.
from pysr.
Related Issues (20)
- [Feature]: Composite regressors
- [Feature]: Warn if better linear model available HOT 4
- [BUG]: Using dimensional constraints result in "UndefVarError: `k` not defined" error HOT 4
- Update Head Worker Occupation Warning HOT 3
- Command '['julia', '-e', '...']' returned non-zero exit status 1 HOT 2
- [BUG]: Encounter segmentation faults in running the toy example on RHEL machines HOT 14
- Windows Julia Install - could not load library "libpcre2-8" The specified module could not be found. HOT 19
- [BUG]: PyTorch module does not preserve dimensions of input tensor
- [Feature]: Recover up-to-date expression from exported PyTorch model (SingleSymPyModule)
- [Feature]: Select Julia version at first import.
- [Feature]: TensorBoard support
- Search-replace old code snippets with new syntax
- Error Running PySR with Julia in Windows 10 (Anaconda Environment)
- [BUG]: Can't pickle greater: attribute lookup greater on __main__ failed HOT 3
- [Feature] Should warn if populations < procs
- [BUG]: Compatibility Issue with Julia Version When Using PySR HOT 6
- [DOCS] Import sections of JuliaCall docs
- [Feature]: Warn user about low `niterations`
- [Feature]: Supplying initial guess to Symbolic Regression
- Prior of the model
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pysr.