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

Schedule callbacks to run asynchronously and in parallel #85

Open
lorenzoh opened this issue Jul 14, 2021 · 0 comments
Open

Schedule callbacks to run asynchronously and in parallel #85

lorenzoh opened this issue Jul 14, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@lorenzoh
Copy link
Member

lorenzoh commented Jul 14, 2021

Using the callback dependency graph, it's possible to determine which callbacks access what state and which callbacks need to run before.

Hence it should be possible to run callbacks that access unrelated state in parallel or asynchronously (or both). For example, you may have an integration with a experiment tracking backend like Weights and Biases which needs to perform network requests. These could be run in the background as not to slow down the training loop.

In practice, with the information from the dependency graph and whether state access are read/write a Dagger.jl DAG could be constructed and run asynchronously. Callbacks that write state, like ToGPU would still be run synchronously.

There already exists an extension interface for how callbacks are executed in FluxTraining.CallbackExecutor. The default (and so for only) implementation performs a topological sort and executes the callbacks serially.

@lorenzoh lorenzoh added the enhancement New feature or request label Jul 14, 2021
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