Software:Data Version Control

From HandWiki
DVC
Data Version Control. Official Logo by Iterative.ai
Original author(s)Dmitry Petrov
Developer(s)Iterative.ai
Initial releaseMay 4, 2017; 5 years ago
Stable release
2.30.0 / October 10, 2022; 1 day ago
Repositoryhttps://github.com/iterative/dvc
Written inPython
TypeMachine Learning CLI
LicenseApache - 2.0
Websitedvc.org

DVC is a free and open-source, platform-agnostic version system for data, machine learning models, and experiments.[1] It is designed to make ML models shareable, experiments reproducible,[2] and to track versions of models, data, and pipelines.[3][4][5] DVC works on top of Git repositories[6] and cloud storage.[7]

The first (beta) version of DVC 0.6 was launched in May 2017.[8] In May 2020, DVC 1.0 was publicly released by Iterative.ai.[9]

Overview

DVC is designed to incorporate the best practices of software development[10] into Machine Learning workflows.[11] It does this by extending the traditional software tool Git by cloud storages for datasets and Machine Learning models.[12]

Specifically, DVC makes Machine Learning operations:   

  • Codified: it codifies datasets and models by storing pointers to the data files in cloud storages.[3]
  • Reproducible: it allows users to reproduce experiments,[13] and rebuild datasets from raw data.[14] These features also allow to automate the construction of datasets, the training, evaluation, and deployment of ML models.[15]

DVC and Git

DVC stores large files and datasets in separate storage, outside of Git.[3] This storage can be on the user’s computer or hosted on any major cloud storage provider,[16][5] such as AWS S3, Google Cloud Storage, and Microsoft Azure Blob Storage.[17][18] DVC users may also set up a remote repository on any server and connect to it remotely.[3]

When a user stores their data and models in the remote repository, text file is created in their Git repository which points to the actual data in remote storage.[2][19]

Features

DVC's features can be divided into three categories: data management, pipelines, and experiment tracking.[20][21][18]

Data management

Data and model versioning is the base layer[22] of DVC for large files, datasets, and machine learning models. It allows the use of a standard Git workflow, but without the need to store those files in the repository. Large files, directories and ML models are replaced with small metafiles, which in turn point to the original data. Data is stored separately, allowing data scientists to transfer large datasets or share a model with others.[6]

DVC enables data versioning through codification.[23] When a user creates metafiles, describing what datasets, ML artifacts and other features to track, DVC makes it possible to capture versions of data and models, create and restore from snapshots, record evolving metrics, switch between versions, etc.[6]

Unique versions of data files and directories are cached[24] in a systematic way (also preventing file duplication). The working datastore is separated from the user’s workspace to keep the project light, but stays connected via file links handled automatically by DVC.[25]

Pipelines

DVC provides a mechanism to define and execute pipelines.[26][27] Pipelines represent the process of building ML datasets and models, from how data is preprocessed to how models are trained and evaluated.[28] Pipelines can also be used to deploy models into production environments.

DVC pipeline is focused on the experimentation phase of the ML process. Users can run multiple copies of a DVC pipeline by cloning a Git repository with the pipeline or running ML experiments. They can also record the workflow as a pipeline, and reproduce[29] it in the future.

Pipelines are represented in code as yaml [30] configuration files. These files define the stages of the pipeline and how data and information flows from one step to the next.

When a pipeline is run, the artifacts produced by that pipeline are registered in a dvc.lock file.[31] The lockfile records the stages that were run, and stores a hash of the resulting output for each stage.[26] Not only is it a record of the execution of the pipeline, but is also useful when deciding which steps must be rerun on subsequent executions of the pipeline.[28][20]

Experiment tracking

Experiment tracking allows developers to explore, iterate and compare different machine learning experiments.[22][20]

Each experiment represents a variation of a data science project defined by changes in the workspace. Experiments maintain a link to the commit in the current branch (Git HEAD)[32] as their parent or baseline. However, they do not form part of the regular Git tree (unless they are made persistent).[33] This stops temporary commits and branches from overflowing a user's repository.

Common use cases[34] for experiments are:

  1. Comparison of model architectures
  2. Comparison of training or evaluation datasets
  3. Selection of model hyperparameters

DVC experiments can be managed and visualized either from the VS Code IDE[35] or online using Iterative Studio.[36] Visualization[37] allows each user to compare experiment results visually, track plots and generate them with library integrations.

DVC offers several options[37] for using visualization in a regular workflow:

  • DVC can generate HTML files that include interactive plots from data series in JSON, YAML, CSV, or TSV format
  • DVC can keep track of image files produced as plot outputs[38] from the training/evaluation scripts
  • DVCLive[39] integrations can produce plots automatically during the training

The DVC VS Code extension

In 2022, Iterative released a free extension[40] for Visual Studio Code (VS Code), a source-code editor made by Microsoft, which provides VS Code users with the ability to use DVC in their editors with additional user interface functionality.[41][42]

History

In 2017,[43][44] the first (beta) version of DVC 0.6[45] was publicly released (as a simple command line tool).[44] It allowed data scientists to keep track of their machine learning processes and file dependencies in the simple form of git-like commands. It also allowed them to transform existing machine learning processes into reproducible DVC pipelines. DVC 0.6 solved most of the common problems that machine learning engineers and data scientists were facing:[46] the reproducibility of machine learning experiments, as well as data versioning and low levels of collaboration between teams.

Created by ex-Microsoft data scientist Dmitry Petrov, DVC aimed to integrate the best existing software development practices into machine learning operations.[46]

In 2018,[47] Dmitry Petrov together with Ivan Shcheklein, an engineer and entrepreneur, founded Iterative.ai,[4][48] an MLOps company that continued the development of DVC. Besides DVC, Iterative.ai is also behind open source tools like CML, MLEM, and Studio, the enterprise version of the open source tools.

In June 2020,[49] the Iterative.ai team released DVC 1.0. New features like multi-stage DVC files, run cache, plots, data transfer optimizations, hyperparameter tracking, and stable release cycles were added as a result of discussions and contributions from the community.

In March 2021,[50] DVC released DVC 2.0, which introduced ML experiments (experiment management), model checkpoints and metrics logging.

ML experiments: To solve the problem of Git overhead, when hundreds of experiments need to be run in a single day and each experiment run requires additional Git commands, DVC 2.0 introduced the lightweight experiments feature. It allows its users to auto-track ML experiments and capture code changes.

This eliminated the dependence upon additional services[51] by saving data versions as metadata in Git, as opposed to relegating it to external databases or APIs.[52]

ML model checkpoints versioning: The new release also enables versioning of all checkpoints with corresponding code and data.

Metrics logging: DVC 2.0 introduced a new open-source library DVC-Live that would provide functionality for tracking model metrics and organizing metrics in a way that DVC could visualize with navigation in Git history.

Alternative solutions to DVC

There are several open source projects that provide similar data version control capabilities to DVC,[53] such as: Git LFS, Dolt, and lakeFS. These projects vary in their fit to the different needs of data engineers and data scientists such as: scalability, supported file formats, support in tabular data and unstructured data, volume of data that are supported, and more.

References

  1. Hewage Nipuni, Meedeniya Dulani (February 2022). "Machine Learning Operations: A Survey on MLOps Tool Support". ResearchGate. https://www.researchgate.net/publication/358766274. 
  2. 2.0 2.1 Barrak Amine, Eghan Ellis E., Adams Bram (March 2021). "On the Co-evolution of ML Pipelines and Source Code - Empirical Study of DVC Projects". https://ieeexplore.ieee.org/document/9425888/authors#authors. 
  3. 3.0 3.1 3.2 3.3 Ivancic, Kristijan. "Data Version Control With Python and DVC". https://realpython.com/python-data-version-control/. 
  4. 4.0 4.1 Wiggers, Kyle. "MLOps startup Iterative.ai nabs $20M". VentureBeat. https://venturebeat.com/ai/mlops-startup-iterative-ai-nabs-20m/. 
  5. 5.0 5.1 "MLOps Company Iterative Achieves Significant Customer and Company Growth in 2021". Business Wire. https://www.businesswire.com/news/home/20220317005882/en/MLOps-Company-Iterative-Achieves-Significant-Customer-and-Company-Growth-in-2021. 
  6. 6.0 6.1 6.2 Hall, Susan. "Iterative.ai: Git-Based Machine Learning Tools for ML Engineers". https://thenewstack.io/iterative-ai-git-based-machine-learning-tools-for-data-engineers/. 
  7. "What is DVC?". https://mlops-guide.github.io/Versionamento/. 
  8. Petrov, Dmitry. "DVC 3 Years and 1.0 Pre-release". Iterative.ai. https://iterative.ai/blog/dvc-3-years-and-1-0-release. 
  9. Anadiotis, George. "Streamlining data science with open source: Data version control and continuous machine learning". https://www.zdnet.com/article/streamlining-data-science-with-open-source-data-version-control-and-continuous-machine-learning/. 
  10. Petrov, Dmitry. "The Road to AI Hell Starts with Good MLOps Intentions". The New Stack. https://thenewstack.io/the-road-to-ai-hell-starts-with-good-mlops-intentions/. 
  11. Ejaz, Nimra. "Data Version Control Explained". https://www.crowdbotics.com/blog/data-version-control-explained. 
  12. Lardinois, Frederic. "Iterative raises $20M for its MLOps platform". TechCrunch. https://techcrunch.com/2021/06/02/iterative-raises-20m-for-its-mlops-platform/. 
  13. "AITech interview with Dmitry Petrov, Co-Founder & CEO at Iterative.ai". https://ai-techpark.com/aitech-interview-with-dmitry-petrov-co-founder-ceo-at-iterative-ai/. 
  14. "Data Versioning for CD4ML – Part 2". https://aisingapore.org/2021/04/data-versioning-for-cd4ml-part-2/. 
  15. Baena, Daniel. "How to build an efficient Machine Learning project workflow using Data Version Control (DVC)". https://engineering.rappi.com/how-to-build-an-efficient-machine-learning-project-workflow-using-data-version-control-dvc-aaeaa9cfb79b. 
  16. "DVC Documentation. Supported storage types". https://dvc.org/doc/command-reference/remote/add#supported-storage-types. 
  17. Vizard, Michael. "Iterative.ai updates MLOps platform to streamline and support cloud provisioning". VentureBeat. https://venturebeat.com/ai/iterative-ai-updates-mlops-platform-to-streamline-and-support-cloud-provisioning/. 
  18. 18.0 18.1 Kulkarni, Amit. "Tracking ML Experiments With Data Version Control". https://www.analyticsvidhya.com/blog/2021/06/mlops-tracking-ml-experiments-with-data-version-control/. 
  19. Tran, Khuyen. "Introduction to DVC: Data Version Control Tool for Machine Learning Projects". https://towardsdatascience.com/introduction-to-dvc-data-version-control-tool-for-machine-learning-projects-7cb49c229fe0. 
  20. 20.0 20.1 20.2 "Introduction to Data Version Control(DVC)". https://www.kaggle.com/code/kurianbenoy/introduction-to-data-version-control-dvc/notebook#Compare-Expermiments. 
  21. Guerrapin, Basile. "Using DVC to create an efficient version control system for data projects". https://medium.com/qonto-way/using-dvc-to-create-an-efficient-version-control-system-for-data-projects-96efd94355fe. 
  22. 22.0 22.1 "DVC Documentation. Get Started". https://dvc.org/doc/start. 
  23. "DVC Documentation. Versioning Data and Models". https://dvc.org/doc/use-cases/versioning-data-and-models. 
  24. "DVC Documentation. Internal Directories and Files". https://dvc.org/doc/user-guide/project-structure/internal-files#structure-of-the-cache-directory. 
  25. "DVC Documentation. Large Dataset Optimization". https://dvc.org/doc/user-guide/data-management/large-dataset-optimization#file-link-types-for-the-dvc-cache. 
  26. 26.0 26.1 "Working with Pipelines". https://mlops-guide.github.io/Versionamento/pipelines_dvc/. 
  27. "DVC Documentation. Get Started: Data Pipelines". https://dvc.org/doc/start/data-management/data-pipelines. 
  28. 28.0 28.1 Idowu Samuel, Strüber Daniel, Berger Thorsten. "Asset Management in Machine Learning: A Survey". Astrophysics Data System (ADS). https://ui.adsabs.harvard.edu/abs/2021arXiv210206919I/abstract. 
  29. Kapoor Sayash, Narayanan Arvind. "Leakage and the Reproducibility Crisis in ML-based Science". ResearchGate. https://www.researchgate.net/publication/362011990. 
  30. "DVC Documentation. dvc.yaml". https://dvc.org/doc/user-guide/project-structure/dvcyaml-files. 
  31. "DVC Documentation. dvc.lock file". https://dvc.org/doc/user-guide/project-structure/dvcyaml-files#dvclock-file. 
  32. "DVC Documentation. DVC Experiments Overview". https://dvc.org/doc/user-guide/experiment-management/experiments-overview. 
  33. "DVC Documentation. Persisting Experiments". https://dvc.org/doc/user-guide/experiment-management/persisting-experiments. 
  34. "How we keep track of our data experiments". https://kapernikov.com/how-we-keep-track-of-our-data-experiments/. 
  35. "DVC Extension for Visual Studio Code". https://marketplace.visualstudio.com/items?itemName=Iterative.dvc. 
  36. "Iterative Introduces First Git-based Machine Learning Model Registry". Yahoo Finance. https://finance.yahoo.com/news/iterative-introduces-first-git-based-130000776.html. 
  37. 37.0 37.1 "DVC Documentation. Get Started: Visualization with Plots". https://dvc.org/doc/start/experiment-management/visualization. 
  38. "DVC Documentation. Metrics and Plots outputs". https://dvc.org/doc/user-guide/project-structure/dvcyaml-files#metrics-and-plots-outputs. 
  39. "DVC Documentation. DVCLive with DVC". https://dvc.org/doc/dvclive/dvclive-with-dvc. 
  40. Nicholls, Emily. "Iterative Announces A Free Extension To Microsoft Visual Studio Code To Accelerate ML Model Development Experience". https://www.tfir.io/iterative-announces-a-free-extension-to-microsoft-visual-studio-code-to-accelerate-ml-model-development-experience/. 
  41. Bhartiya, Swapnil. "Iterative's DVC Extension Turns VS Code Into ML Experimentation Platform". https://www.tfir.io/iteratives-dvc-extension-turns-vs-code-into-ml-experimentation-platform/. 
  42. Awan, Abid Ali. "12 Essential VSCode Extensions for Data Science". https://www.kdnuggets.com/2022/07/12-essential-vscode-extensions-data-science.html. 
  43. "DVC 3 Years and 1.0 Pre-release". https://iterative.ai/blog/dvc-3-years-and-1-0-release. 
  44. 44.0 44.1 "Data Version Control Explained". https://www.crowdbotics.com/blog/data-version-control-explained. 
  45. Petrov, Dmitry. "Data Version Control: iterative machine learning". https://www.kdnuggets.com/2017/05/data-version-control-iterative-machine-learning.html. 
  46. 46.0 46.1 Vázquez, Favio. "Data version control with DVC. What do the authors have to say?". https://towardsdatascience.com/data-version-control-with-dvc-what-do-the-authors-have-to-say-3c3b10f27ee. 
  47. Smolaks, Max. "Iterative.ai pitches open source alternative to AWS SageMaker and Azure ML Engineer". https://aibusiness.com/ml/iterative-ai-pitches-open-source-alternative-to-aws-sagemaker-and-azure-ml-engineer. 
  48. Singh, Swastik. "An open-source startup Iterative.ai raises USD 20 Million". https://www.vcbay.news/2021/06/03/an-open-source-startup-iterative-ai-raises-usd-20-million/. 
  49. "DVC 1.0 release: new features for MLOps". https://iterative.ai/blog/dvc-1-0-release. 
  50. "DVC 2.0 Release". https://iterative.ai/blog/dvc-2-0-release. 
  51. "DVC Documentation. Experiment Management". https://dvc.org/doc/user-guide/experiment-management. 
  52. "DVC Documentation. Related Technologies". https://dvc.org/doc/user-guide/overview#comparison-with-related-technologies. 
  53. Orr, Einat. "Data versioning as your 'Get out of jail' card – DVC vs. Git-LFS vs. dolt vs. lakeFS". https://lakefs.io/blog/dvc-vs-git-vs-dolt-vs-lakefs//. 

External links