Skip to content

Commit 7ae2436

Browse files
authored
Merge pull request HazyResearch#52 from ucbrise/main
[MLOps] Expanded on Logging and Debugging
2 parents c912595 + 585dae0 commit 7ae2436

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

mlops.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ When continuously testing ML models one has to be careful to not be fooled by th
3636

3737
There is typically not only a single model being developed or active in production. Various online repositories such as [Hugging Face](https://huggingface.co/models), [PyTorch Hub](https://pytorch.org/hub/) or [TensorFlow Hub](https://tfhub.dev/) facilitate sharing and reusing pre-trained models. Other systems such as [ModelDB](https://dm-gatech.github.io/CS8803-Fall2018-DML-Papers/hilda-modeldb.pdf), [DVC](https://dvc.org/) or [MLFlow](https://cs.stanford.edu/~matei/papers/2018/ieee_mlflow.pdf) extend the repository functionality by further enabling version of models and dataset, tracking of experiments and efficient deployment.
3838

39+
Models may be deployed in the cloud to form prediction-serving systems.
40+
Intelligent applications or services may then poll the model for predictions.
41+
In this context of ML-as-a-service, the hosting platform must be able to
42+
respond to a high volume of bursty requests with very low latency.
43+
[Clipper](https://www.usenix.org/system/files/conference/nsdi17/nsdi17-crankshaw.pdf) is an early example in this space.
44+
3945
<h2 id="mlops-monitoring">Monitoring and Adaptation</h2>
4046

4147
It is well known that the accuracy of active models in production typically diminishes over time. The main reason for this lies in the distribution shift between the new real-time test data and the data used to train the model originally. The most prominent remedy to this problem still lies periodically (sometimes on a daily or even hourly basis) re-training models using fresh training data. This is a very costly undertaking which can be prevented by having access to so called drift detectors (also refered to as anomaly or outlier detectors). [MLDemon](https://arxiv.org/abs/2104.13621) models a human-in-the-loop approach to minimize the number of required verifications. [Klaise et. al.](https://arxiv.org/abs/2007.06299) suggest that outlier detectors should be coupled with explainable AI (XAI) techniques to help humans understand the predictions and potential distribution drift.
@@ -44,7 +50,21 @@ In an ideal world, we would want an ML system in production to automatically ada
4450

4551
<h2 id="mlops-debugging">Debugging</h2>
4652

47-
Debugging an ML model is likely to be required in any of the MLOps stages. There are many approaches to debug, or likewise prevent ML failures from happening. We summarize the most prominent research next, noting that all ideas somehow relate to human-generated or -assisted tests.
53+
For an ML application to be sustainable, support for debugging must exist. Debugging an ML model is likely to be necessary in any part of the MLOps stages.
54+
There are many approaches to debug, or likewise prevent ML failures from happening.
55+
Unlike traditional forms of software, for which we rely on techniques like breakpoint-based cyclic debugging,
56+
bugs in model training rarely express themselves as localized failures that raise exceptions.
57+
Instead, a bug in model training is expressed in the loss or other metrics.
58+
Thus, model developers cannot pause a training run to query state. Instead, they must trace the value of
59+
a stochastic variable over time: they must log training metrics.
60+
Increasingly more mature systems for logging in ML are available.
61+
[TensorBoard](https://www.tensorflow.org/tensorboard) and [WandB](https://wandb.ai/site) are two examples.
62+
In the event that the model developer may want to view or query more training data than they logged up-front, e.g. tensor histograms or images \& overlays,
63+
they may add [hindsight logging](http://www.vldb.org/pvldb/vol14/p682-garcia.pdf) statements to their code post-hoc and do a fast replay from model checkpoints.
64+
65+
A model is just one step of the ML pipeline. Many ML pipeline bugs lie outside of the modeling stage (e.g. in data cleaning or feature generation). ML pipelines cannot be sustainable or easily debugged without some end-to-end [observability](https://arxiv.org/abs/2108.13557), or visibility into all of the steps of the pipeline. Adopting the software mindset of observability, we posit that much of the work in ML observability lies around end-to-end logging and monitoring of inputs and outputs, as well as developing query interfaces for practitioners to be able to ask questions about their ML pipeline health.
66+
67+
Next, we summarize prominent research directions in ML application sustainability:
4868

4969
- [TFX Validation](https://mlsys.org/Conferences/2019/doc/2019/167.pdf) gnerates and maintains a schema for the data. Failures in validating this schema either require the data to be fixed, or the schema to be changed.
5070
- [Deequ](https://ieeexplore.ieee.org/document/8731462) enables unit-test for data via a declarative API by combining common quality constraints with user defined validation code.
@@ -53,6 +73,8 @@ Debugging an ML model is likely to be required in any of the MLOps stages. There
5373
- [Amazon SageMaker Debugger](https://proceedings.mlsys.org/paper/2021/file/d1f491a404d6854880943e5c3cd9ca25-Paper.pdf) consists of an efficient tensor processing library along with built-in rules executed in dedicated containers.
5474
- [Checklist](https://homes.cs.washington.edu/~marcotcr/acl20_checklist.pdf) enables comprehensive behavioral testing of NLP models by modeling linguistic capabilities a NLP model should be able to capture.
5575
- [Model Assertion](https://arxiv.org/pdf/2003.01668.pdf) provides an abstraction for model assertions at runtime and during training in the form of arbitrary functions that can indicate when an error is likely to have occurred.
76+
- [FLOR](https://github.com/ucbrise/flor) Is a record-replay library designed for hindsight logging of model training.
77+
- [mltrace](https://github.com/loglabs/mltrace) is an end-to-end observability system for ML pipelines.
5678

5779
<h2 id="mlops-additional">Additional Resources</h2>
5880

0 commit comments

Comments
 (0)