speeding up machine learning development with mlflow
play

Speeding Up Machine Learning Development with MLflow Hien Luu - PowerPoint PPT Presentation

Speeding Up Machine Learning Development with MLflow Hien Luu Agenda Unique Challenges in ML Development Process Machine Learning Platform Tour Introduction to MLflow Demo ML Development Process Overview Hidden Technical Debt in


  1. Speeding Up Machine Learning Development with MLflow Hien Luu

  2. Agenda • Unique Challenges in ML Development Process • Machine Learning Platform Tour • Introduction to MLflow • Demo

  3. ML Development Process Overview Hidden Technical Debt in Machine Learning Systems (paper from Google) The required surrounding infrastructure is vast & complex

  4. ML Development Process Overview Software 2.0 Model Data Driven Driven New dawn of a new age of software

  5. ML Development Process Overview Software vs Model Development Software Model Optimize for business metric Meet function requirements Goal Depend on data, code, algorithm, Quality Depend on code parameters Tool Many tools and libraties Standardized stack Changing with data Fairly deterministic Outcome

  6. ML Development Process Overview Machine Learning Development Dimensions Experimentation Environments Big Data

  7. ML Development Process Overview Experimentation Dimension Model Performance Data Algorithm Parameters Machine Learning develooment is a scientific endeavor

  8. ML Development Process Overview Multiple Environments Dimension Data Features Training Evaluation Prediction Online Offline

  9. ML Development Process Overview Data Volume Dimension Machine Learning Pipeline & ML Training Infrastructure

  10. Machine Learning Platform Tour Other Challenges Moving To Model Driven People Process Technology Scientific exploration and engineering rigorous and automation

  11. ML Development Process Overview Separation of Concerns Create Business Values Data Scientist Model Development & Experimentation Feature Engineering Model Training, Deployment & Management Compute Resources ML Platform ML Pipeline & Workflow Management Data Lake & Feature Store https://medium.com/netflix-techblog/open-sourcing-metaflow-a-human-centric-framework-for-data-science-fa72e04a5d9

  12. ML Development Process Overview ML development vs traditional software development

  13. Machine Learning Platform Tour In-house Machine Learning Platforms Michelangelo Google TFX FBLearner ML as-a-service AI Backbone ML as-a-service Deploying production ML pipelines Automation, productivity and fast iteration

  14. Machine Learning Platform Tour Anatomy of Machine Learning Platform Feature Model Model Model Model Infrastructure Training Management Serving Monitoring Minimize incidental complexity in Machine Learning to increase efficiency

  15. Machine Learning Platform Tour Facebook - FBLearner Productivity, reusability, scalability, and ease-of-use

  16. Machine Learning Platform Tour Uber - Michelangelo Democratize & scale AI to make it as easy as requesting a ride ML as software engineering Iterative, tested, and methodical

  17. Machine Learning Platform Tour LinkedIn - Pro-ML Use Cases • Feeds To double • Search effectiveness • Recommendation of ML engineers • Advertisement • Fraud https://towardsdatascience.com/introducing-pro-ml-68f37574e1f4

  18. Machine Learning Platform Tour Cloud Based Machine Learning Platforms Machine Learning as a Service - MLaaS Google Cloud AWS SageMaker Azure ML Machine Learning Engine Major pain points associated with a machine learning project dramatically change as the scale of the project increases.

  19. Machine Learning Platform Tour Pre-trained Machine Learning Models Vision Speech Language Chat bots, disease predictions, Translation, language detection Text within image, facial expressions fake news

  20. Machine Learning Platform Tour Cloud MLaaS AI Services (Computer vision, object recognition, NLP) ML Services (ML IDE, experimentation, model training, management & monitoring) ML Frameworks & Compute Infrastructure (Tensorflow, Pytorch, Caffe, GPUs, Kubernetes, prediction infrastructure)

  21. MLflow – Open ML Platform Principles • Open • Ease of use • Extensible • Scalable Manage the ML lifecycle, including experimentation, reproducibility and deployment

  22. MLflow – Open ML Platform Tracking Project Model Model Registry Record and query Packaging format for Model format that experiments Model lifecycle reproducible runs on standardize (code, configs, management various platforms deployment data,result)

  23. MLflow – Tracking Tracking Record and query experiments: code, configs, results, …etc Track and analyze experiments

  24. MLflow – Tracking Tracking Experiments “ML experimentation is like the wild west. Ad-hoc tools and processes because of a lack of standardized tooling. Forget reproducibility, it is difficult to track experiments and results.” https://towardsdatascience.com/tracking-ml-experiments-using-mlflow-7910197091bb

  25. MLflow – Tracking Notebooks Tracking APIs (REST, Python, Java, R) Applications UI Key Concepts • K-V parameters Tracking Server • Metrics • Artifacts API Cloud Jobs • Source code • Version (git) • Tags & notes Metadata Artifacts

  26. MLflow – Tracking Python, R, Java, REST Recently added: mlflow.keras.autolog()

  27. MLflow – Open ML Platform • UI Demo • Show MLFlow parameter and metric logging • Visualize the experiments • mlflow ui • http://127.0.0.1:7000/#/

  28. MLflow – Projects Projects Packaging format for reproducible runs on any platform Reproducibility via self-contained ML project specification

  29. MLflow – Open ML Platform Local Execution Project Spec Code Config Remote Execution Dependencies Data Reproducibility, Sharing, Productionalization

  30. MLflow – Projects my_project/ conda_env : conda.yaml ├── MLproject │ entry_points: │ main: │ parameters : │ training_data: path │ lambda: {type: float, default: 0.1} ├── conda.yaml command : python main.py {training_data} ├── main.py {lambda} └── model.py ... $ mlflow run <directory> or git://<my_project > mlflow.run(“<directory> or git://<my_project >”)

  31. MLflow – Projects • Demo • mlflow run <local directory> • mlflow run <github>

  32. MLflow – Models Models General model format that supports diverse deployment tools Simplify model deployment

  33. MLflow – Models ML Frameworks Serving Tools Inference Code Model Format Flavor 1 Flavor 2 Batch & Stream Scoring Standard for ML models

  34. MLflow – Models mlflow mlflow.tensorflow.log_model .tensorflow.log_model(...) (...) run_id: <uuid> my_model/ time_created: 2019-06-20T08:11 ├── MLmodel flavors: flavors: │ tensorflow: tensorflow │ saved_model_dir: estimator │ │ signature_def_key: predict │ python_function: python_function └ estimator/ loader_module: ├─ saved_model.pb mlflow.tensorflow └─ variables/ ...

  35. MLflow – Models Model Flavors predict = mlflow.pyfunc.load_pyfunc(…) predict(input_dataframe) Built-In Flavors Python Function • R,H 2 O • Keras • Mleap • PyTorch • Skiki-learn • Spark Mllib • TensorFlow • ONNX •

  36. MLflow – Model Registry Model Registry Model lifecycle management Collaboratively manage the full lifecycle of a model

  37. MLflow – Model Registry Managing Models Collaboratively • Model administration and review • Sharing, versioning, approval workflow • Integrate with MLflow tracking • Centralized activity logs and comments • Integration with CI/CD

  38. MLflow • Demo • Deploy model to a REST endpoint • mlflow models serve • Simple application to call REST endpoint to perform prediction • Flask application

  39. Summary • Interesting & unique challenges with ML development process • In-house & cloud-based ML infrastructures • MLflow – open source ML platform • Tracking • Project • Model • Model registry

  40. Q&A

  41. Machine Learning Platform Tour Google - TFX

  42. ML Development Process Overview Data Data Software People Engineer Scientist Engineer Technologies Environments

  43. Machine Learning Platform Tour AWS AI Platform

  44. Machine Learning Platform Tour Google AI Platform

  45. Machine Learning Platform Tour Azure AI Platform

  46. MLflow – Models • Packaging format for ML Model • Directory structure • Different flavors • (keras, pytorch, sklearn, spark, tensorflow) • Define dependencies • Easy reproducibility & deployment • Model creation utilities • To save model in MLFlow format • Deployment APIs • CLI – Python,R,Java

  47. MLflow – Projects • Packaging format for reproducible for ML runs • Training code folder or Github repository • Project configuration file in YMAL format • Define dependencies for reproducibility • Using Conda to specifying and managing dependencies • Execution API for running projects • Local or remote execution • CLI – Python,R,Java • mlflow run

Recommend


More recommend