Show HN: Continuous Machine Learning – CI/CD for Machine Learning Projects
cml.dev
cml.dev
CML automatically generates human-readable reports with metrics and data viz in every pull/merge request, and helps you use storage and GPU/CPU resources from cloud services. CML addresses three hurdles for making ML compatible with CI:
1. In ML, pass/fail tests aren’t enough. Understanding model performance might require data visualizations and detailed metric reports. CML automatically generates custom reports after every CI run with visual elements like tables and graphs. You can even get a Tensorboard.dev link as part of your report.
2. Dataset changes need to trigger feedback just like source code. CML works with DVC so dataset changes trigger automatic training and testing.
3.Hardware for ML is an ecosystem in itself. We’ve developed use cases with CML and Docker Machine to automatically provision and deploy cloud compute instances (CPU & GPU) for model training.
Our philosophy is that ML projects- and MLOps practices- should be built on top of traditional software tools and CI systems, and not as a separate platform. Our goal is to extend DevOps’ wins from software development to ML. Check out our project site (https://cml.dev) and repo, and please let us know what you think!
GitHub & GitLab have both made it quite easy to use your own resources as runners. I recently met someone who was doing Actions with a Jetson Nano on their dresser :)
After the run, output files, upload as a data set in DVC or something?
Documenting this full workflow would save a lot of confused devopsy people (like myself) survive in the world of ML. Thanks for this hard work you've all put into this!
Yes, DVC can help with that. Where the data lives? S3/GCS or just a server with SSH?
Disclaimer: I'm a creator of DVC.
CML can automate and make the process of preparing the model to be merged into that branch reliable, visible, robust, etc.
I'm happy to help with this flow, ping me on Twitter - @shcheklein in DM or ivan on DVC Discord.
With DVC/Cortex, you can set things up so that all you have to do is run `dvc push` to update your model and `cortex deploy` to deploy it.
docker run --name myrunner -d -e RUNNER_IDLE_TIMEOUT=1800 -e RUNNER_LABELS=cml -e RUNNER_REPO=$my_repo_url -e repo_token=$my_repo_token dvcorg/cml-gpu-py3-cloud-runner
It works for Gitlab and Github. Just only point your url and repo token
Here is the missing part for a total e2e solution: https://github.com/marketplace/actions/algorithmia-ci-cd
{disclaimer, we built this Github action}
disclaimer: I'm work with CML
For the last two years we have seen over and over again how our users take DVC and use it inside Gitlab, Github, etc. This product was born partially as a result of these discussions, partially as an initial visions for the ML tools ecosystem - Hashicorp-like.
Having A software engineering background I really hope that integrating ML workflow into engineering tools will be the future of this space. And with CML and other tools (e.g. https://github.blog/2020-06-17-using-github-actions-for-mlop...) we see this happening.
I've added integrating CML closer into GitLab to our direction page with https://gitlab.com/gitlab-com/www-gitlab-com/-/merge_request...
If you want to show the results in the Merge Request itself like we do for things like test results and security scans please let us know. Open an issue and if there is no response my Twitter handle is @sytses
1) can we see examples of generated reports?
2) what happens if training fails?
3) what kind of metrics can it graph? can we have it track our custom metrics?
4) can we connect with external services like with webhooks,slack, and other integrations.
5) is this a docker technology, or how does it deal with images and dependencies?
Great work!
1. Yes! Let me link some reports and example repos:
- A basic classification problem with scikit learn: https://github.com/iterative/cml_base_case/pull/2
- CML with DVC & Vega-Lite graphs: https://github.com/iterative/cml_dvc_case/pull/4
- Neural style transfer with EC2 GPU: https://github.com/iterative/cml_cloud_case/pull/2
2. If training fails, you'll be notified that your run failed in the GitHub Action dashboard (or GitLab CI/CD dashboard). See here for some real life examples of failure ;) : https://github.com/iterative/cml_cloud_case/actions
3. CML reports are markdown documents, so you can write any kind of text to them. If your metrics are output in a file `metrics.txt`, you can have your runner execute `cat metrics.txt >> report.md` and then have CML pass on the report to GitHub/GitLab. Likewise, any graphing library is supported because you can add standard image files (.png, .jpg) to the report. So custom metrics and custom graphs. We like DVC for managing and plotting metrics, but we're biased because we also maintain it.
4. Yep, GitHub Actions is pretty powerful and flexible. Works with whatever external services you can connect to your Action!
5. It's not strictly a Docker technology. We use Docker images preinstalled with the CML library in our examples, but you can just install the library with npm in your own image. https://github.com/iterative/cml#using-your-own-docker-image
Let me know if there's anything else I can tell you about
Obviously we can't predict every error by thinking hard, but datasets will never serve as a full representation of what models might experience in the real world. Continuous deployment to an ML model could affect undefined behavior in unpredictable ways.
One of our motivations for building visual reports that appear like comments in a pull request is giving teams metrics & info to discuss when deciding if merge is right. That way, the automated part is training and testing, but the decision making is human (i.e., data scientists whose skills are better used interpreting models & data than running repetitive training scripts).
CI/CD systems in this case help automating this as much as possible, but do not completely replace decision making process, I would say.
The CD Foundation has a SIG around MLOps which is pretty active and has some awesome folk participating.
For anyone who's interested in this space, there's some more detail here: https://cd.foundation/blog/2020/02/11/announcing-the-cd-foun...