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

Threading framework #11

Open
tbetcke opened this issue Sep 22, 2022 · 0 comments
Open

Threading framework #11

tbetcke opened this issue Sep 22, 2022 · 0 comments

Comments

@tbetcke
Copy link
Collaborator

tbetcke commented Sep 22, 2022

Householder requires a future save and scalable threading framework. The usual choice for compute intensive threading in Rust is Rayon. It has the following advantages:

  • Optimised and well tested for CPU intensive loads.
  • Simple fork/join model.
  • Very powerful parallel iterators.

However, it is difficult in Rayon to model complex task graph dependencies. Many modern linear algebra algorithms use complex tasking models to optimise parallel execution beyond simple parallel matrix/matrix products.

A framework that is well suited for complex task dependencies is Tokio. Advantages of Tokio are:

  • Very widely used in the Rust community, well tested and future proof.
  • Support for async/await for complex task models.
  • Similar to Rayon a work-stealing runtime system.

However, Tokio is usually not recommended for CPU intensive loads but for I/O Intensive loads. There is even an explicit warning in the documentation that for CPU bound work one should use Rayon.

I tried to understand limitations of Tokio for CPU workloads better, but so far have failed to see what the problems are. There is even a very good Blog post describing how Tokio can be safely used for CPU intensive workloads.

The question is now Tokio or Rayon? There is an option to use both frameworks via something like tokio_rayon. But I rather want to avoid having to include two complex threading frameworks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant