Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
メルカリのマーケット健全化施策を支えるML基盤
Search
Hirofumi Nakagawa/中河 宏文
May 23, 2018
Programming
10
8.9k
メルカリのマーケット健全化施策を支えるML基盤
Hirofumi Nakagawa/中河 宏文
May 23, 2018
Tweet
Share
More Decks by Hirofumi Nakagawa/中河 宏文
See All by Hirofumi Nakagawa/中河 宏文
IoTデバイスでMLモデルを動かす技術
hnakagawa
0
140
Kanazawa_AI.pdf
hnakagawa
0
160
メルカリ写真検索における Amazon EKS の活用事例と プロダクトにおけるEdgeAI technologyの展望
hnakagawa
5
8.7k
メルカリの写真検索を支えるバックエンド CCSE 2019 version
hnakagawa
0
260
メルカリ写真検索における Amazon EKS の活用事例
hnakagawa
6
29k
メルカリの写真検索を支えるバックエンド
hnakagawa
1
1.1k
Mercari ML Platform
hnakagawa
1
17k
mlct.pdf
hnakagawa
2
2k
機械学習によるマーケット健全化施策を支える技術
hnakagawa
0
210
Other Decks in Programming
See All in Programming
Identifying User Idenity
moro
4
5.2k
Piniaの現状と今後
waka292
5
1.3k
GPU Hash Table | レイトレ合宿10
yknishidate
0
360
/←このスケジュール表に立ち向かう フロントエンド開発戦略 / A front-end development strategy to tackle a single-slash schedule.
nrslib
1
570
テスト駆動開発✅️
akitoshiga
1
200
CSC305 Lecture 13
javiergs
PRO
0
120
From Subtype Polymorphism To Typeclass-based Ad hoc Polymorphism- An Example
philipschwarz
PRO
0
100
いかにして不足・不整合なくデータ移行したか
tjmtmmnk
1
1k
プロジェクト新規参入者のリードタイム短縮の観点から見る、品質の高いコードとアーキテクチャを保つメリット
d_endo
1
890
カスタムしながら理解するGraphQL Connection
yanagii
0
620
OpenTelemetryでRailsのパフォーマンス分析を始めてみよう(KoR2024)
ymtdzzz
3
800
Dev ContainersとGitHub Codespacesの素敵な関係
ymd65536
1
110
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
167
49k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
355
29k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
504
140k
Done Done
chrislema
181
16k
How to train your dragon (web standard)
notwaldorf
88
5.6k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
41
9.2k
Designing Experiences People Love
moore
138
23k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
106
49k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
664
120k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Git: the NoSQL Database
bkeepers
PRO
425
64k
Transcript
ϝϧΧϦͷϚʔέοτ݈શԽ ࢪࡦΛࢧ͑ΔMLج൫ Mercari ML Ops Night Vol.1 hnakagawa
ࣗݾհ • Hirofumi Nakagawa (hnakagawa) • 20177݄ೖࣾ • ॴଐSRE •
σόΠευϥΠό։ൃ͔Βϑϩϯ τΤϯυ։ൃ·ͰΔԿͰ • NOT MLΤϯδχΞ • https://github.com/hnakagawa
͓ࣄ • ML Platform։ൃ • MLΤϯδχΞͱSREͷεΩϧΪϟοϓΛຒΊ Δ • ML Reliability,
SysML?, MLOps? • SREͷཱ͔ΒMLγεςϜͷࣗಈԽΛߦ͏
ML Platform • ͷML Platform • kubernetesϕʔε • ϩʔΧϧڥͱΫϥελڥͷ ࠩΛநԽ͢Δ
• ศརAPI܈ • طଘͷML FrameworkΛ༻͠ ؆୯ʹTraining/ServingΛߦ͏ ڥΛఏڙ
ͦͷ͏ͪOSSͰެ։༧ఆ(ଟ
ࣄྫ ϦΞϧλΠϜࢹγεςϜ • ௨শ Lovemachine • ML Platform্ʹ࣮͞Ε͍ͯΔ .-1MBUGPSN USBJOJOHDMVTUFS
-PWFNBDIJOF ($4 GKE PubSub .-1MBUGPSN TFSWJOHDMVTUFS -PWFNBDIJOF
Model Training & Serving Workflow
.-1MBUGPSN USBJOJOHDMVTUFS Workflow for Production $* .-1MBUGPSN TFSWJOHDMVTUFSGPSUFTU .PEFM3FHJTUSZ +PC
+PC ɾɾ 3&45 "1* 4USFBNJOH 5' 4FSWJOH ɾɾɾ
.-1MBUGPSN USBJOJOHDMVTUFS Training Workflow $* .PEFM3FHJTUSZ +PC +PC ɾɾɾ 1.
GitHubͷpushΛτϦΨʹtrainingΛىಈ 2. Training͞ΕͨModelModel Registry ্͕Δ
Serving Workflow .-1MBUGPSN TFSWJOHDMVTUFSGPSUFTU .PEFM3FHJTUSZ ɾɾ 3&45 "1* 4USFBNJOH 5'
4FSWJOH ɾɾɾ 1. Model RegistryΛࢹͯࣗ͠ಈͰModel ΛServing 2. Serving&Test͕ޭ͢Δͱຊ൪༻k8s manifestΛग़ྗ
Model Serving APIͷߏྫ 5FOTPS'MPX 4FSWJOH 5' .PEFM 5' .PEFM 'MBTL
4, .PEFM 4, .PEFM 4, .PEFM gRPC .FSDBSJ"1* REST FlaskͰલॲཧΛߦ͍ ཪͷTensorFlow Servingʹ͍͛ͯΔ
Model Serving API Streaming ver ͷߏྫ 5FOTPS'MPX 4FSWJOH 5' .PEFM
5' .PEFM .-1MBUGPSN 'SBNFXPSL PS "QBDIF#FBN 4, .PEFM 4, .PEFM 4, .PEFM gRPC PubSub
TensorFlow Serving • TensorFlow project͕ఏڙͯ͠ ͍ΔServingڥ • PythonॲཧܥΛհͣ͞ʹTFͷ modelΛservingͰ͖Δ •
ඪ४ͷ࣮ͰgRPCͰAPIΛ ఏڙ
ModelͱίϯςφɾΠϝʔδ • ڊେͳML ModelΛίϯςφɾΠϝʔδʹؚΊ Δ͔൱͔ • ؚΊͳ͍ͷͰ͋ΕԿॲʹஔ͢Δ͔ • ϙʔλϏϦςΟੑͱϩʔυ࣌ؒͷτϨʔυΦϑ •
ྑ͍ΞΠσΟΞ͕͋Εڭ͑ͯԼ͍͞…
௨ৗͷAPIͱҧ͏ • ѻ͏ϦιʔεɺModelαΠζ͕େ͖͘ͳΔ ߹͕ଟ͍(ඦMBʙGB) • CPUɾϝϞϦϦιʔεͷফඅ͕ܹ͍͠ • ߹ʹΑͬͯGPU͏
ϝϞϦফඅ • LovemachineͷPython࣮෦࣮ߦ࣌ʹ 2GBϝϞϦΛফඅ͢Δˠࠓޙ͞Βʹ૿͑Δ༧ ఆ͋Δ • Scikit-learnͰهड़͞ΕͨTF-IDFͷલॲཧ෦ ͕େ͖͘ͳΔࣄ͕ଟ͍
Pythonͱฒྻੑ • વThread͕͑ͳ͍(GILͷͨΊ) • ϓϩηεຖʹModelΛϩʔυ͢Δͱඞཁͳϝ ϞϦαΠζ͕େ͖͘ͳΔˠ Blue-Green DeployͷোʹͳΔ
ਖ਼PythonͰͷServing Πϯϑϥతʹਏ͍ࣄ͕ଟ͍…
ϝϞϦΛݡ͘͏ • fork͢ΔલʹmodelΛϩʔυ͠Copy on Write Λޮ͔͢ • k8sͷone process per
containerηΦϦ͋ ͑ͯഁ͍ͬͯΔ
Copy On Writeͷ෮श ϝϞϦ ϓϩηε ࢠϓϩηε 2.fork 1BHF" 1.allocation ಉ͡ྖҬΛࢀর
ϓϩηε͕ϝϞϦͷ༰Λ ॻ͖͑Δͱ… ϝϞϦ ϓϩηε ࢠϓϩηε 1BHF" 1BHF# OS͕ผͷྖҬΛAllocationͯ͠ݩσʔλΛίϐʔ͢Δ ผͷྖҬΛࢀর
Current Issues • ਓؒͷߦಈΛ૬खʹ͍ͯ͠Δҝɺσʔλͷ ͕มΘΓ͔ͬͨ͢Γɺ༧֎ͷ͕ൃ ੜͨ͠Γͯ͠ɺରԠ͠ଓ͚Δඞཁ͕͋Δ ˠ ML Model࡞ऀʹෛ୲ֻ͕͔Γଓ͚Δ ˠ
SREͱͯࣗ͠ಈԽΛؚΜͩΈͰղܾ ͍ͨ͠
In Progress • ࣾͷσʔλ͔ΒEmbedding͢Δ࣮Λίϯ ϙʔωϯτԽ • ಛఆͷΛղܾ͢ΔϞσϧߏஙΛ͋Δఔ ࣗಈԽ ˠࣾͷղܾʹಛԽͨ͠ઐ༻ͷAutoMLత ͳԿ͔
AutoFlow(Ծ) 'FBUVSF&YUSBDUJPO $PNQPOFOUT $MBTTJpDBUJPO $PNQPOFOUT $PODBUFOBUJPO $PNQPOFOUT .PEFM #VJMEFS $PNQPOFOUT
3FHJTUSZ Ϋϥελ্ͰϞσϧͷࣗಈߏஙͱϋΠύʔύϥ ϝʔλͷࣗಈௐΛߦ͏
·ͱΊ • MLʹগ͠௨ৗͱҧ͏Πϯϑϥ͕ඞཁʹͳΔ ˠ·ͩϕετɾϓϥΫςΟε͔Βͳ͍ • ͦͦMLͳػೳΛຊ֨ӡ༻͠Α͏ͱ͢Δ ͱɺେ෯ͳࣗಈԽɾΈԽΛਐΊͳ͍ͱ্ ख͘ߦ͔ͳ͍
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠!!
We are Hiring!!
SRE ML Reliability • SysML? MLOps? ৽͍͠Job description • SREεΩϧ+MLͷجૅࣝ
• MLΠϯϑϥͷࣗಈԽɾΈԽΛਪ͠ਐΊͯ ͘ΕΔਓࡐ • ͪΖΜଞͷ৬छઈࢍืूத!!
ৄࡉͪ͜Β https://careers.mercari.com/