mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-07-19 01:14:07 -05:00
Migrate the last core.constants stragglers (examples, paper validator)
Five references outside the gate scopes: the two runnable examples, the paper's anchor validator, book/tests/test_registry.py, and a LEGO_CELLS.md prose mention. All verified executable post-migration (examples 03/04 run; validate_anchors: all 7 anchors match).
This commit is contained in:
@@ -50,7 +50,7 @@ The A100 ridge is `{python} A100RidgeExample.ridge_str` FLOP/byte.
|
||||
- Keep **≤ 5–8 exports** per cell when possible.
|
||||
- Use **registry paths** for shared specs — `Hardware.Cloud.H100`, `Models.Vision.ResNet50`,
|
||||
`Systems.Reliability.Gpu.mttf_hours`, `Literature.Training.MfuHigh`, and
|
||||
`mlsysim.physics.calc_*` for architecture formulas. Reserve `mlsysim.core.constants`
|
||||
`mlsysim.physics.calc_*` for architecture formulas. Reserve `mlsysim.core.units`
|
||||
for physics/units only (`HOURS_PER_DAY`, `BYTES_FP16`, latency stack).
|
||||
- Put `#| echo: false` as the **first line** after ` ```{python}` (required by
|
||||
`book-check-code`).
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import unittest
|
||||
from mlsysim import Hardware, Models
|
||||
from mlsysim.core.constants import ureg
|
||||
from mlsysim.core.units import ureg
|
||||
|
||||
class TestMLSysRegistry(unittest.TestCase):
|
||||
def test_hardware_ridge_points(self):
|
||||
@@ -21,7 +21,7 @@ class TestMLSysRegistry(unittest.TestCase):
|
||||
def test_model_size(self):
|
||||
"""Test model weight storage calculations."""
|
||||
gpt3 = Models.Language.GPT3
|
||||
from mlsysim.core.constants import BYTES_FP16, BYTES_INT4
|
||||
from mlsysim.core.units import BYTES_FP16, BYTES_INT4
|
||||
|
||||
# GPT-3 175B @ FP16 (2 bytes) = 350 GB
|
||||
size_fp16 = gpt3.size_in_bytes(BYTES_FP16)
|
||||
|
||||
@@ -7,7 +7,7 @@ from mlsysim.systems.types import Fleet, Node, NetworkFabric
|
||||
from mlsysim.hardware.registry import Hardware
|
||||
from mlsysim.models.registry import Models
|
||||
from mlsysim.solvers import DistributedModel, EconomicsModel
|
||||
from mlsysim.core.constants import Q_
|
||||
from mlsysim.core.units import Q_
|
||||
|
||||
# 1. Define the Workload
|
||||
model = Models.Language.Llama3_8B
|
||||
|
||||
@@ -6,7 +6,7 @@ It shows how faster GPUs can actually result in lower utilization if the
|
||||
storage bandwidth cannot keep up with the compute demand.
|
||||
"""
|
||||
import mlsysim
|
||||
from mlsysim.core.constants import Q_
|
||||
from mlsysim.core.units import Q_
|
||||
|
||||
def main():
|
||||
print("Evaluating ResNet-50 Training Data Pipeline...\n")
|
||||
|
||||
@@ -17,7 +17,7 @@ project_root = Path(__file__).resolve().parent.parent.parent
|
||||
sys.path.insert(0, str(project_root))
|
||||
|
||||
import mlsysim # noqa: E402
|
||||
from mlsysim.core.constants import Q_ # noqa: E402
|
||||
from mlsysim.core.units import Q_ # noqa: E402
|
||||
from mlsysim.solvers import ( # noqa: E402
|
||||
DistributedModel,
|
||||
ScalingModel,
|
||||
|
||||
Reference in New Issue
Block a user