Share
Embed
MLSE論文読み会: A Case for Serverless Machine Learning
NeurIPS 2018, System for ML で発表されたA Case for Serverless Machine Learningについての解説。論文は http://learningsys.org/nips18/assets/papers/101CameraReadySubmissioncirrus_nips_final2.pdf
Masaki Samejima
February 08, 2019
Transcript
15 slides
-
© 2019, Amazon Web Services, Inc. or its Affiliates. All
rights reserved. Masaki Samejima, Amazon Web Services Japan 2019.2.8 堣唒㷕统䊨㷕灇瑔⠓ (MLSE) NeurIPS 2018 Systems for ML 锷俑铣⠓ A Case for Serverless Machine Learning -
© 2019, Amazon Web Services, Inc. or its Affiliates. All
rights reserved. 锷俑嚊銲 J. Carreira, et al., A Case for Serverless Machine Learning • 堣唒㷕统ؒٝآص،כ؟٦غ盖椚׃ֻזְ • ؟٦غ盖椚ׇ׆ח؝٦سֽ㹋遤ׅ؟٦غ٦ٖأח״ג 堣唒㷕统㹋植ׅ鑐 • ؟٦غ٦ٖأד⚛Ⳣ椚ׅPyWrenٓ؎ـٓٔⵃ欽׃גծ堣唒 㷕统㹋遤٥嗚鏾 -
© 2019, Amazon Web Services, Inc. or its Affiliates. All
rights reserved. 堣唒㷕统ٙ٦ؙؿٗ٦ֶֽ铬겗 ر٦ةךⳢ椚 Ⰻر٦ة垥彊⻉זו 铣鴥䚍腉ָꅾ銲 㷕统 غحثך铣鴥 鎘皾䚍腉ָꅾ銲 ع؎ػ٦ػًٓ٦ة 锃侭 醱侧ظ٦سדך㹋遤 -
© 2019, Amazon Web Services, Inc. or its Affiliates. All
rights reserved. ؟٦غ٦ٖأך،فٗ٦ث Fig. 2 ؟٦غٖأ؟٦ؽأךأ؛٦ٕկ ず儗㹋遤侧㟓װׅה简䕎חծ ػؿؓ٦وٝأָ♳ָկ -
© 2019, Amazon Web Services, Inc. or its Affiliates. All
rights reserved. ؟٦غ٦ٖأךⵖꣲ (1/2) • Small local memory and storage. • ⢽ִלծAWS Lambdaכ3GBךRAM • TensorflowװSpark⹛ַֿׅהכדֹזְ • Low Network bandwidth and no P2P communication. • 侧⼧MB/s 玎䏝ך䌒㚖 • 醱侧鎘皾ظ٦سך鸐⥋ָر٦ةإٝةך圓䧭♳鹼ְ〳腉䚍 -
© 2019, Amazon Web Services, Inc. or its Affiliates. All
rights reserved. ؟٦غ٦ٖأךⵖꣲ (2/2) • Short-lived and unpredictable launch times. • Lack of Fast Shared Storage. -
© 2019, Amazon Web Services, Inc. or its Affiliates. All
rights reserved. ؟٦غ٦ٖأ橆㞮ך崞欽倯岀 Python API 堣唒㷕统ؒٝ آص،ָ䪔ְ װְׅAPI Client-side backend Worker Runtime • أزٖ٦آַך غحث《⳿׃ • 堣唒㷕统ٓ؎ـٓٔ ⴓ侔ر٦ةأز، • ر٦ةךⰟ剣 • ػًٓ٦ة؟٦غ ؟٦غ٦ٖأךⵖꣲ⯘剪ׅח䗳銲ז堣腉 Workerך饯⹛٥ 鹌遤朐屣盖椚 ! ! ! 堣唒㷕统 ؒٝآص، -
© 2019, Amazon Web Services, Inc. or its Affiliates. All
rights reserved. Python API ח״㹋鄲⢽: Ⳣ椚 s3_input = "criteo_dataset” s3_output = "criteo_norm” load_libsvm( path, s3_input) normalize( s3_input, s3_output, MIN_MAX_SCALING) LibSVM䕎䒭ךCriteoךر٦ة إحز铣鴥דأزٖ٦ آח،حفٗ٦س أزٖ٦آךر٦ة MIN_MAX_SCALINGד垥彊⻉ ׃ծأزٖ٦آחⴽせד⥂㶷 -
© 2019, Amazon Web Services, Inc. or its Affiliates. All
rights reserved. params = { ’n_workers’: 5, ’n_ps’: 1 , ’worker_size’: 1024, ’dataset’: s3_output, ’epsilon’: 0.0001, ’timeout’: 20 * 60, ’model_size’: 2**19, } lr_task = LogisticRegression(params) result = lr_task.run() Python API ח״㹋鄲⢽: 㷕统 ر٦ةإحزךؿٕؓتװծ 㷕统ךػًٓ٦ة鏣㹀 Logistic 㔐䌓ךㄎן⳿׃ה㹋遤 -
© 2019, Amazon Web Services, Inc. or its Affiliates. All
rights reserved. lrates = np.arange(0.1, 10, 0.1) minibatch_size = [100, 1000] gs = GridSearch( task=LRegression, param_base=basic_params, hyper_vars=["learning_rate", "minibach_size"], hyper_params=[lrates, minibatch_sizes]) results = gs.run() Python API ח״㹋鄲⢽: ع؎ػ٦ػًٓ٦ة锃侭 ع؎ػ٦ػًٓ٦ةך 䱱稊眔㔲 ع؎ػ٦ػًٓ٦ة锃侭 ך㹋遤 Grid Searchךⵃ欽 -
© 2019, Amazon Web Services, Inc. or its Affiliates. All
rights reserved. 鐰⣣㹋꿀 ر٦ةإحز Criteo CTR Prediction Dataset 嫰鯰䩛岀 https://www.kaggle.com/c/criteo-display-ad-challenge • Serverless ML (䲿周ⰻ㺁) + PyWren • ؟٦غ٦ٖأדٗآأذ؍ؙأ㔐䌓⚛㹋遤 • 㷕统،ٕ؞ٔؤيכSGD • 10⚛דAWS Lambda (3GB RAM) 㹋遤 • Bosen • VM♳דٗآأذ؍ؙأ㔐䌓⚛㹋遤 • 㷕统،ٕ؞ٔؤيכSGD • 1אךVM (EC2, m5.2xlarge: 2CPUs, 8GB RAM) ד㹋遤 -
© 2019, Amazon Web Services, Inc. or its Affiliates. All
rights reserved. PyWren PyWren lets you run your existing python code at massive scale via AWS Lambda http://pywren.io/ def my_function(b): x = np.random.normal(0, b, 1024) A = np.random.normal(0, b, (1024, 1024)) return np.dot(A, x) pwex = pywren.default_executor() res = pwex.map(my_function, np.linspace(0.1, 100, 1000)) • 0.1ַ100תדך1000⦐ך⦼החծmy_function (dot product)鎘皾 • PyWrenכmy_functionך鎘皾؟٦غ٦ٖأח䫎־ג⚛Ⳣ椚ׅ ⢽) -
© 2019, Amazon Web Services, Inc. or its Affiliates. All
rights reserved. 㹋꿀穠卓 • ML ؟٦غ٦ٖأכծBosenח 㼎׃גծٗأָ♴ָגֶ׆ծ ꬊ䌢ח鹼ְ • 鸞䏝ָ鹼ְ⾱㔓ה׃גכծredis ַך铣《ךؔ٦غ٦قحس ָ㣐ְֹ • Baseline (䊨㣗ז׃ךPyWren)ח 㼎׃גRedisךⵃ欽זו剑黝⻉ 遤ֲה何㊣ׅ⫘ぢח֮ -
© 2019, Amazon Web Services, Inc. or its Affiliates. All
rights reserved. 㹋遤儗ךⴓ匿 • أزٖ٦آַىصغح ث《⳿ׅהֿכ鹼 ֻזְ • Redisַٌرٕٗ٦سծ ⺟ꂁ鷏⥋ׅהָֿ 鹼ְ -
© 2019, Amazon Web Services, Inc. or its Affiliates. All
rights reserved. Discussion: ML ؟٦غ٦ٖأ㹋植ׅחכ • 넝鸞זⰟ剣أزٖ٦آ • ➙㔐כRedis䱰欽׃ָծ劍䖉ׅ鸞䏝ָ⳿גְזְկ • MLח暴⻉׃ػًٓ٦ةⰟ剣ׅأزٖ٦آָ䗳銲ַ׃ זְկ • GPU؟ه٦ز • Deep Learningח䗳銲זGPU؟ه٦ز׃גְזְկ