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:
Vijay Janapa Reddi
2026-06-06 11:36:23 -04:00
parent 9c3dce60dc
commit 6aed5b4e1e
5 changed files with 6 additions and 6 deletions

View File

@@ -50,7 +50,7 @@ The A100 ridge is `{python} A100RidgeExample.ridge_str` FLOP/byte.
- Keep **≤ 58 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`).

View File

@@ -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)

View File

@@ -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

View File

@@ -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")

View File

@@ -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,