mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-11-09 10:39:41 -06:00
Rename the chapter folder, assets, lab, slides, audit data, and staffml links from 02_ml_systems to 02_system_paradigms, with redirects for the old URLs. Revise the introduction, notation, conventions, and about pages, adding the frontmatter stack figures. Add park2024offloading.
33 lines
1.3 KiB
Python
33 lines
1.3 KiB
Python
with open("books/vol1/02_system_paradigms/02_system_paradigms.qmd", "r") as f:
|
|
content = f.read()
|
|
|
|
replacements = [
|
|
(r"D_{\text{vol}}", r"\DataVolume"),
|
|
(r"\text{BW}", r"\Bandwidth"),
|
|
(r"R_{\text{peak}}", r"\PeakRate"),
|
|
(r"\eta_{\text{hw}}", r"\EfficiencyHw"),
|
|
(r"L_{\text{lat}}", r"\Latency"),
|
|
(r"T_{\text{deadline}}", r"\Deadline"),
|
|
(r"M_{\text{weights}}", r"\WeightMemoryWeights"),
|
|
(r"M_{\text{activations}}", r"\ActivationMemoryActivations"),
|
|
(r"P_t", r"\CurrentDistribution"),
|
|
(r"P_0", r"\TrainingDistributionZero"),
|
|
(r"\mathcal{D}(P_t \lVert P_0)", r"\StatisticalDivergence"),
|
|
(r"\text{Accuracy}_0", r"\InitialAccuracyZero"),
|
|
]
|
|
|
|
for old, new in replacements:
|
|
content = content.replace(old, new)
|
|
|
|
# Care with single letters
|
|
import re
|
|
content = re.sub(r'\bO\b(?!/)', r'\\Operations', content) # O but not O/R
|
|
content = content.replace(r"\\Operations/R", r"\\Operations / R")
|
|
# We'll just do manual for single letters:
|
|
content = re.sub(r'([ \(\$])O([ \)\$/])', r'\1\\Operations\2', content)
|
|
content = re.sub(r'([ \(\$])I([ \)\$/])', r'\1\\ArithmeticIntensity\2', content)
|
|
content = re.sub(r'([ \(\$])B([ \)\$/])', r'\1\\BatchSize\2', content)
|
|
|
|
with open("books/vol1/02_system_paradigms/02_system_paradigms.qmd", "w") as f:
|
|
f.write(content)
|