Live data from Hacker News

Why we do machine learning engineering with YAML, not notebooks

towardsdatascience.com

21–30 of 31 posts

Re: Why we do machine learning engineering with YAML, not notebooks

#21
post #5

The title is seriously misleading. They aren't doing their ML engineering in yaml. If you look at the snipper the article, you can see that their code is in flat .py files. The config is in yaml (which is also how everyone else uses it). It's like someone saying that they do their ML in a dockerfile.

[deleted]

Re: Why we do machine learning engineering with YAML, not notebooks

#22

So, every month or two I see another article tut-tutting people for putting notebooks into production, and I'm curious, who is actually doing this? I've never seen such a thing in the wild, and I'm genuinely (morbidly?) curious what it would look like in practice.

with databricks, its very easy to put a notebook into production. I've done it several times

Re: Why we do machine learning engineering with YAML, not notebooks

#23

So, every month or two I see another article tut-tutting people for putting notebooks into production, and I'm curious, who is actually doing this? I've never seen such a thing in the wild, and I'm genuinely (morbidly?) curious what it would look like in practice.

A notebook is just a script that runs in a fancy UI.

Have you never seen a script in production?

Re: Why we do machine learning engineering with YAML, not notebooks

#24
I once wrote a survey of tools within the Jupyter Notebook ecosystem: https://ljvmiranda921.github.io/notebook/2020/03/16/jupyter-... (it’s a three part series and that link is Part 2).

The topic of production notebooks often shows up. I’ve seen tools like papermill and dagster being used for notebook prod, just like in Netflix.

I concluded that using notebooks for prod is always a tech decision, often influence by a tradeoff: risk for premature optimization (writing scripts early on in the project that may only be used once) and underengineering (using non-maintainable and clunky code to support mission-critical workloads): https://ljvmiranda921.github.io/notebook/2020/03/16/jupyter-...

Re: Why we do machine learning engineering with YAML, not notebooks

#25

So, every month or two I see another article tut-tutting people for putting notebooks into production, and I'm curious, who is actually doing this? I've never seen such a thing in the wild, and I'm genuinely (morbidly?) curious what it would look like in practice.

Netflix apparently. They've built an entire software framework for enabling their data scientists to put their notebooks into production [0]. [0] https://netflixtechblog.com/notebook-innovation-591ee3221233

We (Netflix) do a ton of prototyping/exploration in notebooks like everyone else. We run many ETL pipelines in production as templated notebooks. When something fails, you can just open a notebook to see the input and the output, which is handy.

We don't deploy or execute ML models in production as notebooks. We have many other solutions for that use case. In particular, check out https://metaflow.org

Re: Why we do machine learning engineering with YAML, not notebooks

#26

For .ipynb notebooks, I highly recommend using nbstripout [0] to strip the Jupiter output before committing the notebooks to the repository (thus making the diffs sane). You can also set it up as a 'filter', so it automatically runs before any git operations, whether it's add, commit, diff or an interactive rebase. [0] https://github.com/kynan/nbstripout

[deleted]

Re: Why we do machine learning engineering with YAML, not notebooks

#27

So, every month or two I see another article tut-tutting people for putting notebooks into production, and I'm curious, who is actually doing this? I've never seen such a thing in the wild, and I'm genuinely (morbidly?) curious what it would look like in practice.

I just completed a project using notebooks in production. Granted, it was as a stepping stone to a more traditional application, but for 3 months, our production system was readily executing notebooks and consuming their output.

Papermill (https://papermill.readthedocs.io/en/latest/) made it extremely easy, to the point where I question the real value of moving away from this model. But software engineers practically hiss when you mention Jupyter because it's too different from the rest of their tooling.

Re: Why we do machine learning engineering with YAML, not notebooks

#28
Reason 1 (Your pipeline should be reproducible) for avoiding jupyter doesn't make any sense. That's the whole point of jupyter. Out of order execution can happen, but you can just as easily restart the kernel and run all... I can only imagine this is a problem for someone who doesn't understand the tool they're using.

Reasons 2 and 3 for avoiding jupyter are more justified but easy enough to work around between jupytext and papermill.

Re: Why we do machine learning engineering with YAML, not notebooks

#29

So, every month or two I see another article tut-tutting people for putting notebooks into production, and I'm curious, who is actually doing this? I've never seen such a thing in the wild, and I'm genuinely (morbidly?) curious what it would look like in practice.

If you use Databricks, it's pretty easy to schedule a Databricks notebook to run. AWS EMR also has notebook support, I haven't used it, but it might be possible to schedule those too. You would still have to grant permission to the Databricks role to write to a production location in S3.

I really dislike this practice. Code that runs in production should be code reviewed and there should be some monitoring in place to make sure the job is working correctly

Re: Why we do machine learning engineering with YAML, not notebooks

#30
post #10

Its quite simple to develop a model, bundle it up for deployment and deploy. Nobody cares about your fancy YAML based containerized deployment and monitoring setup, everyone has that. The challenge comes in when you have a continuous cycle of data ingestion to model optimization, training, evaluation and deployment. Pretty much everybody has huge amount of code duplication in there. It also comes from the fact that m…

I don't think it's simple to deploy scaleable predictions - that's why model hosting solutions like SageMaker's and GCP's AI Platform exist, and there's no need for people to be re-implementing model deployment/monitering.
Post reply on HN