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

Relation to LoopVectorization #80

Open
KronosTheLate opened this issue Jun 18, 2022 · 1 comment
Open

Relation to LoopVectorization #80

KronosTheLate opened this issue Jun 18, 2022 · 1 comment

Comments

@KronosTheLate
Copy link

I am poking around julia threading tools to learn which ones I should use in certain scenarios. It would be great if the relationship between Polyester and LoopVectorization (when to use which, do they provide similar functionality etc) was mentioned in the readme. I am mainly missing some words to describe the differences human-to-human, but benchmarking could also be relevant. Idk.

@chriselrod
Copy link
Member

Polyester runs code with a static schedule from PolyesterWeave.jl on the task pool provided by ThreadingUtilities.jl.

LoopVectorization.jl's threading also uses PolyesterWeave.jl and ThreadingUtilities.jl, but it doesn't run code as written.
It instead tries to analyze the code and transform it into the fastest version getting the same answer it can come up, emitting code making heavy use of simd intrinsics.

LoopVectorization.jl is fairly limited in the complexity of code it can correctly model. But, for such code, it should probably be the fastest. With threading enabled, it will also automatically choose the number of threads to use based on the size of the problem. So it'll run single threaded on small vectors, for example.

Polyester doesn't model code at all, so it'll always run multithreaded, unless you use the minbatch argument to specify a minimum batchsize, in which case it'll ensure each thread uses at least minbatch iterations (LoopVectorization basically picks a minbatch automatically based on how expensive it thinks each iteration will be).
As Polyester just runs normal Julia, it can handle more complex code.
But it still uses a static schedule, so it isn't the best choice when you expect iterations to take a variable amount of time.

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

2 participants