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

Vertex AI 試してみた / tried-vertex-ai

Vertex AI 試してみた / tried-vertex-ai

2022/04/24 (日) Python機械学習勉強会 in 新潟で発表した資料です。

82d6167c4d14393c2e20b37a74b363c5?s=128

kasacchiful

April 24, 2022
Tweet

More Decks by kasacchiful

Other Decks in Programming

Transcript

  1. Vertex AI ࢼͯ͠Έͨ Python ػցֶशษڧձ in ৽ׁ 2022-04-24 @kasacchiful

  2. Classmethod, Inc. Solutions Architect / Software Develper Favorite: Community: •

    JAWS-UG Niigata • Python ML in Niigata • JaSST Niigata • ASTER • SWANII • etc. Hiroshi Kasahara @kasacchiful @kasacchiful 2
  3. MLOpsͱ͸Կ͔ʁ

  4. MLOps • ػցֶशϓϩδΣΫτΛԁ׈ʹਐΊΔͨΊͷऔΓ૊Έɾମ੍ɾࢥ૝ • ػցֶशνʔϜ / ։ൃνʔϜ / ӡ༻νʔϜ ͕͓ޓ͍ʹڠௐ͠߹͏͜ͱ

    ͰɺػցֶशϞσϧͷ࣮૷͔Βӡ༻·ͰͷϥΠϑαΠΫϧΛԁ׈ʹਐ ΊɺܧଓతʹՁ஋Λఏڙ͢Δ͜ͱΛ໨తʹͯ͠Δ • DevOpsͷػցֶशϓϩδΣΫτ൛ • ʮ։ൃαΠΫϧͷ୹ॖʯʮ։ൃࣗମͷਝ଎Խʯʮ৴པੑߴ͍ϦϦʔεʯ ΛMLϓϩδΣΫτʹ΋
  5. MLγεςϜͷཁૉ IUUQTDMPVEHPPHMFDPNBSDIJUFDUVSFNMPQTDPOUJOVPVTEFMJWFSZBOEBVUPNBUJPOQJQFMJOFTJONBDIJOFMFBSOJOH

  6. MLOps Life Cycle IUUQTOFBMBOBMZUJDTDPNFYQFSUJTFNMPQT

  7. Continuous Delivery for Machine Learning end- to-end Process IUUQTNBSUJOGPXMFSDPNBSUJDMFTDENMIUNM

  8. MLOpsΠϯϑϥج൫ʹඞཁͳ͜ͱ • σʔλιʔεͱɺ͔ͦ͜Βੜ੒͞ΕΔσʔληοτͷ؅ཧ • ֶशࡁϞσϧͷ؅ཧ • CI / CDؚΜͩMLσϦόϦύΠϓϥΠϯ •

    Ұ࿈ͷδϣϒΛ؆୯ʹճͨ͢Ίͷίϯςφ
  9. Ұ͔Βߏங͢Δͷ͸େมͳͷͰ Ϋϥ΢υαʔϏε࢖͍͍ͨ

  10. MLOpsؔ࿈αʔϏε • AWS • Amazon SageMaker • Google Cloud •

    Vertex AI • Azure • Azure Machine Learning
  11. IUUQTQBHFTBXTDMPVEDPNST5;.JNBHFT@"84Ͱߏங͢Δ.-0QTج൫@഑෍൛@@"*.-5PLZPQEG

  12. IUUQTDMPVEHPPHMFDPNCMPHKBUPQJDTEFWFMPQFSTQSBDUJUJPOFSTOFXNMMFBSOJOHQBUIWFSUFYBJ

  13. ࠓճ͸Vertex AIΛࢼͯ͠Έͨ

  14. Vertex AIࢼͯ͠Έͨ • ϞσϧͷτϨʔχϯάɺσϓϩΠɺςετΛҰ௨Γࢼ͢ • AutoMLͷΫΠοΫελʔτΛϕʔεʹ࣮ࢪ • https://cloud.google.com/automl-tables/docs/quickstart?hl=ja • දܗࣜσʔλͷ෼ྨ

  15. σʔληοτ

  16. σʔληοτ

  17. σʔληοτ

  18. τϨʔχϯά

  19. τϨʔχϯά

  20. τϨʔχϯά

  21. τϨʔχϯά

  22. σϓϩΠ

  23. σϓϩΠ

  24. σϓϩΠ

  25. σϓϩΠ

  26. ςετ

  27. curlͰࢼ͢ curl -X POST \ -H "Authorization: Bearer $(gcloud auth

    print-access-token)" \ -H "Content-Type: application/json" \ https://asia-northeast1-aiplatform.googleapis.com/v1/projects/${PROJECT_ID}/locations/asia-northeast1/endpoints/${ENDPOINT_ID}:predict \ -d “@${INPUT_DATA_FILE} " { "predictions": [ { "classes": [ "1" , "2 " ] , "scores": [ 0.98835468292236328 , 0.0116453049704432 5 ] } ] , "deployedModelId": "8383556259466444800" , "model": "projects/1066851579090/locations/asia-northeast1/models/6083061274810253312" , "modelDisplayName": "sample_tabular_dataset_model " }
  28. ύΠϓϥΠϯ • kube fl ow pipelines ΋͘͠͸ Tensor fl ow

    Extended ͰύΠϓϥ ΠϯΛهࡌͯ͠ɺVertex AIʹొ ࿥ IUUQTDMPVEHPPHMFDPNCMPHKBQSPEVDUTBJNBDIJOFMFBSOJOHTFSWFSMFTTNBDIJOFMFBSOJOHQJQFMJOFTPOHPPHMFDMPVE
  29. MLOpsΠϯϑϥج൫ʹඞཁͳ͜ͱ • σʔλιʔεͱɺ͔ͦ͜Βੜ੒͞ΕΔσʔληοτͷ؅ཧ • Vertex AIͰ֤छσʔληοτΛ؅ཧͰ͖Δ • ֶशࡁϞσϧͷ؅ཧ • Ϟσϧͷόʔδϣϯ౳ͷ؅ཧ͕Մೳ

    • CI / CDؚΜͩMLσϦόϦύΠϓϥΠϯ • kebe fl ow pipelines΋͘͠͸Tensor fl ow ExtendedͰߏஙՄೳ • Ұ࿈ͷδϣϒΛ؆୯ʹճͨ͢Ίͷίϯςφ • طଘͷίϯςφར༻ͷ΄͔ɺΧελϜίϯςφ΋࢖༻Մೳ
  30. SageMaker / Vertex AI ͷػೳ σʔληοτ ͷ࡞੒ ਓྗʹΑΔΞ ϊςʔγϣϯ ࢧԉ

    ಛ௃ྔϦϙδ τϦ ύΠϓϥΠϯ ϞσϧͷධՁ σϓϩΠ ϞχλϦϯά 4BHF.BLFS 4BHF.BLFS %BUB 8SBOHMFS 4BHF.BLFS (SPVOE5SVU I 4BHF.BLFS 'FBUVSF 4UPSF 4BHF.BLFS 1JQFMJOF 4BHF.BLFS %FCVHHFS 4BHF.BLFS $MBSJGZ όονਪ࿦˓ ϦΞϧλΠϜ ਪ࿦˓ 4BHF.BLFS .PEFM .POJUFS 7FSUFY"* σʔληοτ ϥϕϧ෇λε Ϋ 7FSUFY"* 'FBUVSF 4UPSF 7FSUFY"* 1JQFMJOF ϞσϧͷධՁ όονਪ࿦˓ ϦΞϧλΠϜ ਪ࿦˓ 7FSUFY"* .POJUPSJOH
  31. ॴײ • ݁ߏGUI্Ͱૢ࡞Ͱ͖Δ͠ɺΘ͔Γ΍͍͢ • ಛʹAutoML • Vertex AIͷPython SDK͕༻ҙ͞ΕͯΔͷͰɺίʔυͰ؅ཧ΋Ͱ͖Δ •

    SageMaker΋Python SDK͕͋Δ • ଞͷGoogle CloudαʔϏεͱͷ࿈ܞํ๏͕Α͘Θ͔Βͳ͍ (ଟ෼Ͱ͖Δ ΜͩΖ͏͚Ͳ)
  32. ·ͱΊ • MLγεςϜߏஙͷࡍ͸ɺMLίʔυҎ֎ͷཁૉ΋ଟ͘ɺ࣌ؒ΋खؒ΋ ͔͔Δɻ • Ϋϥ΢υαʔϏεͷMLOpsؔ࿈ͷαʔϏεΛ͏·͘࢖͏͜ͱͰɺ࿑ ྗΛগͳͯ͘͠MLγεςϜΛߏஙɾӡ༻͢Δ͜ͱ͕Մೳ

  33. ͓͠·͍