Files
cs249r_book/mlsysim/examples/hardware_comparison.py
Vijay Janapa Reddi a78f1bd8b0 feat(mlsysim): add documentation site, typed registries, and 6-solver core
Complete MLSYSIM v0.1.0 implementation with:

- Documentation website (Quarto): landing page with animated hero
  and capability carousel, 4 tutorials (hello world, LLM serving,
  distributed training, sustainability), hardware/model/fleet/infra
  catalogs, solver guide, whitepaper, math foundations, glossary,
  and full quartodoc API reference
- Typed registry system: Hardware (18 devices across 5 tiers),
  Models (15 workloads), Systems (fleets, clusters, fabrics),
  Infrastructure (grid profiles, rack configs, datacenters)
- Core types: Pint-backed Quantity, Metadata provenance tracking,
  custom exception hierarchy (OOMError, SLAViolation)
- SimulationConfig with YAML/JSON loading and pre-validation
- Scenario system tying workloads to systems with SLA constraints
- Multi-level evaluation scorecard (feasibility, performance, macro)
- Examples, tests, and Jetson Orin NX spec fix (100 → 25 TFLOP/s)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 15:59:51 -05:00

29 lines
721 B
Python

"""
Tutorial: Comparing Concrete Hardware
====================================
Models the Smart Doorbell across different real-world microcontrollers.
"""
import mlsysim
def main():
scenario = mlsysim.Applications.Doorbell
devices = [
mlsysim.Hardware.Tiny.ArduinoNano33,
mlsysim.Hardware.Tiny.ESP32_S3
]
for hw in devices:
print("\n--- Evaluating " + hw.name + " ---")
test_scenario = scenario.model_copy(update={"system": hw})
try:
result = test_scenario.evaluate()
print(result.scorecard())
except Exception as e:
print("CRITICAL SYSTEM FAILURE: " + str(e))
if __name__ == "__main__":
main()