Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Alice in the world of machine learning

Alice in the world of machine learning

"Alice traveled to the world of pods and higher-order functions and all the knowledge she acquired motivated her to become a Scala developer. Part of her work now includes helping out her fellow data scientists colleagues. And there’s one task which only she can do with her knowledge of Kubernetes. Will Alice be able to gather her knowledge and deploy ML models with Kubeflow? You will find out in this talk."
Presented at Data Love 2021 - virtually

Roksolana

April 16, 2021
Tweet

More Decks by Roksolana

Other Decks in Programming

Transcript

  1. Roksolana Diachuk • Big Data Developer at Captify • Diversity

    & Inclusion ambassador for Captify Kyiv o ff ice • Women Who Code Kyiv Data Engineering Lead and Mentor • Speaker and traveller
  2. Alice came back from vacation and decided to change something

    in her life. She realised that she got bored working as backend engineer and decided to switch to big data engineering.
  3. Central dashboard Istio Kube fl ow pipelines Argo Katib TFJobs

    KFServing, Seldon,
 TFServing Data ingestion Data analysis Data transformation Data validation Trainer Model evaluation and validation Serving Logging Jupiter MinIO
  4. Central dashboard Istio Kube fl ow pipelines Argo Katib TFJobs

    KFServing, Seldon,
 TFServing Data ingestion Data analysis Data transformation Data validation Trainer Model evaluation and validation Serving Logging Shared utilities for garbage collection, data access control Pipeline storage Shared con fi guration framework and job orchestration Integrated frontend for job management, monitoring, debugging, data/model visualisation Jupiter MinIO Tuner
  5. Central dashboard Istio Kube fl ow pipelines Argo Jupiter Katib

    MinIO TFJobs KFServing, Seldon,
 TFServing Data ingestion Data analysis Data transformation Data validation Trainer Model evaluation and validation Serving Logging Kubernetes operators Persistent volume Argo Work fl ows Ingress gateway Service account
  6. gcloud services enable \ compute.googleapis.com \ container.googleapis.com \ iam.googleapis.com \

    servicemanagement.googleapis.com \ cloudresourcemanagemer.googleapis.com \ ml.googleapis.com \ meshcon fi g.googleapis.com
  7. CRD CRD Pod Pod API server Pipeline service DSL compiler

    component.py component.yaml Argo controllers Kube fl ow pipeline execution
  8. image_name = gcr.io/$PROJECT_ID/kube fl ow/train image_tag = latest
 full_image_name =

    ${image_name}:${image_tag} cd “$(dirname “$0”)” docker build —build-arg -t “${full_image_name}” . docker push “$full_image_name”
  9. name: train description: Trains entity recognition model. inputs: - {name:

    Input x URI, type: GCSPath} - {name: Input y URI, type: GCSPath} - {name: Input job dir URI, type: GCSPath} - {name: Input tags, type: Integer} - {name: Input dropout, type: Integer} - {name: Output model URI template, type: GCSPath} …
  10. outputs: - name: Output model URI - type: GCSPath implementation:

    container: image: gcr.io/<PROJECT-ID>/kube fl ow/train:latest …
  11. command: [ python3, /pipelines/component/src/train.py, —input-x-path, {inputValue: Input x URI}, —input-job-dir,

    {inputValue: Input job dir URI}, —input-y-path, {inputValue: Input y URI}, —input-tags, {inputValue: Input tags, type: Integer}, —input-words, {inputValue: Input dropout}, —input-dropout, {inputValue: Output model URI template}, —output-model-path- fi le, {outputPath: Output model URI} ]
  12. pipeline_func = pipeline pipeline_ fi lename = pipeline_func._name_ + ‘.pipeline.zip’

    Import kfp.compiler as compiler compiler.Compiler().compile(pipeline_func, pipeline_ fi lename)
 Compiling pipeline
  13. arguments = {} run_name = pipeline_func.__name__ + ‘run' run_result =

    client.run_pipeline(experiment.id, run_name, pipeline_ fi lename,
 arguments) Running pipeline
  14. pipeline run 1 pipeline run 2 pipeline run 3 Run

    name Status Accuracy score 98,4% 98,86% 97,65% Training metrics
  15. Test your model with sample input data { “instances”: [London

    on Monday evening]} Test { “instances”: [weather in London today]}