12 ms·
Who needs MLflow when you have SQLite?
- Grapefruitwoes 4y agoI've found weights and biases extremely easy to use with minimal integration effort. Not sure if this provides any functionality that's better.
- j0selit0 4y agoI mean, come on, SQLite doesn't even support concurrency. Are people seriously considering using it in a production scenario? If you work in a DS team where you're the only DS, then it probably suits your needs. Otherwise I can't imagine how you could achieve anything production grade
- antipaul 4y agoNot convinced by the example. I don’t see how you can’t use standard scikit-learn for it. First, the example doesn’t take advantage of sklearn’s built in, super simple parallelization via n_jobs Then, the entire example could be better wrapped with sklearn’s own cross_validate() which gives you the same functionality: a table of results across experiments. If you use a different estimator, you can easily concatenate the results into a single df The rest is the same. Why you need SQLite for this? (SQLite is great of course for the right use cases) And if you're doing many orders more experiments (1000s instead of 10s) then that’s probably where MLflow is good (haven’t actually used MLflow)
- phr0k 4y agoBeing able to use SQL for later analysis is definitely a good idea. For smaller models SQLite for sure is enough but as soon as you want to scale your HPO across multiple servers or even just processes, you will need something that supports a multi-user database. E.g. Optuna supports PostgreSQL and also defaults to SQLite as far as I know.
- isoprophlex 4y agoYeah, MLFlow is a shitshow. The docs seem designed to confuse, the API makes Pandas look good and the internal data model is badly designed and exposed, as the article says. But, hordes of architects and managers who almost have a clue have been conditioned to want l and expect mlflow. And it's baked into databricks too, so for most purposes you'll be stuck with it. Props to the author for daring to challenge the status quo.
- idomi 4y agoHow many data scientists that use Databricks for modeling do you know?
- dachryn 4y agoits forced upon many of them that are in finance, banking, insurance, ... Mainly because those tend to run on Microsoft Azure, which has no decent analytics offering, and are pushing Databricks extremely hard. The CTO or whatever just pushes databricks. On paper it checks all the boxes. Mlops, notebooks, experiment management. It just does all of those things very badly, but the exec doesn't care. They only care about the microsoft credits. Just to avoid using Jupyter so the compliance teams stay happy as well because Microsoft sales people scared them away from from open source.
- nerdponx 4y agoMy team very nearly had this happen to us. We pushed back on it very, very, very hard, and finally convinced "IT" to not turn off our big Linux server running JupyterHub. We actually ended up using Databricks (PySpark, Delta Lake, hosted MLFlow) quite a bit for various purposes, and were happy to have it available. But the thought of forcing us into it as our only computing platform was a spine-chilling nightmare. Something that only a person who has no idea what data analysts and data scientists actually do all day would decide to do.
- akdor1154 4y agoWhat would you go with instead for collaborative notebooks? I ask because normally I tend pretty strongly towards the "NO just let the DSes/analysts work how they want to", which in this case would be running Jupyter locally. However DBr's notebooks seem genuinely useful. Is your issue "but I don't need Spark" or "i wanna code in a python project, not a notebook?", or something else? Imo if DBr cut their wedding to Spark and provided a Python-only nb environment they'd have a killer offering on their hands.
- 4y ago
- benjaminwootton 4y agoThe elephant in the room with data is that we don’t need a lot of the fancy and powerful technology. SQL against a relational database gets us extraordinarily far. Add some Python scripts where we need some imperative logic and glue code, and a sprinkle of CI/CD if we really want to professionalise the work of data scientists. I think this covers the vast majority of situations. Despite being around it for some time, I’m not sure big data or machine learning needed to be a thing for the vast majority of businesses.
- isoprophlex 4y agoYeah and even if you do need to do proper big-dataset-ML... a SQL box and maybe something like a blob storage for large artifacts (S3, Azure storage account, whatever) is all you need as well. But if your boss bought The MLOps Experience, you gotta do what the cool kids are doing!
- chasil 4y agoThe article mentions this workflow: "Let’s now execute the script multiple times, one per set of parameters, and store the results in the experiments.db SQLite database... After finishing executing the experiments, we can initialize our database (experiments.db) and explore the results." Be warned that issuing queries while DML is in process can result in SQLITE_BUSY, and the default behavior is to abort the transaction, resulting in lost data. Setting WAL mode for greater concurrency between a writer and reader(s) can lead to corruption if the IPC structures are not visible: "To accelerate searching the WAL, SQLite creates a WAL index in shared memory. This improves the performance of read transactions, but the use of shared memory requires that all readers must be on the same machine [and OS instance]." If the database will not be entirely left alone during DML, then the busy handler must be addressed.
- habibur 4y agoNone of these are a problem for the workload discussed. When I am working with sqlite I am more likely accessing it from a single machine. And in this case of ML, most likely from 1 process and by running multiple times in serial.
- spicyramen_ 4y ago
- guangyeu 4y agoCould you provide context on why SQLite would replace MLflow? From the standpoint of model tracking (record and query experiments), projects (package code for reproducibility on any platform), deploy models in multiple environments, registry for storing and managing models, and now recipes (to simplify model creation and deployment), MLflow helps with the MLOps life cycle.
- edublancas 4y agoFair point. MLflow has a lot of features to cover the end-to-end dev cycle. This SQLite tracker only covers the experiment tracking part. We have another project to cover the orchestration/pipelines aspect: https://github.com/ploomber/ploomber https://github.com/ploomber/ploomber and we have plans to work on the rest of features. For now, we're focusing on those two.
- ralphc 4y agoHave you looked into duckdb for the database? I'm hearing for some tasks it's faster than SQLite.
- edublancas 4y agoYeah, we're also looking into it and we'll probably add it as a backend in the future!
- deleted 4y ago[deleted]
- frgtpsswrdlame 4y agoWow this looks perfect for what I need right now - just a bit of lightweight tracking.
- edublancas 4y agoIf you need help, you can open an issue on GitHub (https://github.com/ploomber/ploomber-engine https://github.com/ploomber/ploomber-engine) or join our Slack! (https://ploomber.io/community/ https://ploomber.io/community/)
- nerdponx 4y agoDVC also fills the "lightweight tracking" niche, although it relies on automatically creating Git branches as its technique for tracking experiments. I personally find that distasteful, so I don't use it specifically for experiment tracking, but the feature is there. The company behind DVC is also building a handful of other related tools, e.g. https://iterative.ai/blog/iterative-studio-model-registry https://iterative.ai/blog/iterative-studio-model-registry
- wxnx 4y agoHm, in what way do you find that DVC requires creating new branches for experiment tracking? I find the following workflow works well, for example: 1. Define steps depending on a `config.yml`. 2. Run an initial experiment (with an initial config) and commit the results. 3. Update config (preserving the alternate config and using symlinks from `config.yml` to various new configs if necessary), re-run, and commit. 4. Results are then all preserved in your git history.
- nerdponx 4y agoRight, but experiments aren't always linear. Do you really want to make a new commit for every iteration of a hyperparameter search? What if you are using a black-box optimizer that supports parallel/concurrent updates? I don't want to use Git to track all that. I want to use Git to store the final results of running such an experiment in the same commit as the code that implemented it. I just don't like the DVC experiment workflow, but I am more than happy to use DVC for storing the fitted model(s) at the end of the run.
- afrnz 4y agoYou can also use mlflow locally with SQLite (https://www.mlflow.org/docs/latest/tracking.html#scenario-2-mlflow-on-localhost-with-sqlite https://www.mlflow.org/docs/latest/tracking.html#scenario-2-...). Even though I haven't tried querying the db directly ...
- LeanderK 4y agoI think MLflow is a good idea (very) badly executed. I would like to have a library that combines: - simple logging of (simple) metrics during and after training - simple logging of all arguments the model was created with - simple logging of a textual representation of the model - simple logging of general architecture details (number of parameters, regularisation hyperparameters, learning rate, number of epochs etc.) - and of course checkpoints - simple archiving of the model (and relevant data) and all that without much (coding) overhead and only using a shared filesystem (!) And with an easy notebook integration. MLflow just has way to many unnecessary features and is unreliable and complicated. When it doesn't work it's so frustrating, it's also quite often super slow. But I always end up creating something like MLflow when working on an architecture for a long time. EDIT: having written this...I fell like trying to write my own simple library after finishing the paper. A few ideas have already accumulated in my notes that would make my life easier. EDIT2: I actually remember trying to use SQLite to manage my models! But the server I worked on was locked down and going through the process to get somebody to install me SQLite was just not worth it. It's also was not available on the cluster for big experiments, where it would be even more work to get it, so I gave up on the idea of trying SQLite.
- pletnes 4y agoSqlite is in python’s stdlib, so how can this be an issue? Was there no local filesystem whatsoever?
- tekknolagi 4y agosqlite bindings are in the stdlib but not the library itself.
- imachine1980_ 4y agoim asking from ignorance, what the difference in effect this context of not having the library itself?
- funklute 4y ago
- navbaker 4y agoI work in an environment where there are multiple tech teams developing models for multiple use cases on VMs and GPU clusters spread across our corporate intranet. Once you move beyond a single dev working on a model on their laptop, you absolutely need something that can handle not just metrics tracking, but making the model binaries available and providing a means to ensure reproducibility by the rest of the team. That's what MLFlow is providing for us. The API is a mess, but at least we didn't have to code up some bespoke in-house framework, we just put some engineers on task to play around with it for a few hours and figure out the nuances of basic interactions and deployed it.
- edublancas 4y agoAgree. Once you have a team, you need to have a service they can all interact with. This release is a first step, we want to get the user experience right for an individual and then think of how to expand that to teams. Ultimately, the two things we're the most excited about are 1) you don't need to add any extra code (and it works with all libraries, not a pre-defined set) 2) SQL as the query language
- mostdataisnice 4y agoSQLite is literally a backend for MLflow, so the argument being made really is that you should just use SQL when you can, which is kind of adjacent to any criticisms of MLflow
- edublancas 4y agoIs querying the underlying SQL database officially supported in MLflow? Last time I used it, it wasn't documented. I took a look at the database and it wasn't end-user friendly.
- mostdataisnice 4y agoAs someone replied above, it's because SQL is just 1 backend and it's weird to expose an API that only works on 1 backend. Once you have many devs working together, you need a remote server. If you have a remote abstracted backend, it needs to have a unified API surface so the same client can talk to any backend. You might argue "This interface should be SQL", and to that I would say there are many file stores (like your local file system) that are not easy to control with SQL.
- cdong 4y agoI don't get why a lot of people are calling mlflow a shitshow when it has done so much getting data scientist out of recording experiments via CSV. I can log models and parameters and use the UI to track different runs. After comparisons, I can use the registry to register different staging. If you have other model diagnostic charts you can log the artifact as well. I think mlflow v2 has auto logging included so why all the fuss?
- cameronfraser 4y agoThere are those who create and those who complain on the internet about tools they've used one time
- isoprophlex 4y agoOkay that's coming across as a pretty snide remark aimed at me, I'll bite. Yes, I can understand why you comment that. I don't like blind slagging of free software either. But there are ALSO those whose day job it is, and has been for the last 2 years, to use a badly designed overcomplex horrorshow of a tool that could be replaced easily by something better ... if it wasn't for the lock-in effects and strong marketing. So I'm ventilating my frustration and at the same time expressing my gratitude to the person who made something fresh, that shows us things can be better. I can't build the replacement to MLFlow myself, but I can cheer people on who do, and let them know their efforts are sorely needed.
- nerdponx 4y agoPeople tend to forget that first movers rarely tend to also have the best design. MLFlow (and DVC) brought us out of the dark ages. Now we can build better tools, with the benefit of hindsight. Claiming that something is "broken" or "trash" when you mean "I don't like it" is a good way to make yourself feel big and smart, but it's not actually constructive.
- praveenhm 4y agowhat is alternative to MLflow other than SQLite, like Kubeflow, Metaflow?
- farbarg 4y agoThere are a lot of tools in this space. Shameless plug to follow. I helped build and use Disdat, which is a simple data versioning tool. It notably doesn't have the metadata capture libraries MLFlow has for different model libs, but it's meant to a lower-layer on which that can be built. Thus you won't see particulars about tracking "models" or "experiments", because models/experiments/features/intermediates are all just data thingies (or bundles in Disdat parlance). For the last 2+ years we've used Disdat to track runs and outputs of a custom distributed planning tool, and used Disdat-Luigi (an integration of Disdat with Luigi to automatically consume/produce versioned data) to manage model training and prediction pipelines (some with 10ks of artifacts). https://disdat.gitbook.io/disdat-documentation https://disdat.gitbook.io/disdat-documentation
- crucialfelix 4y agoWeights and Balances https://wandb.ai/site https://wandb.ai/site
- pcerdam 4y agoWeights and *Biases :)
- kuba_dmp 4y agoneptune.ai https://neptune.ai/ https://neptune.ai/
- the83 4y agoComet: https://www.comet.com/site/ https://www.comet.com/site/
- mmq 4y agohttps://github.com/polyaxon https://github.com/polyaxon
- 4y ago
- geminicoolaf 4y agoWhat about BentoML?
- bfung 4y agoHow about a side-by-side comparison? Far too often, these articles of X is bad, use my homebrew Y instead, without showing comparison to X doesn't help illustrate 'why Y instead'. You know... <cheeky>For science.</cheeky>
- guangyeu 4y agoAs noted in an earlier comment, I think there is a false equivalence between end-to-end MLOps platforms like MLflow and tools for experiment tracking. The project looks like a solid tracking solution for individual data scientists, but it is not designed for collaboration among teams or organizations. > There were a few things I didn’t like: it seemed too much to have to start a web server to look at my experiments, and I found the query feature extremely limiting (if my experiments are stored in a SQL table, why not allow me to query them with SQL). While a relational database (like sqlite) can store hyperparameters and metrics, it cannot scale for the many aspects of experiment tracking for a team/organization, from visual inspection of model performance results to sharing models to lineage tracking from experimentation to production. As noted in the article, you need a GUI on top of a SQL database to make meaningful model experimentation. The MLflow web service allows you to scale across your teams/organizations with interactive visualizations, built-in search & ranking, shareable snapshots, etc. You can run it across a variety of production-grade relational dBs so users can query the data directly through the SQL database or through a UI that makes it easier to search for those not interested in using SQL. > I also found comparing the experiments limited. I rarely have a project where a single (or a couple of) metric(s) is enough to evaluate a model. It’s mostly a combination of metrics and evaluation plots that I need to look at to assess a model. Furthermore, the numbers/plots themselves have no value in isolation; I need to benchmark them against a base model, and doing model comparisons at this level was pretty slow from the GUI. The MLflow UI allows you to compare thousands of models from the same page in tabular or graphical format. It renders the performance-related artifacts associated with a model, including feature importance graphs, ROC & precision-recall curves, and any additional information that can be expressed in image, CSV, HTML, or PDF format. > If you look at the script’s source code, you’ll see that there are no extra imports or calls to log the experiments, it’s a vanilla Python script. MLflow already provides low-code solutions for MLOps, including autologging. After running a single line of code - mlflow.autolog() - every model you train across the most prominent ML frameworks, including but not limited to scikit-learn, XGBoost, TensorFlow & Keras, PySpark, LightGBM, and statsmodels is automatically tracked with MLflow, including all relevant hyperparameters, performance metrics, model files, software dependencies, etc. All of this information is made immediately available in the MLflow UI. Addendum: As noted, there is a false equivalence between an end-to-end MLOps lifecycle platform like MLflow and tools for experiment tracking. To succeed with end-to-end MLOps, teams/organizations also need projects to package code for reproducibility on any platform across many different package versions, deploy models in multiple environments, and a registry to store and manage these models - all of which is provided by MLflow. It is battle-tested with hundreds of developers and thousands of organizations using widely-adopted open source standards. I encourage you to chime in on the MLflow GitHub on any issues and PRs, too!
- alexpotato 4y agoI recently did the following: - had a giant pcap - wrote a perl script to output some of the key value from the dump (e.g. IP and UDP packet lengths) into csv - loaded the csv into sqlite3 database - ran several queries to identify microbursts of bandwidth etc The younger/more junior folks were blown away that you could do this with <100 lines of code and it was pretty fast. Btw, above was inspired by this: https://adamdrake.com/command-line-tools-can-be-235x-faster-than-your-hadoop-cluster.html https://adamdrake.com/command-line-tools-can-be-235x-faster-...
- bqmjjx0kac 4y agoIf I were looking for bursts, SQL is not the first thing that comes to mind! Could you elaborate on this or sketch out the query?
- alexpotato 4y agoBasically, doing a group by at millisecond resolution with a sum on the IP packet length to get a rough metric for bandwidth. Once you have that, you can see the milliseconds with the highest bandwidth. Some extra math can also get you to Gigabits/second in a more network engineer friendly format.
- bqmjjx0kac 4y agoAha, group by millisecond! Thanks.
- anitil 4y agoI did a histogram-type thing in the same way by using a window function (similarly sqlite table scraped off pcap recordings). I can't remember if it was a fixed-width window (number of samples) or within some time window Dropped it in datasette with datasette-vega and got a nice little plot
- diptanu 4y agoI think this is a neat solution for an engineer working on their own and wants to go back and look at the data from various experiments. I don't see this scaling to many engineers working in a team, who would want to see each others experiment data, or even store artifacts like checkpoints and such. And lastly, in many cases ACLs are required as well when certain models trained with sensitive data shouldn't be shared with engineers outside of a team/group.