You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The boundary between **Data** (Memory Bound) and **Machine** (Compute Bound) is not arbitrary; it is defined mathematically by the **Arithmetic Intensity**[^fn-arith-intensity] ($I$) of the workload.
208
+
The boundary between **Data** (memory bound) and **Machine** (compute bound) is not arbitrary; it is defined mathematically by **arithmetic intensity**[^fn-arith-intensity] ($I$) of the workload.
209
209
210
210
[^fn-arith-intensity]: **Arithmetic Intensity**: The ratio of floating-point operations to bytes transferred (FLOPs/byte), introduced by @williams2009 as the key parameter in the Roofline Model. It determines whether a workload is memory bound or compute bound by comparison against the hardware's *ridge point* ($R_{\text{peak}}/\text{BW}$). @sec-machine-foundations-roofline-model-2529 provides a complete derivation.
211
211
212
-
@sec-machine-foundations-roofline-model-2529 provides rigorous definitions of Arithmetic Intensity and the Roofline Model. Use that model to quantitatively distinguish between Data and Machine bottlenecks before applying the optimizations below.
212
+
@sec-machine-foundations-roofline-model-2529 provides rigorous definitions of arithmetic intensity and the roofline model. Use that model to quantitatively distinguish between Data and Machine bottlenecks before applying the optimizations below.
213
213
214
214
The Roofline Model provides exact answers when you have time to profile. But in the middle of a production incident, you often need a faster heuristic—a set of quick thresholds that point you toward the right axis within seconds.
215
215
216
216
## Rules of Thumb {#sec-dam-taxonomy-rules-thumb-f94f}
217
217
218
218
In the heat of a production outage, you rarely have time to solve the full iron law equation. Instead, veteran systems engineers rely on these quantitative heuristics to quickly narrow down the search space. Use these thresholds as your first line of defense.
219
219
220
-
***If Accelerator Utilization $<$ 80 percent**: You are likely **Data Bound** (or CPU bound). The accelerator is starving.
221
-
***If Accelerator Utilization $>$ 95 percent**: You are likely **Machine Bound**. The accelerator is fully saturated.
222
-
***If Batch Size is one**: You are likely **Latency Bound** (Algorithm overhead dominates).
223
-
***If Arithmetic Intensity $<$ 100 FLOPs/byte**: You are likely **Memory Bound** (Data/Machine boundary). This threshold is approximate for current-generation accelerators; compute your hardware's specific ridge point ($R_{\text{peak}}/\text{BW}$) for a precise boundary.
224
-
***If System works in Dev but fails in Prod**: Suspect **Data Drift** (Data component).
220
+
***If accelerator utilization $<$ 80 percent**: The workload is likely data bound (or CPU bound). The accelerator is starving.
221
+
***If accelerator utilization $>$ 95 percent**: The workload is likely machine bound. The accelerator is fully saturated.
222
+
***If batch size is one**: The workload is likely latency bound (algorithm overhead dominates).
223
+
***If arithmetic intensity $<$ 100 FLOPs/byte**: The workload is likely memory bound (Data/Machine boundary). This threshold is approximate for current-generation accelerators; compute the hardware's specific ridge point ($R_{\text{peak}}/\text{BW}$) for a precise boundary.
224
+
***If the system works in dev but fails in prod**: Suspect data drift (Data component).
225
225
226
-
Note that common industry labels map to DAM components as follows: **Memory Bound** typically indicates a **Data** bottleneck (information cannot reach the accelerator fast enough), **Compute Bound** indicates a **Machine** bottleneck (the accelerator is fully saturated), and **Latency Bound** indicates an **Algorithm** bottleneck (serial operation depth or overhead dominates).
226
+
Common industry labels map to DAM components as follows: memory bound typically indicates a **Data** bottleneck (information cannot reach the accelerator fast enough), compute bound indicates a **Machine** bottleneck (the accelerator is fully saturated), and latency bound indicates an **Algorithm** bottleneck (serial operation depth or overhead dominates).
: **What Works vs. What Is Wasted**: Optimizing the wrong term yields exactly zero improvement. A memory-bound large language model (LLM) will not speed up from a faster accelerator; the accelerator will simply idle faster while waiting for memory. {#tbl-bottleneck-actions}
239
239
@@ -293,7 +293,7 @@ Accelerator utilization is pinned at 99 percent. Memory bandwidth is unsaturated
293
293
294
294
#### Diagnosis {.unnumbered}
295
295
296
-
You have successfully fed the beast. The system is **Compute Bound**.
296
+
The system has successfully fed the beast. It is compute bound.
***Diagnosis**: If $\text{Effective BW} \approx \text{Peak BW}$ (for example, >1.6 TB/s on A100), the kernel is **Memory Bound**. Optimizing compute (Ops) will do nothing.
992
+
***Diagnosis**: If $\text{Effective BW} \approx \text{Peak BW}$ (for example, >1.6 TB/s on A100), the kernel is memory bound. Optimizing compute (Ops) will do nothing.
993
993
994
994
**Measuring the throughput term $(\eta_{\text{hw}})$**
Copy file name to clipboardExpand all lines: book/quarto/contents/vol1/data_engineering/data_engineering.qmd
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -2161,7 +2161,7 @@ If the data pipeline cannot decode images fast enough to keep the GPU busy, the
2161
2161
2162
2162
Examine @fig-dataloader-choke-point to see this **Dataloader Choke Point**\index{Dataloader!dataloader choke point} in action. Notice the "Starvation Region" on the left where the CPU limits performance: no matter how powerful the GPU, training throughput is capped by data loading speed until enough workers are allocated to saturate the accelerator. Throughput levels are representative and vary by model and hardware.
2163
2163
2164
-
::: {#fig-dataloader-choke-point fig-env="figure" fig-pos="htb" fig-cap="**The Dataloader Choke Point**: Training Throughput (img/s) vs. Number of DataLoader Workers. The blue curve shows CPU throughput scaling linearly with workers until hitting disk limits. The red dashed line is the GPU's consumption capacity (for example, ResNet-50 at ~3,000 img/s; illustrative). The system is bottlenecked by whichever is lower. In the 'Starvation Region' (left), the GPU is idle waiting for data. In the 'Saturated Region' (right), the GPU is fully utilized, and adding more workers wastes CPU memory." fig-alt="Line chart of throughput vs. workers. Blue line (CPU) rises linearly. Red line (GPU) is flat. Where CPU < GPU, system is starved. Where CPU > GPU, system is saturated."}
2164
+
::: {#fig-dataloader-choke-point fig-env="figure" fig-pos="htb" fig-cap="**The Dataloader Choke Point**: Training throughput (img/s) vs. number of DataLoader workers. The blue curve shows CPU throughput scaling linearly with workers until hitting disk limits. The red dashed line is the GPU's consumption capacity (for example, ResNet-50 at ~3,000 img/s; illustrative). The system is bottlenecked by whichever is lower. In the starvation region (left), the GPU is idle waiting for data. In the saturated region (right), the GPU is fully utilized, and adding more workers wastes CPU memory." fig-alt="Line chart of throughput vs. workers. Blue line (CPU) rises linearly. Red line (GPU) is flat. Where CPU < GPU, system is starved. Where CPU > GPU, system is saturated."}
2165
2165
2166
2166
```{python}
2167
2167
#| echo: false
@@ -3454,11 +3454,11 @@ The storage architectures we have examined address where data resides and how it
3454
3454
3455
3455
::: {.callout-definition title="Feature store"}
3456
3456
3457
-
***Feature Store***\index{Feature Store!definition} is the architectural layer that centralizes the management of **Machine Learning Features**, decoupling feature computation from consumption.
3457
+
***Feature Store***\index{Feature Store!definition} is the architectural layer that centralizes the management of machine learning features, decoupling feature computation from consumption.
3458
3458
3459
-
1. **Significance (quantitative)**: It enforces **Point-in-Time Correctness**, ensuring that historical data used for training $(x_{t-\Delta})$ is computed with identical logic to the real-time data served at inference $(x_t)$, eliminating **Training-Serving Skew** by design.
3460
-
2. **Distinction (durable)**: Unlike a **General-Purpose Database**, a Feature Store is designed for **Dual Storage Modes**: an *Offline Store* (columnar/batch) for training and an *Online Store* (key-value/low-latency) for serving.
3461
-
3. **Common pitfall**: A frequent misconception is that a Feature Store is just "a place to store data." In reality, it is a **Transformation Engine**: it stores the *logic* to compute features consistently across the entire ML lifecycle.
3459
+
1. **Significance (quantitative)**: It enforces point-in-time correctness, ensuring that historical data used for training $(x_{t-\Delta})$ is computed with identical logic to the real-time data served at inference $(x_t)$, eliminating training-serving skew by design.
3460
+
2. **Distinction (durable)**: Unlike a general-purpose database, a feature store is designed for dual storage modes: an *offline store* (columnar/batch) for training and an *online store* (key-value/low-latency) for serving.
3461
+
3. **Common pitfall**: A frequent misconception is that a feature store is just "a place to store data." In reality, it is a transformation engine: it stores the *logic* to compute features consistently across the entire ML lifecycle.
3462
3462
3463
3463
:::
3464
3464
@@ -3559,7 +3559,7 @@ The key insight is that data debt,\index{Data Debt!strategic vs. unconscious} li
3559
3559
3560
3560
\index{Debugging!data pipelines}\index{Pipeline!failure diagnosis}When data debt comes due, it surfaces as model accuracy degradation, pipeline failures, or subgroup performance disparities. Effective debugging applies the diagnostic principles established throughout this chapter: data cascades (@sec-data-engineering-data-cascades-systematic-foundations-matter-2efe) remind us that root causes lie upstream of symptoms, training-serving skew (@sec-data-engineering-ensuring-trainingserving-consistency-c683) explains many deployment failures, and drift detection (@sec-data-engineering-detecting-responding-data-drift-509a) surfaces gradual degradation. @fig-debug-flowchart synthesizes these concepts into an actionable diagnostic sequence:
3561
3561
3562
-
::: {#fig-debug-flowchart fig-env="figure" fig-pos="htb" fig-cap="**Data Pipeline Debugging Flowchart**: Four sequential decision nodes guide root cause diagnosis: (1) accuracy degrades over time leads to Data Drift, (2) training accuracy exceeds validation leads to Overfitting, (3) validation exceeds production accuracy leads to Training-Serving Skew, and (4) subgroup inconsistency leads to Bias. If all answers are no, the issue points to Model Architecture." fig-alt="Vertical flowchart with four blue diamond decision nodes and red result boxes. Top diamond asks if accuracy degrades over time, leading to data drift result. Second asks if training accuracy exceeds validation, leading to overfitting. Third asks if validation exceeds production accuracy, leading to training-serving skew. Fourth asks about subgroup inconsistency, leading to bias. Gray box at bottom shows model architecture issue if all answers are no."}
3562
+
::: {#fig-debug-flowchart fig-env="figure" fig-pos="htb" fig-cap="**Data Pipeline Debugging Flowchart**: Four sequential decision nodes guide root cause diagnosis: (1) accuracy degrades over time leads to data drift, (2) training accuracy exceeds validation leads to overfitting, (3) validation exceeds production accuracy leads to training-serving skew, and (4) subgroup inconsistency leads to bias. If all answers are no, the issue points to model architecture." fig-alt="Vertical flowchart with four blue diamond decision nodes and red result boxes. Top diamond asks if accuracy degrades over time, leading to data drift result. Second asks if training accuracy exceeds validation, leading to overfitting. Third asks if validation exceeds production accuracy, leading to training-serving skew. Fourth asks about subgroup inconsistency, leading to bias. Gray box at bottom shows model architecture issue if all answers are no."}
Copy file name to clipboardExpand all lines: book/quarto/contents/vol1/data_selection/data_selection.qmd
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1897,9 +1897,9 @@ class ActiveLearningRoi:
1897
1897
1898
1898
:::
1899
1899
1900
-
Compare the two curves in @fig-active-learning-multiplier: Active Learning shifts the learning curve to the left, achieving target accuracy with far fewer samples than random selection. The curves are illustrative to highlight the qualitative gap.
1900
+
Compare the two curves in @fig-active-learning-multiplier: active learning shifts the learning curve to the left, achieving target accuracy with far fewer samples than random selection. The curves are illustrative to highlight the qualitative gap.
1901
1901
1902
-
::: {#fig-active-learning-multiplier fig-env="figure" fig-pos="htb" fig-cap="**The Active Learning Multiplier**: Model Accuracy vs. Number of Labeled Samples (Log Scale). Random sampling (gray dashed) yields linear improvements, often requiring massive datasets to capture rare edge cases. Active Learning (green solid) targets informative samples, reaching the same accuracy with fewer labels. Curves are illustrative to show the qualitative advantage." fig-alt="Line chart of accuracy vs. labeled samples (log scale). Green line (active learning) rises much faster than gray line (random sampling). Shaded area between them shows cost savings."}
1902
+
::: {#fig-active-learning-multiplier fig-env="figure" fig-pos="htb" fig-cap="**The Active Learning Multiplier**: Model accuracy vs. number of labeled samples (log scale). Random sampling (gray dashed) yields linear improvements, often requiring massive datasets to capture rare edge cases. Active learning (green solid) targets informative samples, reaching the same accuracy with fewer labels. Curves are illustrative to show the qualitative advantage." fig-alt="Line chart of accuracy vs. labeled samples (log scale). Green line (active learning) rises much faster than gray line (random sampling). Shaded area between them shows cost savings."}
Copy file name to clipboardExpand all lines: book/quarto/contents/vol1/introduction/introduction.qmd
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -2055,7 +2055,7 @@ plt.close()
2055
2055
2056
2056
Efficiency gains tell only half the story. @fig-ai-training-compute-growth reveals the countervailing trend: even as individual architectures become more efficient, the field's total appetite for compute has grown exponentially, making efficiency optimization not a luxury but a necessity for continued progress.
2057
2057
2058
-
::: {#fig-ai-training-compute-growth fig-env="figure" fig-pos="htb" fig-cap="**The Era of Scale**: Training Compute (FLOPs) vs. Year (Log Scale). While early Deep Learning (blue) showed rapid growth, the Transformer Era (red) accelerated this trend significantly. From AlexNet (2012) to GPT-4 (2023), compute requirements increased by $10^7$ (10 million times), far outpacing Moore's Law. This exponential demand drives the specialized infrastructure described in this book." fig-alt="Scatter plot of Training Compute FLOPs vs. Year. Blue dots (2012 – 2018) show deep learning models like ResNet. Red dots (2018 – 2024) show large - scale models like GPT-4, rising much faster on the log scale."}
2058
+
::: {#fig-ai-training-compute-growth fig-env="figure" fig-pos="htb" fig-cap="**The Era of Scale**: Training compute (FLOPs) vs. year (log scale). While early deep learning (blue) showed rapid growth, the transformer era (red) accelerated this trend significantly. From AlexNet (2012) to GPT-4 (2023), compute requirements increased by $10^7$ (10 million times), far outpacing Moore's Law. This exponential demand drives the specialized infrastructure described in this book." fig-alt="Scatter plot of Training Compute FLOPs vs. Year. Blue dots (2012 – 2018) show deep learning models like ResNet. Red dots (2018 – 2024) show large - scale models like GPT-4, rising much faster on the log scale."}
0 commit comments