@xdev-asia/xdev-knowledge-mcp 1.0.43 → 1.0.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/content/pages/xoa-du-lieu-nguoi-dung.md +68 -0
- package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/01-phan-1-data-engineering/lessons/01-bai-1-data-repositories-ingestion.md +5 -0
- package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/01-phan-1-data-engineering/lessons/02-bai-2-data-transformation.md +5 -0
- package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/01-phan-1-data-engineering/lessons/03-bai-3-data-analysis.md +159 -0
- package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/02-phan-2-modeling/lessons/04-bai-4-sagemaker-built-in-algorithms.md +186 -0
- package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/02-phan-2-modeling/lessons/05-bai-5-training-hyperparameter-tuning.md +159 -0
- package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/02-phan-2-modeling/lessons/06-bai-6-model-evaluation.md +169 -0
- package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/03-phan-3-implementation-operations/lessons/07-bai-7-model-deployment.md +193 -0
- package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/03-phan-3-implementation-operations/lessons/08-bai-8-model-monitoring-mlops.md +184 -0
- package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/03-phan-3-implementation-operations/lessons/09-bai-9-security-cost.md +166 -0
- package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/04-phan-4-on-tap/lessons/10-bai-10-bai-toan-thuong-gap.md +181 -0
- package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/04-phan-4-on-tap/lessons/11-bai-11-cheat-sheet.md +110 -0
- package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/04-phan-4-on-tap/lessons/12-bai-12-chien-luoc-thi.md +113 -0
- package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/index.md +1 -1
- package/content/series/luyen-thi/luyen-thi-cka/chapters/01-cluster-architecture/lessons/01-kien-truc-cka-kubeadm.md +133 -0
- package/content/series/luyen-thi/luyen-thi-cka/chapters/01-cluster-architecture/lessons/02-cluster-upgrade-kubeadm.md +147 -0
- package/content/series/luyen-thi/luyen-thi-cka/chapters/01-cluster-architecture/lessons/03-rbac-cka.md +152 -0
- package/content/series/luyen-thi/luyen-thi-cka/chapters/02-workloads-scheduling/lessons/04-deployments-daemonsets-statefulsets.md +186 -0
- package/content/series/luyen-thi/luyen-thi-cka/chapters/02-workloads-scheduling/lessons/05-scheduling-taints-affinity.md +163 -0
- package/content/series/luyen-thi/luyen-thi-cka/chapters/03-services-networking/lessons/06-services-endpoints-coredns.md +145 -0
- package/content/series/luyen-thi/luyen-thi-cka/chapters/03-services-networking/lessons/07-ingress-networkpolicies-cni.md +172 -0
- package/content/series/luyen-thi/luyen-thi-cka/chapters/04-storage/lessons/08-persistent-volumes-storageclass.md +159 -0
- package/content/series/luyen-thi/luyen-thi-cka/chapters/05-troubleshooting/lessons/09-etcd-backup-restore.md +149 -0
- package/content/series/luyen-thi/luyen-thi-cka/chapters/05-troubleshooting/lessons/10-troubleshooting-nodes.md +153 -0
- package/content/series/luyen-thi/luyen-thi-cka/chapters/05-troubleshooting/lessons/11-troubleshooting-workloads.md +146 -0
- package/content/series/luyen-thi/luyen-thi-cka/chapters/05-troubleshooting/lessons/12-troubleshooting-networking-exam.md +170 -0
- package/content/series/luyen-thi/luyen-thi-cka/index.md +217 -0
- package/content/series/luyen-thi/luyen-thi-ckad/chapters/01-app-design-build/lessons/01-multi-container-pods.md +146 -0
- package/content/series/luyen-thi/luyen-thi-ckad/chapters/01-app-design-build/lessons/02-jobs-cronjobs-resources.md +174 -0
- package/content/series/luyen-thi/luyen-thi-ckad/chapters/02-app-deployment/lessons/03-rolling-updates-rollbacks.md +148 -0
- package/content/series/luyen-thi/luyen-thi-ckad/chapters/02-app-deployment/lessons/04-helm-kustomize.md +181 -0
- package/content/series/luyen-thi/luyen-thi-ckad/chapters/03-app-observability/lessons/05-probes-logging-debugging.md +183 -0
- package/content/series/luyen-thi/luyen-thi-ckad/chapters/04-app-environment-config/lessons/06-configmaps-secrets.md +182 -0
- package/content/series/luyen-thi/luyen-thi-ckad/chapters/04-app-environment-config/lessons/07-securitycontext-pod-security.md +168 -0
- package/content/series/luyen-thi/luyen-thi-ckad/chapters/04-app-environment-config/lessons/08-resources-qos.md +168 -0
- package/content/series/luyen-thi/luyen-thi-ckad/chapters/05-services-networking/lessons/09-services-ingress.md +182 -0
- package/content/series/luyen-thi/luyen-thi-ckad/chapters/05-services-networking/lessons/10-networkpolicies-exam-strategy.md +236 -0
- package/content/series/luyen-thi/luyen-thi-ckad/index.md +199 -0
- package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/01-phan-1-problem-framing/lessons/01-bai-1-framing-ml-problems.md +136 -0
- package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/01-phan-1-problem-framing/lessons/02-bai-2-gcp-ai-ml-ecosystem.md +160 -0
- package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/02-phan-2-data-engineering/lessons/03-bai-3-data-pipeline.md +174 -0
- package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/02-phan-2-data-engineering/lessons/04-bai-4-feature-engineering.md +156 -0
- package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/03-phan-3-model-development/lessons/05-bai-5-vertex-ai-training.md +155 -0
- package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/03-phan-3-model-development/lessons/06-bai-6-bigquery-ml-tensorflow.md +141 -0
- package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/04-phan-4-deployment-mlops/lessons/07-bai-7-model-deployment.md +134 -0
- package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/04-phan-4-deployment-mlops/lessons/08-bai-8-vertex-ai-pipelines-mlops.md +149 -0
- package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/05-phan-5-responsible-ai/lessons/09-bai-9-responsible-ai.md +128 -0
- package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/05-phan-5-responsible-ai/lessons/10-bai-10-cheat-sheet-chien-luoc-thi.md +108 -0
- package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/index.md +1 -1
- package/content/series/luyen-thi/luyen-thi-kcna/chapters/01-kubernetes-fundamentals/lessons/01-kien-truc-kubernetes.md +137 -0
- package/content/series/luyen-thi/luyen-thi-kcna/chapters/01-kubernetes-fundamentals/lessons/02-pods-workloads-controllers.md +142 -0
- package/content/series/luyen-thi/luyen-thi-kcna/chapters/01-kubernetes-fundamentals/lessons/03-services-networking-storage.md +155 -0
- package/content/series/luyen-thi/luyen-thi-kcna/chapters/01-kubernetes-fundamentals/lessons/04-rbac-security.md +137 -0
- package/content/series/luyen-thi/luyen-thi-kcna/chapters/02-container-orchestration/lessons/05-container-runtimes-oci.md +137 -0
- package/content/series/luyen-thi/luyen-thi-kcna/chapters/02-container-orchestration/lessons/06-orchestration-patterns.md +147 -0
- package/content/series/luyen-thi/luyen-thi-kcna/chapters/03-cloud-native-architecture/lessons/07-cloud-native-architecture.md +143 -0
- package/content/series/luyen-thi/luyen-thi-kcna/chapters/04-observability-delivery/lessons/08-observability.md +143 -0
- package/content/series/luyen-thi/luyen-thi-kcna/chapters/04-observability-delivery/lessons/09-helm-gitops-cicd.md +162 -0
- package/content/series/luyen-thi/luyen-thi-kcna/index.md +168 -0
- package/data/quizzes.json +1059 -0
- package/package.json +1 -1
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: 019c9619-lt03-l05
|
|
3
|
+
title: 'Bài 5: Vertex AI Training — Custom & AutoML'
|
|
4
|
+
slug: bai-5-vertex-ai-training
|
|
5
|
+
description: >-
|
|
6
|
+
Custom Training Jobs: pre-built containers, custom containers.
|
|
7
|
+
Distributed training trên GPU/TPU. AutoML: Tabular, Image, Text, Video.
|
|
8
|
+
Training pipeline setup. Hyperparameter tuning service.
|
|
9
|
+
duration_minutes: 60
|
|
10
|
+
is_free: true
|
|
11
|
+
video_url: null
|
|
12
|
+
sort_order: 5
|
|
13
|
+
section_title: "Phần 3: Model Development trên Vertex AI"
|
|
14
|
+
course:
|
|
15
|
+
id: 019c9619-lt03-7003-c003-lt0300000003
|
|
16
|
+
title: 'Luyện thi Google Cloud Professional Machine Learning Engineer'
|
|
17
|
+
slug: luyen-thi-gcp-ml-engineer
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
<div style="text-align: center; margin: 2rem 0;">
|
|
21
|
+
<img src="/storage/uploads/2026/04/gcp-mle-bai5-vertex-training.png" alt="Vertex AI Custom Training" style="max-width: 800px; width: 100%; border-radius: 12px;" />
|
|
22
|
+
<p><em>Vertex AI Custom Training: Training Jobs, AutoML, phân tán distributed training và tối ưu</em></p>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<h2 id="custom-training"><strong>1. Vertex AI Custom Training</strong></h2>
|
|
26
|
+
|
|
27
|
+
<p>Custom Training cho phép bạn chạy training code của mình trên Google Cloud infrastructure. Có 2 cách đóng gói code:</p>
|
|
28
|
+
|
|
29
|
+
<table>
|
|
30
|
+
<thead><tr><th>Method</th><th>Description</th><th>When to Use</th></tr></thead>
|
|
31
|
+
<tbody>
|
|
32
|
+
<tr><td><strong>Pre-built containers</strong></td><td>GCP-provided containers: TF, PyTorch, Scikit-learn, XGBoost</td><td>Standard ML frameworks, fast setup</td></tr>
|
|
33
|
+
<tr><td><strong>Custom containers</strong></td><td>Build your own Docker image</td><td>Custom dependencies, special environments</td></tr>
|
|
34
|
+
</tbody>
|
|
35
|
+
</table>
|
|
36
|
+
|
|
37
|
+
<pre><code class="language-text">Custom Training Job Structure:
|
|
38
|
+
|
|
39
|
+
training_package/ (Python package or Docker image)
|
|
40
|
+
│
|
|
41
|
+
├── trainer/
|
|
42
|
+
│ ├── __init__.py
|
|
43
|
+
│ ├── task.py ← entry point (main training script)
|
|
44
|
+
│ └── model.py ← model definition
|
|
45
|
+
│
|
|
46
|
+
└── setup.py
|
|
47
|
+
|
|
48
|
+
Arguments passed via:
|
|
49
|
+
TRAINING_DATA_URI: gs://bucket/data/
|
|
50
|
+
TRAINING_OUTPUT_URI: gs://bucket/model/
|
|
51
|
+
Hyperparameters: --learning-rate=0.001
|
|
52
|
+
</code></pre>
|
|
53
|
+
|
|
54
|
+
<h2 id="compute-options"><strong>2. Compute Options</strong></h2>
|
|
55
|
+
|
|
56
|
+
<table>
|
|
57
|
+
<thead><tr><th>Hardware</th><th>Best For</th><th>Notes</th></tr></thead>
|
|
58
|
+
<tbody>
|
|
59
|
+
<tr><td><strong>CPU</strong></td><td>Scikit-learn, small tabular</td><td>Cheapest, no GPU parallelism</td></tr>
|
|
60
|
+
<tr><td><strong>GPU (T4, A100, V100)</strong></td><td>Deep learning, NLP, CV</td><td>10-100x faster than CPU for DL</td></tr>
|
|
61
|
+
<tr><td><strong>TPU v3, v4</strong></td><td>TensorFlow large-scale training</td><td>Google-specific; very fast for TF/JAX</td></tr>
|
|
62
|
+
</tbody>
|
|
63
|
+
</table>
|
|
64
|
+
|
|
65
|
+
<blockquote>
|
|
66
|
+
<p><strong>Exam tip:</strong> TPU is Google-specific hardware optimized for TensorFlow and JAX. GPUs work with all frameworks. TPUs are most cost-effective for very large TF models; GPUs are more versatile. Exam may ask "most cost-effective for TensorFlow large-scale" → TPU.</p>
|
|
67
|
+
</blockquote>
|
|
68
|
+
|
|
69
|
+
<h2 id="distributed-training"><strong>3. Distributed Training on Vertex AI</strong></h2>
|
|
70
|
+
|
|
71
|
+
<table>
|
|
72
|
+
<thead><tr><th>Strategy</th><th>Description</th><th>Use Case</th></tr></thead>
|
|
73
|
+
<tbody>
|
|
74
|
+
<tr><td><strong>Data Parallelism</strong></td><td>Split data across workers, same model</td><td>Most DL training scenarios</td></tr>
|
|
75
|
+
<tr><td><strong>Model Parallelism</strong></td><td>Split model layers across workers</td><td>Model too large for one GPU</td></tr>
|
|
76
|
+
<tr><td><strong>MirroredStrategy (TF)</strong></td><td>Multi-GPU, single machine</td><td>Single node, multiple GPUs</td></tr>
|
|
77
|
+
<tr><td><strong>MultiWorkerMirroredStrategy</strong></td><td>Multi-GPU, multi-machine</td><td>Cluster training</td></tr>
|
|
78
|
+
<tr><td><strong>ParameterServerStrategy</strong></td><td>Async updates via parameter server</td><td>Very large models (legacy)</td></tr>
|
|
79
|
+
</tbody>
|
|
80
|
+
</table>
|
|
81
|
+
|
|
82
|
+
<h2 id="automl"><strong>4. Vertex AI AutoML</strong></h2>
|
|
83
|
+
|
|
84
|
+
<table>
|
|
85
|
+
<thead><tr><th>AutoML Type</th><th>Input Data</th><th>Supported Tasks</th></tr></thead>
|
|
86
|
+
<tbody>
|
|
87
|
+
<tr><td><strong>AutoML Tabular</strong></td><td>CSV, BigQuery table</td><td>Classification, Regression, Forecasting</td></tr>
|
|
88
|
+
<tr><td><strong>AutoML Image</strong></td><td>JPEG, PNG, BMP</td><td>Classification (single/multi), Object Detection, Segmentation</td></tr>
|
|
89
|
+
<tr><td><strong>AutoML Text</strong></td><td>Text documents</td><td>Classification, Entity Extraction, Sentiment</td></tr>
|
|
90
|
+
<tr><td><strong>AutoML Video</strong></td><td>MP4, AVI, MOV</td><td>Classification, Object Detection, Action Recognition</td></tr>
|
|
91
|
+
</tbody>
|
|
92
|
+
</table>
|
|
93
|
+
|
|
94
|
+
<h2 id="hyperparameter-tuning"><strong>5. Vertex AI Hyperparameter Tuning</strong></h2>
|
|
95
|
+
|
|
96
|
+
<p>Vertex AI Hyperparameter Tuning tự động tìm hyperparameter combinations tốt nhất.</p>
|
|
97
|
+
|
|
98
|
+
<table>
|
|
99
|
+
<thead><tr><th>Search Algorithm</th><th>Description</th></tr></thead>
|
|
100
|
+
<tbody>
|
|
101
|
+
<tr><td><strong>Grid Search</strong></td><td>Exhaustive, expensive; small search space</td></tr>
|
|
102
|
+
<tr><td><strong>Random Search</strong></td><td>Random sampling; often better than grid</td></tr>
|
|
103
|
+
<tr><td><strong>Bayesian Optimization</strong></td><td>Smart search using Gaussian Process; most efficient</td></tr>
|
|
104
|
+
</tbody>
|
|
105
|
+
</table>
|
|
106
|
+
|
|
107
|
+
<pre><code class="language-text">HPT Job Setup:
|
|
108
|
+
|
|
109
|
+
hyperparameters:
|
|
110
|
+
- parameter_id: learning_rate
|
|
111
|
+
type: DOUBLE
|
|
112
|
+
min_value: 0.0001
|
|
113
|
+
max_value: 0.1
|
|
114
|
+
scale: LOG ← log scale for LR
|
|
115
|
+
|
|
116
|
+
- parameter_id: batch_size
|
|
117
|
+
type: INTEGER
|
|
118
|
+
values: [32, 64, 128, 256]
|
|
119
|
+
|
|
120
|
+
metric:
|
|
121
|
+
metric_id: val_accuracy
|
|
122
|
+
goal: MAXIMIZE
|
|
123
|
+
|
|
124
|
+
max_trial_count: 50
|
|
125
|
+
parallel_trial_count: 5
|
|
126
|
+
</code></pre>
|
|
127
|
+
|
|
128
|
+
<h2 id="practice"><strong>6. Practice Questions</strong></h2>
|
|
129
|
+
|
|
130
|
+
<p><strong>Q1:</strong> A team wants to train a custom TensorFlow model across multiple machines with 8 GPUs each. They want gradients synchronized across all workers without a parameter server. Which TensorFlow distribution strategy should they use?</p>
|
|
131
|
+
<ul>
|
|
132
|
+
<li>A) MirroredStrategy</li>
|
|
133
|
+
<li>B) MultiWorkerMirroredStrategy ✓</li>
|
|
134
|
+
<li>C) ParameterServerStrategy</li>
|
|
135
|
+
<li>D) TPUStrategy</li>
|
|
136
|
+
</ul>
|
|
137
|
+
<p><em>Explanation: MultiWorkerMirroredStrategy enables synchronous data-parallel training across multiple machines, each with multiple GPUs. MirroredStrategy is single-machine multi-GPU only. ParameterServerStrategy uses asynchronous updates. TPUStrategy is for TPU pods.</em></p>
|
|
138
|
+
|
|
139
|
+
<p><strong>Q2:</strong> A company needs to train an image classification model but their team has no deep learning expertise. They have 5,000 labeled product images. Which Vertex AI option requires the LEAST ML expertise?</p>
|
|
140
|
+
<ul>
|
|
141
|
+
<li>A) Vertex AI Custom Training with TensorFlow CNN</li>
|
|
142
|
+
<li>B) Vertex AI AutoML Image Classification ✓</li>
|
|
143
|
+
<li>C) Dataproc Spark ML</li>
|
|
144
|
+
<li>D) BigQuery ML</li>
|
|
145
|
+
</ul>
|
|
146
|
+
<p><em>Explanation: AutoML Image Classification handles architecture selection, hyperparameter tuning, and training automatically. A team just needs to upload labeled images and specify the task. No code or deep learning expertise is required.</em></p>
|
|
147
|
+
|
|
148
|
+
<p><strong>Q3:</strong> Which hyperparameter search strategy is MOST efficient when evaluating expensive-to-train deep learning models with a large search space?</p>
|
|
149
|
+
<ul>
|
|
150
|
+
<li>A) Grid Search — tests all combinations</li>
|
|
151
|
+
<li>B) Random Search — samples uniformly</li>
|
|
152
|
+
<li>C) Bayesian Optimization — uses past trial results to guide search ✓</li>
|
|
153
|
+
<li>D) Manual tuning — expert selects parameters</li>
|
|
154
|
+
</ul>
|
|
155
|
+
<p><em>Explanation: Bayesian Optimization builds a probabilistic model of the objective function using Gaussian Processes to intelligently select the next hyperparameter configuration to evaluate, based on past trial results. It finds good configurations with far fewer trials than grid or random search.</em></p>
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: 019c9619-lt03-l06
|
|
3
|
+
title: 'Bài 6: BigQuery ML & TensorFlow on GCP'
|
|
4
|
+
slug: bai-6-bigquery-ml-tensorflow
|
|
5
|
+
description: >-
|
|
6
|
+
BigQuery ML: CREATE MODEL syntax, supported models.
|
|
7
|
+
TensorFlow Extended (TFX) pipeline components.
|
|
8
|
+
TFServing, TFLite. Model optimization techniques.
|
|
9
|
+
duration_minutes: 60
|
|
10
|
+
is_free: true
|
|
11
|
+
video_url: null
|
|
12
|
+
sort_order: 6
|
|
13
|
+
section_title: "Phần 3: Model Development trên Vertex AI"
|
|
14
|
+
course:
|
|
15
|
+
id: 019c9619-lt03-7003-c003-lt0300000003
|
|
16
|
+
title: 'Luyện thi Google Cloud Professional Machine Learning Engineer'
|
|
17
|
+
slug: luyen-thi-gcp-ml-engineer
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
<div style="text-align: center; margin: 2rem 0;">
|
|
21
|
+
<img src="/storage/uploads/2026/04/gcp-mle-bai6-bqml-tfx.png" alt="BigQuery ML & TFX Pipeline" style="max-width: 800px; width: 100%; border-radius: 12px;" />
|
|
22
|
+
<p><em>BigQuery ML và TFX Pipeline: train models bằng SQL, optimize model, và production ML pipelines</em></p>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<h2 id="bigquery-ml"><strong>1. BigQuery ML (BQML)</strong></h2>
|
|
26
|
+
|
|
27
|
+
<p>BigQuery ML cho phép data analysts train và serve ML models bằng SQL trong BigQuery — không cần export data, không cần biết framework ML.</p>
|
|
28
|
+
|
|
29
|
+
<pre><code class="language-text">BigQuery ML Workflow:
|
|
30
|
+
|
|
31
|
+
1. CREATE MODEL → train
|
|
32
|
+
2. ML.EVALUATE() → evaluate metrics
|
|
33
|
+
3. ML.PREDICT() → generate predictions
|
|
34
|
+
4. ML.EXPLAIN_PREDICT() → SHAP-based explanations
|
|
35
|
+
5. EXPORT MODEL → export to Cloud Storage (TF SavedModel format)
|
|
36
|
+
</code></pre>
|
|
37
|
+
|
|
38
|
+
<table>
|
|
39
|
+
<thead><tr><th>Model Type</th><th>BQML Option</th><th>Task</th></tr></thead>
|
|
40
|
+
<tbody>
|
|
41
|
+
<tr><td>Linear Regression</td><td>LINEAR_REG</td><td>Regression</td></tr>
|
|
42
|
+
<tr><td>Logistic Regression</td><td>LOGISTIC_REG</td><td>Binary/Multiclass classification</td></tr>
|
|
43
|
+
<tr><td>K-Means</td><td>KMEANS</td><td>Clustering</td></tr>
|
|
44
|
+
<tr><td>XGBoost</td><td>BOOSTED_TREE_CLASSIFIER / BOOSTED_TREE_REGRESSOR</td><td>Tabular classification/regression</td></tr>
|
|
45
|
+
<tr><td>Random Forest</td><td>RANDOM_FOREST_CLASSIFIER / RANDOM_FOREST_REGRESSOR</td><td>Tabular classification/regression</td></tr>
|
|
46
|
+
<tr><td>DNN</td><td>DNN_CLASSIFIER / DNN_REGRESSOR</td><td>Complex patterns</td></tr>
|
|
47
|
+
<tr><td>Wide & Deep</td><td>WIDE_AND_DEEP_CLASSIFIER</td><td>Recommendations (memorization + generalization)</td></tr>
|
|
48
|
+
<tr><td>AutoML</td><td>AUTOML_CLASSIFIER / AUTOML_REGRESSOR</td><td>Automated model selection</td></tr>
|
|
49
|
+
<tr><td>Time Series</td><td>ARIMA_PLUS</td><td>Forecasting</td></tr>
|
|
50
|
+
<tr><td>Matrix Factorization</td><td>MATRIX_FACTORIZATION</td><td>Collaborative filtering</td></tr>
|
|
51
|
+
</tbody>
|
|
52
|
+
</table>
|
|
53
|
+
|
|
54
|
+
<blockquote>
|
|
55
|
+
<p><strong>Exam tip:</strong> BQML ARIMA_PLUS tự động xử lý seasonality, holiday effects, trend decomposition. Khi đề hỏi "forecast using BigQuery data" → ARIMA_PLUS. Khi hỏi "recommendation system in BigQuery" → MATRIX_FACTORIZATION.</p>
|
|
56
|
+
</blockquote>
|
|
57
|
+
|
|
58
|
+
<h2 id="tfx"><strong>2. TensorFlow Extended (TFX)</strong></h2>
|
|
59
|
+
|
|
60
|
+
<p>TFX là production ML pipeline library dành cho TensorFlow. Cung cấp standard components cho mỗi bước trong ML lifecycle.</p>
|
|
61
|
+
|
|
62
|
+
<table>
|
|
63
|
+
<thead><tr><th>TFX Component</th><th>Purpose</th></tr></thead>
|
|
64
|
+
<tbody>
|
|
65
|
+
<tr><td><strong>ExampleGen</strong></td><td>Ingest data từ CSV, BigQuery, Avro, Parquet</td></tr>
|
|
66
|
+
<tr><td><strong>StatisticsGen</strong></td><td>Compute statistics về training data</td></tr>
|
|
67
|
+
<tr><td><strong>SchemaGen</strong></td><td>Infer schema từ statistics</td></tr>
|
|
68
|
+
<tr><td><strong>ExampleValidator</strong></td><td>Detect anomalies: missing, distribution skew</td></tr>
|
|
69
|
+
<tr><td><strong>Transform</strong></td><td>Feature engineering (Apache Beam-based)</td></tr>
|
|
70
|
+
<tr><td><strong>Trainer</strong></td><td>Train TF model (EvalSpec + TrainSpec)</td></tr>
|
|
71
|
+
<tr><td><strong>Tuner</strong></td><td>Hyperparameter tuning (KerasTuner)</td></tr>
|
|
72
|
+
<tr><td><strong>Evaluator</strong></td><td>Evaluate model against baseline</td></tr>
|
|
73
|
+
<tr><td><strong>ModelValidator</strong></td><td>Validate model meets quality thresholds</td></tr>
|
|
74
|
+
<tr><td><strong>Pusher</strong></td><td>Push model to serving (TF Serving, Vertex AI)</td></tr>
|
|
75
|
+
</tbody>
|
|
76
|
+
</table>
|
|
77
|
+
|
|
78
|
+
<pre><code class="language-text">TFX Pipeline (simplified):
|
|
79
|
+
|
|
80
|
+
ExampleGen → StatisticsGen → SchemaGen → ExampleValidator
|
|
81
|
+
↓
|
|
82
|
+
Transform (feature engineering)
|
|
83
|
+
↓
|
|
84
|
+
Trainer (model training)
|
|
85
|
+
↓
|
|
86
|
+
Evaluator (metrics vs baseline)
|
|
87
|
+
↓ (if pass)
|
|
88
|
+
Pusher → TF Serving / Vertex AI Endpoint
|
|
89
|
+
</code></pre>
|
|
90
|
+
|
|
91
|
+
<h2 id="tf-serving"><strong>3. TF Serving & TFLite</strong></h2>
|
|
92
|
+
|
|
93
|
+
<table>
|
|
94
|
+
<thead><tr><th>Option</th><th>Use Case</th></tr></thead>
|
|
95
|
+
<tbody>
|
|
96
|
+
<tr><td><strong>TF Serving</strong></td><td>High-performance serving trên server/cloud (gRPC or REST)</td></tr>
|
|
97
|
+
<tr><td><strong>TFLite</strong></td><td>Mobile devices, edge devices, microcontrollers</td></tr>
|
|
98
|
+
<tr><td><strong>TF.js</strong></td><td>Browser-based inference</td></tr>
|
|
99
|
+
</tbody>
|
|
100
|
+
</table>
|
|
101
|
+
|
|
102
|
+
<h2 id="model-optimization"><strong>4. Model Optimization Techniques</strong></h2>
|
|
103
|
+
|
|
104
|
+
<table>
|
|
105
|
+
<thead><tr><th>Technique</th><th>Description</th><th>Trade-off</th></tr></thead>
|
|
106
|
+
<tbody>
|
|
107
|
+
<tr><td><strong>Quantization</strong></td><td>Float32 → INT8 weights</td><td>4x smaller, ~2x faster, slight accuracy loss</td></tr>
|
|
108
|
+
<tr><td><strong>Pruning</strong></td><td>Remove low-weight connections</td><td>Smaller model, preserve accuracy</td></tr>
|
|
109
|
+
<tr><td><strong>Knowledge Distillation</strong></td><td>Train small "student" model from large "teacher"</td><td>Smaller + fast, slight accuracy loss</td></tr>
|
|
110
|
+
<tr><td><strong>TensorRT</strong></td><td>NVIDIA GPU optimization (layer fusion)</td><td>3-5x inference speedup on NVIDIA GPUs</td></tr>
|
|
111
|
+
</tbody>
|
|
112
|
+
</table>
|
|
113
|
+
|
|
114
|
+
<h2 id="practice"><strong>5. Practice Questions</strong></h2>
|
|
115
|
+
|
|
116
|
+
<p><strong>Q1:</strong> A data analyst team needs to build a sales forecasting model on data already in BigQuery. They are comfortable with SQL but have no Python/ML framework experience. Which BigQuery ML model type should they use for time series forecasting?</p>
|
|
117
|
+
<ul>
|
|
118
|
+
<li>A) KMEANS</li>
|
|
119
|
+
<li>B) LOGISTIC_REG</li>
|
|
120
|
+
<li>C) ARIMA_PLUS ✓</li>
|
|
121
|
+
<li>D) MATRIX_FACTORIZATION</li>
|
|
122
|
+
</ul>
|
|
123
|
+
<p><em>Explanation: BigQuery ML ARIMA_PLUS is designed for time series forecasting and automatically handles seasonality, trend, and holiday effects. It can be trained with a simple CREATE MODEL statement in SQL, requiring no Python expertise.</em></p>
|
|
124
|
+
|
|
125
|
+
<p><strong>Q2:</strong> A TFX pipeline is detecting that the distribution of the "age" feature in new production data differs significantly from the training data distribution. Which TFX component is responsible for detecting this anomaly?</p>
|
|
126
|
+
<ul>
|
|
127
|
+
<li>A) StatisticsGen</li>
|
|
128
|
+
<li>B) SchemaGen</li>
|
|
129
|
+
<li>C) ExampleValidator ✓</li>
|
|
130
|
+
<li>D) Transform</li>
|
|
131
|
+
</ul>
|
|
132
|
+
<p><em>Explanation: ExampleValidator compares data statistics against the expected schema and flags anomalies including distribution skew (significant difference between training and serving data distributions). StatisticsGen computes statistics; SchemaGen creates the schema; Transform does feature engineering.</em></p>
|
|
133
|
+
|
|
134
|
+
<p><strong>Q3:</strong> A team needs to deploy a TensorFlow image classification model to mobile devices with limited compute resources. They need to reduce model size by 4x with minimal accuracy loss. Which technique should they apply?</p>
|
|
135
|
+
<ul>
|
|
136
|
+
<li>A) Knowledge Distillation</li>
|
|
137
|
+
<li>B) Model Pruning</li>
|
|
138
|
+
<li>C) Post-training quantization (INT8) ✓</li>
|
|
139
|
+
<li>D) TensorRT optimization</li>
|
|
140
|
+
</ul>
|
|
141
|
+
<p><em>Explanation: Post-training quantization converts Float32 weights to INT8, reducing model size by approximately 4x and improving inference speed by 2x, with minimal accuracy loss for most models. TFLite supports INT8 quantization for mobile/edge deployment. TensorRT is for NVIDIA GPUs, not mobile.</em></p>
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: 019c9619-lt03-l07
|
|
3
|
+
title: 'Bài 7: Model Deployment & Prediction'
|
|
4
|
+
slug: bai-7-model-deployment
|
|
5
|
+
description: >-
|
|
6
|
+
Vertex AI Endpoints: online, batch prediction.
|
|
7
|
+
Model versioning, traffic splitting. Edge deployment.
|
|
8
|
+
Scaling config, GPU allocation.
|
|
9
|
+
duration_minutes: 60
|
|
10
|
+
is_free: true
|
|
11
|
+
video_url: null
|
|
12
|
+
sort_order: 7
|
|
13
|
+
section_title: "Phần 4: Model Deployment & MLOps"
|
|
14
|
+
course:
|
|
15
|
+
id: 019c9619-lt03-7003-c003-lt0300000003
|
|
16
|
+
title: 'Luyện thi Google Cloud Professional Machine Learning Engineer'
|
|
17
|
+
slug: luyen-thi-gcp-ml-engineer
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
<div style="text-align: center; margin: 2rem 0;">
|
|
21
|
+
<img src="/storage/uploads/2026/04/gcp-mle-bai7-deployment.png" alt="Vertex AI Model Deployment" style="max-width: 800px; width: 100%; border-radius: 12px;" />
|
|
22
|
+
<p><em>Vertex AI Deployment: Online Prediction, Batch Prediction, traffic splitting, và edge deployment</em></p>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<h2 id="deployment-types"><strong>1. Prediction Types on Vertex AI</strong></h2>
|
|
26
|
+
|
|
27
|
+
<table>
|
|
28
|
+
<thead><tr><th>Type</th><th>Latency</th><th>When to Use</th></tr></thead>
|
|
29
|
+
<tbody>
|
|
30
|
+
<tr><td><strong>Online Prediction</strong></td><td>Milliseconds (sync)</td><td>Real-time apps, user-facing APIs</td></tr>
|
|
31
|
+
<tr><td><strong>Batch Prediction</strong></td><td>Minutes/Hours (async)</td><td>Large datasets, scheduled scoring</td></tr>
|
|
32
|
+
<tr><td><strong>Streaming Prediction</strong></td><td>Near real-time</td><td>Pub/Sub events + Dataflow + Vertex AI</td></tr>
|
|
33
|
+
</tbody>
|
|
34
|
+
</table>
|
|
35
|
+
|
|
36
|
+
<h2 id="vertex-endpoints"><strong>2. Vertex AI Endpoints</strong></h2>
|
|
37
|
+
|
|
38
|
+
<pre><code class="language-text">Vertex AI Endpoint Architecture:
|
|
39
|
+
|
|
40
|
+
Client Request
|
|
41
|
+
↓
|
|
42
|
+
Vertex AI Endpoint (load balancer)
|
|
43
|
+
├── Model Version A (70% traffic)
|
|
44
|
+
│ └── Deployed Model (e.g., v1.0)
|
|
45
|
+
└── Model Version B (30% traffic) ← Canary/A-B test
|
|
46
|
+
└── Deployed Model (e.g., v1.1)
|
|
47
|
+
</code></pre>
|
|
48
|
+
|
|
49
|
+
<p>Mỗi Endpoint có thể có <strong>nhiều model versions</strong> với <strong>traffic splitting</strong> — dùng để A/B testing và canary deployments.</p>
|
|
50
|
+
|
|
51
|
+
<table>
|
|
52
|
+
<thead><tr><th>Feature</th><th>Details</th></tr></thead>
|
|
53
|
+
<tbody>
|
|
54
|
+
<tr><td><strong>Dedicated Endpoint</strong></td><td>Dedicated resources, lowest latency, higher cost</td></tr>
|
|
55
|
+
<tr><td><strong>Shared Endpoint</strong></td><td>Multi-tenant, lower cost, potential cold start</td></tr>
|
|
56
|
+
<tr><td><strong>Explanation</strong></td><td>Enable Vertex Explainability per deployed model</td></tr>
|
|
57
|
+
<tr><td><strong>Min/Max Replicas</strong></td><td>Autoscaling based on request rate</td></tr>
|
|
58
|
+
<tr><td><strong>GPU allocation</strong></td><td>Specify GPU type (NVIDIA T4, A100) per deployment</td></tr>
|
|
59
|
+
</tbody>
|
|
60
|
+
</table>
|
|
61
|
+
|
|
62
|
+
<blockquote>
|
|
63
|
+
<p><strong>Exam tip:</strong> Traffic splitting trong Vertex AI Endpoints là cách triển khai <strong>Canary deployment</strong> hoặc <strong>A/B testing</strong>. Câu hỏi "roll out new model version safely" → Traffic splitting (ví dụ: 90% old, 10% new).</p>
|
|
64
|
+
</blockquote>
|
|
65
|
+
|
|
66
|
+
<h2 id="batch-prediction"><strong>3. Batch Prediction</strong></h2>
|
|
67
|
+
|
|
68
|
+
<table>
|
|
69
|
+
<thead><tr><th>Property</th><th>Value</th></tr></thead>
|
|
70
|
+
<tbody>
|
|
71
|
+
<tr><td><strong>Input</strong></td><td>Cloud Storage (CSV, JSON, JSONL, TFRecords, Avro)</td></tr>
|
|
72
|
+
<tr><td><strong>Output</strong></td><td>Cloud Storage (predictions as JSON/CSV)</td></tr>
|
|
73
|
+
<tr><td><strong>No Endpoint needed</strong></td><td>Runs directly from Model Registry, no persistent endpoint</td></tr>
|
|
74
|
+
<tr><td><strong>Auto-scaling</strong></td><td>Scales to zero when done (cost-efficient)</td></tr>
|
|
75
|
+
<tr><td><strong>Accelerators</strong></td><td>Supports GPU/TPU for batch inference</td></tr>
|
|
76
|
+
</tbody>
|
|
77
|
+
</table>
|
|
78
|
+
|
|
79
|
+
<h2 id="model-versioning"><strong>4. Model Versioning & Registry</strong></h2>
|
|
80
|
+
|
|
81
|
+
<pre><code class="language-text">Vertex AI Model Registry:
|
|
82
|
+
|
|
83
|
+
Model: churn-predictor
|
|
84
|
+
├── v1 (Logistic Regression) ← Champion in production
|
|
85
|
+
│ - Accuracy: 0.87
|
|
86
|
+
│ - Deployed to: endpoint/prod (70% traffic)
|
|
87
|
+
│
|
|
88
|
+
└── v2 (XGBoost) ← Challenger
|
|
89
|
+
- Accuracy: 0.91
|
|
90
|
+
- Deployed to: endpoint/prod (30% traffic)
|
|
91
|
+
|
|
92
|
+
After validation: promote v2 to Champion
|
|
93
|
+
</code></pre>
|
|
94
|
+
|
|
95
|
+
<h2 id="edge-deployment"><strong>5. Edge Deployment</strong></h2>
|
|
96
|
+
|
|
97
|
+
<table>
|
|
98
|
+
<thead><tr><th>Platform</th><th>Solution</th></tr></thead>
|
|
99
|
+
<tbody>
|
|
100
|
+
<tr><td>Mobile (Android/iOS)</td><td>TFLite + Vertex AI model export</td></tr>
|
|
101
|
+
<tr><td>Edge devices (IoT)</td><td>TFLite Micro / Edge TPU (Coral)</td></tr>
|
|
102
|
+
<tr><td>On-premise servers</td><td>TF Serving in Docker container</td></tr>
|
|
103
|
+
<tr><td>Kubernetes</td><td>KServe (formerly KFServing) on GKE</td></tr>
|
|
104
|
+
</tbody>
|
|
105
|
+
</table>
|
|
106
|
+
|
|
107
|
+
<h2 id="practice"><strong>6. Practice Questions</strong></h2>
|
|
108
|
+
|
|
109
|
+
<p><strong>Q1:</strong> A company needs to score 50 million customer records for churn risk. Results are needed within 2 hours but not in real time. Which Vertex AI prediction option is MOST cost-effective?</p>
|
|
110
|
+
<ul>
|
|
111
|
+
<li>A) Online Prediction with high replica count</li>
|
|
112
|
+
<li>B) Batch Prediction ✓</li>
|
|
113
|
+
<li>C) Streaming prediction via Dataflow</li>
|
|
114
|
+
<li>D) Deploy on dedicated GPU endpoint</li>
|
|
115
|
+
</ul>
|
|
116
|
+
<p><em>Explanation: Batch Prediction is designed for large-scale asynchronous scoring. It scales compute resources up during the job and back to zero when done, with no persistent endpoint cost. Online Prediction would be wasteful since real-time response isn't needed for batch scoring.</em></p>
|
|
117
|
+
|
|
118
|
+
<p><strong>Q2:</strong> A team is deploying a new model version. They want to gradually route 10% of production traffic to the new version while the old version handles 90%, allowing comparison of performance metrics before full rollout. Which Vertex AI feature enables this?</p>
|
|
119
|
+
<ul>
|
|
120
|
+
<li>A) Model Registry versioning</li>
|
|
121
|
+
<li>B) Traffic splitting on Vertex AI Endpoints ✓</li>
|
|
122
|
+
<li>C) Batch Prediction comparison</li>
|
|
123
|
+
<li>D) Vertex AI Experiments</li>
|
|
124
|
+
</ul>
|
|
125
|
+
<p><em>Explanation: Vertex AI Endpoints support deploying multiple model versions simultaneously with configurable traffic splits (e.g., 90%/10%). This enables canary deployments and A/B testing to compare live performance before committing to a full rollout.</em></p>
|
|
126
|
+
|
|
127
|
+
<p><strong>Q3:</strong> A retail company wants to detect product defects on a factory floor without network connectivity to cloud. Which deployment approach should they use?</p>
|
|
128
|
+
<ul>
|
|
129
|
+
<li>A) Vertex AI Online Prediction Endpoint</li>
|
|
130
|
+
<li>B) AutoML Edge Model deployed to device using TFLite ✓</li>
|
|
131
|
+
<li>C) BigQuery ML batch prediction</li>
|
|
132
|
+
<li>D) TF Serving on Cloud Run</li>
|
|
133
|
+
</ul>
|
|
134
|
+
<p><em>Explanation: Edge deployment with TFLite (or AutoML Edge Model) runs inference locally on the device without network connectivity. TFLite supports on-device inference for computer vision models, suitable for factory floor equipment with no internet access.</em></p>
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: 019c9619-lt03-l08
|
|
3
|
+
title: 'Bài 8: Vertex AI Pipelines & MLOps'
|
|
4
|
+
slug: bai-8-vertex-ai-pipelines-mlops
|
|
5
|
+
description: >-
|
|
6
|
+
Vertex AI Pipelines (Kubeflow Pipelines SDK).
|
|
7
|
+
Model Registry, Experiments, Metadata Store.
|
|
8
|
+
Vertex AI Model Monitoring: skew, drift detection.
|
|
9
|
+
CI/CD cho ML: Cloud Build + Vertex AI.
|
|
10
|
+
duration_minutes: 60
|
|
11
|
+
is_free: true
|
|
12
|
+
video_url: null
|
|
13
|
+
sort_order: 8
|
|
14
|
+
section_title: "Phần 4: Model Deployment & MLOps"
|
|
15
|
+
course:
|
|
16
|
+
id: 019c9619-lt03-7003-c003-lt0300000003
|
|
17
|
+
title: 'Luyện thi Google Cloud Professional Machine Learning Engineer'
|
|
18
|
+
slug: luyen-thi-gcp-ml-engineer
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
<div style="text-align: center; margin: 2rem 0;">
|
|
22
|
+
<img src="/storage/uploads/2026/04/gcp-mle-bai8-mlops-cicd.png" alt="Vertex AI Pipelines & MLOps" style="max-width: 800px; width: 100%; border-radius: 12px;" />
|
|
23
|
+
<p><em>Vertex AI MLOps: Pipelines, CI/CD, Model Registry, và monitoring cho production ML</em></p>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<h2 id="mlops-maturity"><strong>1. MLOps Maturity Levels</strong></h2>
|
|
27
|
+
|
|
28
|
+
<table>
|
|
29
|
+
<thead><tr><th>Level</th><th>Description</th><th>Automation</th></tr></thead>
|
|
30
|
+
<tbody>
|
|
31
|
+
<tr><td><strong>Level 0</strong></td><td>Manual process, scripts only</td><td>None</td></tr>
|
|
32
|
+
<tr><td><strong>Level 1</strong></td><td>ML pipeline automation, continuous training</td><td>Training pipeline</td></tr>
|
|
33
|
+
<tr><td><strong>Level 2</strong></td><td>Full CI/CD for ML, automated retraining triggers</td><td>Everything</td></tr>
|
|
34
|
+
</tbody>
|
|
35
|
+
</table>
|
|
36
|
+
|
|
37
|
+
<h2 id="vertex-pipelines"><strong>2. Vertex AI Pipelines</strong></h2>
|
|
38
|
+
|
|
39
|
+
<p>Vertex AI Pipelines là managed execution environment cho <strong>Kubeflow Pipelines (KFP)</strong>. Pipeline được định nghĩa bằng Python SDK và compile thành YAML.</p>
|
|
40
|
+
|
|
41
|
+
<pre><code class="language-text">Vertex AI Pipeline Structure:
|
|
42
|
+
|
|
43
|
+
@component (preprocess_data)
|
|
44
|
+
↓
|
|
45
|
+
@component (train_model)
|
|
46
|
+
↓
|
|
47
|
+
@component (evaluate_model)
|
|
48
|
+
↓ (if accuracy > threshold)
|
|
49
|
+
@component (deploy_model)
|
|
50
|
+
|
|
51
|
+
Each component = isolated Docker container
|
|
52
|
+
Artifacts (data, models) stored in Cloud Storage
|
|
53
|
+
Metadata tracked in Vertex ML Metadata Store
|
|
54
|
+
</code></pre>
|
|
55
|
+
|
|
56
|
+
<table>
|
|
57
|
+
<thead><tr><th>Pipeline SDK</th><th>Notes</th></tr></thead>
|
|
58
|
+
<tbody>
|
|
59
|
+
<tr><td><strong>Kubeflow Pipelines SDK v2</strong></td><td>Primary SDK for Vertex AI Pipelines</td></tr>
|
|
60
|
+
<tr><td><strong>TFX</strong></td><td>TensorFlow-specific pipeline components</td></tr>
|
|
61
|
+
<tr><td><strong>Google Cloud Pipeline Components</strong></td><td>Pre-built components cho Vertex AI services</td></tr>
|
|
62
|
+
</tbody>
|
|
63
|
+
</table>
|
|
64
|
+
|
|
65
|
+
<h2 id="model-monitoring"><strong>3. Vertex AI Model Monitoring</strong></h2>
|
|
66
|
+
|
|
67
|
+
<table>
|
|
68
|
+
<thead><tr><th>Monitoring Type</th><th>What It Detects</th></tr></thead>
|
|
69
|
+
<tbody>
|
|
70
|
+
<tr><td><strong>Feature Skew Monitoring</strong></td><td>Serving feature distribution ≠ training baseline</td></tr>
|
|
71
|
+
<tr><td><strong>Feature Drift Monitoring</strong></td><td>Serving feature distribution changes over time</td></tr>
|
|
72
|
+
<tr><td><strong>Prediction Drift</strong></td><td>Model output distribution changes (indirect label drift)</td></tr>
|
|
73
|
+
</tbody>
|
|
74
|
+
</table>
|
|
75
|
+
|
|
76
|
+
<pre><code class="language-text">Model Monitoring Workflow:
|
|
77
|
+
|
|
78
|
+
Training Data Baseline (BigQuery/GCS)
|
|
79
|
+
↓ (establish distribution)
|
|
80
|
+
Deploy to Endpoint with Monitoring enabled
|
|
81
|
+
↓ (collect serving requests)
|
|
82
|
+
Periodic Analysis (hourly/daily)
|
|
83
|
+
↓ (compare distributions)
|
|
84
|
+
Alert if skew/drift > threshold
|
|
85
|
+
↓
|
|
86
|
+
Retrain trigger → new Pipeline run
|
|
87
|
+
</code></pre>
|
|
88
|
+
|
|
89
|
+
<h2 id="experiments-metadata"><strong>4. Vertex AI Experiments & Metadata</strong></h2>
|
|
90
|
+
|
|
91
|
+
<table>
|
|
92
|
+
<thead><tr><th>Component</th><th>Purpose</th></tr></thead>
|
|
93
|
+
<tbody>
|
|
94
|
+
<tr><td><strong>Vertex AI Experiments</strong></td><td>Track hyperparameters, metrics, artifacts across runs</td></tr>
|
|
95
|
+
<tr><td><strong>ML Metadata Store</strong></td><td>Track lineage: data → model → endpoint</td></tr>
|
|
96
|
+
<tr><td><strong>Vertex AI TensorBoard</strong></td><td>Visualize training metrics (loss, accuracy curves)</td></tr>
|
|
97
|
+
</tbody>
|
|
98
|
+
</table>
|
|
99
|
+
|
|
100
|
+
<h2 id="cicd-ml"><strong>5. CI/CD for ML on GCP</strong></h2>
|
|
101
|
+
|
|
102
|
+
<pre><code class="language-text">ML CI/CD Pipeline on GCP:
|
|
103
|
+
|
|
104
|
+
Code Push to Cloud Source Repositories
|
|
105
|
+
↓
|
|
106
|
+
Cloud Build trigger (CI)
|
|
107
|
+
├── Unit tests for ML components
|
|
108
|
+
├── Data validation tests
|
|
109
|
+
└── Build Docker image → push to Artifact Registry
|
|
110
|
+
↓
|
|
111
|
+
Vertex AI Pipeline trigger (CD/CT)
|
|
112
|
+
├── Data preprocessing
|
|
113
|
+
├── Model training
|
|
114
|
+
├── Model evaluation
|
|
115
|
+
└── Conditional deployment → Vertex AI Endpoint
|
|
116
|
+
</code></pre>
|
|
117
|
+
|
|
118
|
+
<blockquote>
|
|
119
|
+
<p><strong>Exam tip:</strong> CI/CD cho ML = Cloud Build (code testing + Docker build) + Vertex AI Pipelines (training + deployment orchestration). Cloud Source Repositories là GCP's Git hosting. Artifact Registry thay thế Container Registry để lưu Docker images.</p>
|
|
120
|
+
</blockquote>
|
|
121
|
+
|
|
122
|
+
<h2 id="practice"><strong>6. Practice Questions</strong></h2>
|
|
123
|
+
|
|
124
|
+
<p><strong>Q1:</strong> A production ML model's prediction distribution has shifted significantly over 3 weeks, but ground truth labels are not yet available to measure accuracy directly. Which Vertex AI monitoring type detects this?</p>
|
|
125
|
+
<ul>
|
|
126
|
+
<li>A) Feature Skew Monitoring</li>
|
|
127
|
+
<li>B) Prediction Drift Monitoring ✓</li>
|
|
128
|
+
<li>C) Training data validation</li>
|
|
129
|
+
<li>D) Vertex AI Experiments baseline comparison</li>
|
|
130
|
+
</ul>
|
|
131
|
+
<p><em>Explanation: Prediction Drift Monitoring tracks how the model's output distribution changes over time, serving as an indirect signal of model degradation even when ground truth labels are unavailable. Feature Skew compares serving vs training feature distributions (requires known training baseline).</em></p>
|
|
132
|
+
|
|
133
|
+
<p><strong>Q2:</strong> A team is building a Vertex AI Pipeline that includes data preprocessing, model training, and deployment. They need to track all inputs, outputs, and model artifacts for auditability and reproducibility. Which service stores this lineage information?</p>
|
|
134
|
+
<ul>
|
|
135
|
+
<li>A) Cloud Logging</li>
|
|
136
|
+
<li>B) Vertex AI ML Metadata Store ✓</li>
|
|
137
|
+
<li>C) Cloud Storage versioning</li>
|
|
138
|
+
<li>D) Vertex AI Experiments dashboard</li>
|
|
139
|
+
</ul>
|
|
140
|
+
<p><em>Explanation: Vertex AI ML Metadata Store (also called Vertex ML Metadata) automatically tracks lineage: which datasets produced which models, which models were deployed to which endpoints, including hyperparameters and evaluation metrics — enabling full provenance tracking.</em></p>
|
|
141
|
+
|
|
142
|
+
<p><strong>Q3:</strong> A company wants to automatically retrain their ML model whenever new training data is available in Cloud Storage. The retraining should run a Vertex AI Pipeline and deploy if metrics pass thresholds. Which GCP service should trigger the pipeline?</p>
|
|
143
|
+
<ul>
|
|
144
|
+
<li>A) Vertex AI Schedules</li>
|
|
145
|
+
<li>B) Cloud Storage notifications + Cloud Functions/Eventarc → Vertex AI Pipelines ✓</li>
|
|
146
|
+
<li>C) BigQuery scheduled queries</li>
|
|
147
|
+
<li>D) Cloud Scheduler alone</li>
|
|
148
|
+
</ul>
|
|
149
|
+
<p><em>Explanation: Cloud Storage object finalize notifications can trigger Cloud Functions or Eventarc, which then programmatically start a Vertex AI Pipeline run. This creates event-driven continuous training (MLOps Level 1). Cloud Scheduler triggers on time, not on data availability.</em></p>
|