Skip to content
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

Tracking issue: edge recording performance #2751

Open
3 tasks
molpopgen opened this issue May 8, 2023 · 0 comments
Open
3 tasks

Tracking issue: edge recording performance #2751

molpopgen opened this issue May 8, 2023 · 0 comments
Labels
C API Issue is about the C API

Comments

@molpopgen
Copy link
Member

molpopgen commented May 8, 2023

This issue tracks what needs to be done to eliminate the need to sort the edges associated with new births.
The method has been used in fwdpy11 for about 3 years.
(It is what I presented to one of the first online tskit meetings in 2020.)

By more carefully recording edges as they are born, we can eliminate the need to sort them.
This works for overlapping and non-overlapping generations.

A Python prototype is here.
Some of the necessary changes to the C API are here, implemented via hacks to the C API in tskit-rust.

We can shave many hours off of simulation time (see prototype link above for images). The method approaches the efficiency of simplifying via threads that I presented recently. The parallel method is enabled by #2665. The results in the notebook shown above get about 80% of the performance gains that I saw with threads, but with one core and less memory needed, thus pushing back the parameter space where methods like #2665 will be helpful.

TODO list:

  • Implement the modular simplifier. Importantly, the implementation used an opaque pointer approach to keep all the simplification guts private. Testing this is simple: we record edges to a second edge table that we then sort, then apply them to the new API. By "scrambling" these arrays correctly, we can trigger errors (non-contiguous processing of parents, etc.).
  • Implement a simple edge buffer in C. This will be based off of what has worked well in fwdpp. Again, opaque pointers will keep the guts private so that we can perhaps improve things later on.
  • Write a new variant of the example program that uses the efficient method.

Notes:

  • Because the edge sorting currently applies criteria NOT needed by simplification, the output tables will be slightly different. We can't use naive methods to compare outputs from the integration tests. The rust implementation linked above had hints.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C API Issue is about the C API
Projects
None yet
Development

No branches or pull requests

1 participant