Live data from Hacker News

Ask HN: What's Your CI/CD Workflow for Your Machine Learning Projects?

news.ycombinator.com

1–10 of 31 posts

Ask HN: What's Your CI/CD Workflow for Your Machine Learning Projects?

#1
We are working on an ML project (Computer Vision specifically) and we are in the process of productionizing our models. What kind of tools do you use and what's your workflow for integrating, testing and deploying your models? Do you have any suggestions or tips about what to do and what to avoid?

Re: Ask HN: What's Your CI/CD Workflow for Your Machine Learning Projects?

#2
I'm a statistician by trade so I mostly do prototype work. As far as building models my key workflow is using a R and Rstudio. The biggest issue is data management. I suggest a good API or wrapper for a data source that has all of the ETL already done for the most part. R connects very well to most database systems. RStudio makes development easier with connectivity to GitHub or other popular version control systems.

As far as putting into production I'm not as familiar. Yet I hear that a good Python workflow would probably work best.

Re: Ask HN: What's Your CI/CD Workflow for Your Machine Learning Projects?

#3
post #2

I'm a statistician by trade so I mostly do prototype work. As far as building models my key workflow is using a R and Rstudio. The biggest issue is data management. I suggest a good API or wrapper for a data source that has all of the ETL already done for the most part. R connects very well to most database systems. RStudio makes development easier with connectivity to GitHub or other popular version control systems.…

Also Rstudio mates well with bitbucket for those who want private repos for free.

Re: Ask HN: What's Your CI/CD Workflow for Your Machine Learning Projects?

#5
post #3
post #2

I'm a statistician by trade so I mostly do prototype work. As far as building models my key workflow is using a R and Rstudio. The biggest issue is data management. I suggest a good API or wrapper for a data source that has all of the ETL already done for the most part. R connects very well to most database systems. RStudio makes development easier with connectivity to GitHub or other popular version control systems.…

Also Rstudio mates well with bitbucket for those who want private repos for free.

Great point.

Also per the production environment. The key is having the same machine learning libraries available in both the development and production so you can plug the model in with little problems with dependencies. For this reason most folks that will go into production, particularly web applications, will tend to both develop and implement in Python, Java, etc.

Re: Ask HN: What's Your CI/CD Workflow for Your Machine Learning Projects?

#6
Having put many models into production in an almost real time environment (ad servers that need predictions in First, I would highly recommend wrapping your ML models in some kind of microservice. Depending on your production requirements and if the ML is in Python a fairly simple Flask/Sanic web server should be sufficient. This is great because you can leave all your feature transformation code as is in Python.

If your production environment has very low latency requirements you are going to have some work cut out for you. You'll most likely have to rewrite all your transformation code in a faster language like Go or Java. You might also need to implement the inference code as well to get the speed you need. This adds considerable time and adds a ton of surface error for potential insidious bugs. The ML will still make predictions, but they will be wrong or very slightly wrong.

Because I'm working with larges of amounts of data and my source of truth is Parquet logs in S3, the pipelines start with Spark. We do as much data wrangling as possible in Spark to get things into a manageable size to create our train/dev/test sets. This data gets uploaded to S3.

The datasets are then trained on EC2 instances using Pandas & sklearn. When everything is fully automated the Spark job will push a message onto an SQS queue with the S3 path of the fresh dataset. An EC2 instance will be polling that queue and pull down the data and train a new model.

The final result of training my case is a text or binary model file that goes back up to S3. Our prediction microservice polls an S3 bucket and pulls down any updated model files and swaps out the running models.

Tips:

  1. Instrument everything! Hopefully you have something like graphite/datadog/prometheus in place already, but you'll want metrics on your predictions.
  2. Exception tracking on everything especially anything in your model creation pipeline. Sentry or something like that.
  3. Try and keep everything as simple as possible.

Re: Ask HN: What's Your CI/CD Workflow for Your Machine Learning Projects?

#7
If you use Algorithmia.com you can add your model in the language of your choice (on GPUs if you want) and it will do all of the Devops and give you an API end point. You get free credits at sign up and quite a few each month for testing.

Re: Ask HN: What's Your CI/CD Workflow for Your Machine Learning Projects?

#8

If you use Algorithmia.com you can add your model in the language of your choice (on GPUs if you want) and it will do all of the Devops and give you an API end point. You get free credits at sign up and quite a few each month for testing.

Oh, and you can make your model private if you don’t want others to use it, and you can make it public to either give away or charge a royalty.

Re: Ask HN: What's Your CI/CD Workflow for Your Machine Learning Projects?

#9
Shameless plug (I'm head of product at Algorithmia): we've written a lot of algorithms ourselves including many computer vision algos [1] that are published publicly for use. The underlying platform at Algorithmia is able to run production models at scale and puts a simple REST API in front of all of the algorithms so developers can easily call them from your production apps. The algorithms you see in the marketplace are publicly published but the platform runs private algorithms for software teams as well. Check it out: [2]

[1]: https://algorithmia.com/tags/computer-vision [2]: https://algorithmia.com

Post reply on HN