-
Notifications
You must be signed in to change notification settings - Fork 6
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
Adding SugarScape IG (polars with loops) #71
Adding SugarScape IG (polars with loops) #71
Conversation
… 65-sugarscape-instantaneous-growback-polars-with-loops
Codecov ReportAll modified and coverable lines are covered by tests ✅ |
Can I take a look at the current pandas result? |
Sorry, been working on API docs. Tomorrow I will send you the graphs. |
These are current timings Execution times:
---------------
mesa:
Number of agents: 1, Time: 0.00 seconds
Number of agents: 10001, Time: 6.00 seconds
Number of agents: 20001, Time: 12.42 seconds
Number of agents: 30001, Time: 19.06 seconds
Number of agents: 40001, Time: 26.48 seconds
Number of agents: 50001, Time: 33.85 seconds
---------------
---------------
mesa-frames (pd concise):
Number of agents: 1, Time: 0.09 seconds
Number of agents: 10001, Time: 15.23 seconds
Number of agents: 20001, Time: 29.51 seconds
Number of agents: 30001, Time: 45.61 seconds
Number of agents: 40001, Time: 59.79 seconds
Number of agents: 50001, Time: 79.37 seconds
---------------
---------------
mesa-frames (pl concise):
Number of agents: 1, Time: 0.51 seconds
Number of agents: 10001, Time: 2.28 seconds
Number of agents: 20001, Time: 2.92 seconds
Number of agents: 30001, Time: 3.56 seconds
Number of agents: 40001, Time: 4.23 seconds
Number of agents: 50001, Time: 5.31 seconds
--------------- Most of pandas' time is spent on merge operations. Profiling information on speed and memory usage here
|
UPDATE:
|
Will the refactoring complicate the implementation, or is it mainly replacing the ops to the ones supported by Dask/Dask-cuDF? |
Just a matter of implementing operations with DaskMixin, implementation should stay the same. |
I will merge this PR and open a dedicate issue for Pandas speedup (and DaskMixin). |
… 65-sugarscape-instantaneous-growback-polars-with-loops
This PR adds the Sugarscape IG implementation with AgentSetPolars and GridPolars.
@rht: Sorry but I made a mistake with the last performance plot. It measured allocation/setup but not the actual running of the model. The good news is that mesa-frames with Polars still scales better than native Python, as can be seen from the plot, though not as well as flame2gpu (with the CPU implementation, that is - it simply doesn't scale as well).
The implementation can still be made faster with some simple tweaks (e.g., lazy query and GridPolars implementation with pl.ranges), but I think there's not much time to optimize it further before GSoC ends.
The bad news is that pandas scales horribly, and this probably has to do with DFs being the size of RAM or larger (I am doing some profiling right now to understand), which pandas really struggles to handle. I am thinking of a solution (e.g., using Dask, which should have the same API), but I will keep you posted.