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

Implement graph rewrites to vectorize asynchronous Ops #13

Closed
5 of 6 tasks
michaelosthege opened this issue Aug 14, 2022 · 0 comments
Closed
5 of 6 tasks

Implement graph rewrites to vectorize asynchronous Ops #13

michaelosthege opened this issue Aug 14, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@michaelosthege
Copy link
Owner

michaelosthege commented Aug 14, 2022

Old design idea
## Design option: RPC-Aware Ops
This was the first idea.
+ [ ] Find `Op`s in the graph that use the `ArraysToArraysServiceClient` and can be parallelized (they must not depend on each other). This can be implemented by adding a mixin-interface by which an `isinstance(op, ArraysToArraysOp)` can be identified.
+ [ ] Write a `ParallelArraysToArraysOp` that keeps a list of streams and runs evaluations in parallel.
+ [ ] Do a subgraph replacement where the independent `ArraysToArraysOp`s nodes are substituted by a subgraph that routes the inputs to a new `ParallelArraysToArraysOp` node and redistributes the outputs.

Design option: Async Ops (preferred)

This would be RPC-unaware and more generic overall.

  • Introduce a generic AsyncOp class #26
  • Implement async homologues to the function-wrapping convenience-Ops: AsyncArraysToArraysOp, AsyncLogpOp, AsyncLogpGradOp.
  • Write a class ParallelAsyncOp(Op) similar to aesara.graph.basic.Composite that parallelizes the .perform_async() calls of a bunch of AsyncOps.
  • Write a graph optimization that finds AsyncOps and merges them into an ParallelAsyncOp
@michaelosthege michaelosthege added the enhancement New feature or request label Aug 14, 2022
@michaelosthege michaelosthege changed the title Implement Aesara optimization to vectorize Ops Implement Aesara graph rewrites to vectorize Ops Aug 17, 2022
@michaelosthege michaelosthege changed the title Implement Aesara graph rewrites to vectorize Ops Implement graph rewrites to vectorize asynchronous Ops Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant