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 DispatchKernel for Operator #999

Open
mortendahl opened this issue Mar 24, 2022 · 0 comments
Open

Implement DispatchKernel for Operator #999

mortendahl opened this issue Mar 24, 2022 · 0 comments

Comments

@mortendahl
Copy link
Member

We currently have large and similar match op.kind expressions in implementations of eg Session::execute and SymbolicStrategy::execute, all of which could be replaced by various impl DispatchKernel<S> for Operator potentially generated by operators! or enum_dispatch.

One complication is that some operators are special in the sense that they take advantage of being in an async context, including SaveOp and LoadOp. This is not something we can currently capture in the framework, but there are at least two solutions:

  1. Don't use the framework for these special ops but instead implement DispatchKernels manually; disadvantage here is that we need to be careful to ensure consistency across the different sessions types, which is otherwise taken care of by the framework. Note also that some of the special operators will share the same logic in higher levels, say SaveOp on replicated placements.
  2. Extend the framework to handle these special cases so that a pair of kernel functions (Self::sync_kernel_func, Self::async_kernel_func) can be given instead of currently only accepting a single one.

There may of course be other solutions and we should benefit from exploring this further before moving on to implementation.

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