Instrument torchsupport with logging framework that supports MLflow #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
There's a desire to support MLflow logging in torchsupport's tooling to support the SCGPM COVID-19 effort. The way that torchsupport is currently structured involves a hardcoded support for a Tensorboard SummaryWriter. However, as written, this means significant code change would be required to support MLflow and it would be duplicative with what already exists for Tensorboard.
Proposal for Review
I propose that the AbstractVAETraining class, instead of having a Tensorboard writer, has a "Logger". This logger supports a generalized "log" API, which is implemented by backends that implement the Logger interface. For example, there would be a TensorboardLogger interface that implements logging Tensorboard events. In this framework, it's easy to conceptualize an MLflowLogger, which would log to MLflow as well with the same API. This way, if you're implementing some kind of custom training workflow, you have a consistent logging interface to call that is flexible in terms of what service you log to.
There's 2 open questions here:
TODOs: