Déploiement continu de modèle de
Machine Learning
Loïc DIVAD
Loïc DIVAD
Data Engineer
@loicmdivad
CI/CD & Machine Learning
Un contexte
Prédiction du chiffre d’affaire des équipements
3
Un cadre de développement
CI/CD & Machine Learning
“the right tool for the right job”
VCS CI REPO
4
Un cadre de développement
CI/CD & Machine Learning
“the right tool for the right job”
VCS CI REPOEXPLO
5
CI/CD & Machine Learning
Le modèle, quésaco ?
Training
App
y
Modèle
6
CI/CD & Machine Learning
Le modèle, quésaco ?
Training
App
y
ỹ
Modèle
7
Predicting
APP
Modèle
CI/CD & Machine Learning
Entraînement d’un modèle
Création d’un modèle sérialisable
VCS CI REPOEXPLO /apps/<myapp>/model_v1
8
CI/CD & Machine Learning
Entraînement sur de nouvelles données
“With more data comes great generalization power”
VCS CI REPOEXPLO
/apps/<myapp>/model_v1
/apps/<myapp>/model_v2
/apps/<myapp>/model_v3
…
/apps/<myapp>/model_v?
▼ Les notions de modèle en Production et de modèle Courant doivent être dissociées
▼ Les évolutions entre ces modèles doivent être traçables
▼ Les datasets utilisés doivent être identifiés
9
CI/CD & Machine Learning
Entraînement sur de nouvelles features
Develop, Deploy, Fit … Repeat
VCS CI REPOEXPLO
/apps/<myapp>/model_v1
/apps/<myapp>/model_v2
/apps/<myapp>/model_v3
…
/apps/<myapp>/model_v?
VCS CI REPOEXPLO
/apps/<myapp>/model_v41
/apps/<myapp>/model_v42
/apps/<myapp>/model_v43
…
/apps/<myapp>/model_v4?
Sprint N+1
10
11
CI/CD & Machine Learning
Intégration Continue de Modèles
DIY
12
Distribution
Features
extraction
Prediction
Source Ingestion
Source Ingestion
Source Ingestion
Model
Training
The Machine Learning Pipeline
13
DIY: Machine Learning Platform
Distribution
Features
extraction
Prediction
Source Ingestion
Source Ingestion
Source Ingestion
Model
Training
Release
The Machine Learning Pipeline
14
DIY: Machine Learning Platform
Une release continue
DIY: Machine Learning Platform
ỹ model_id
@app-dt01-<ts>
@app-dt01-<ts>
▼ Chaque modèle est versionné
▼ Des tags latest et current permettent de comparer le dernier modèle et celui en ligne
▼ Les prédictions s’accompagnent de la version du modèle
App
Modèle
15
@app-dt02-<ts>
Distribution
Features
extraction
Prediction
Source Ingestion
Source Ingestion
Source Ingestion
Model
Training
Release
Test
The Machine Learning Pipeline
16
DIY: Machine Learning Platform
Une évaluation automatisée
DIY: Machine Learning Platform
y ỹ model_id
@app-dt02-<ts>
@app-dt02-<ts>
@app-dt02-<ts>
L ( y , ỹ ) ↦ Score
nouveau
score
17
modèle
n-2
modèle
n-1
Distribution
Features
extraction
Prediction
Source Ingestion
Source Ingestion
Source Ingestion
Model
Training
Release
Report
Test
The Machine Learning Pipeline
18
DIY: Machine Learning Platform
Development
Release
Integration
Deployment
Séparation du code et du modèle
Entraînement du modèle sur les données de productions
Historisation des versions et jeux de données utilisés.
Evaluation des performances.
Tests de performance et comparaisons.
Extraction de l’importance des features et hyperparamètres
Mise en service d’un nouveau modèle
Conclusion
Conclusion
Machine Learning Platform
La machine learning plateforme, prochain outils de CI/CD
20
VCS CI REPOEXPLO
MERCI
21
22
ANNEXES ?
23
Parce qu’ils en parlent encore mieux
24
Déploiement continu de modèle de Machine Learning
Références
▼ Meet Michelangelo: Uber’s Machine Learning Platform
▼ Serving Machine Learning Models
▼ TFX: A TensorFlow-Based Machine Learning Platform
▼ Hidden Technical Debt in Machine Learning Systems
Distribution
Features
extraction
Prediction
Source Ingestion
Source Ingestion
Source Ingestion
Distribution
Model
Training
Release
Report
Test
The Machine Learning Pipeline
25
DIY: Machine Learning Platform
DIY: Machine Learning Platform
Machine Learning Platform
La machine learning plateforme, prochain outils de CI/CD
26
VCS CI REPOEXPLO
DIY: Machine Learning Platform
Projet Bold Eagle
La machine learning plateforme, mon outils de CI/CD
27
VCS CI REPOEXPLO
Services
API
Serving
28
+10ms 5s - 1mins 1 day
RCP
Servers :
Tensorflow
Serving
Prediction
Servers:
AWS Lambda,
Cloud AI
Structured
Streaming
-
Kafka
Based
Prediction
Batch
Predictions
Serving: un exemple pour du temps réel
29
Model serving architecture by Boris Lublinsky - from Serving Machine Learning Models
Data Source
Model Source
Model Storage
Current
Model
Processing Prediction
Stream Processor
THE VERY END
30
XebiCon'17 : Déploiement continu de modèle de Machine Learning - Loïc Divad

XebiCon'17 : Déploiement continu de modèle de Machine Learning - Loïc Divad