# MLSysIM custom Pint definitions — reviewable unit vocabulary.
# Loaded by mlsysim.core.units at registry creation.

# Decimal data scales
KB = 1e3 * byte
MB = 1e6 * byte
GB = 1e9 * byte
TB = 1e12 * byte
PB = 1e15 * byte

# Binary data scales
KiB = 1024 * byte
MiB = 1048576 * byte
GiB = 1073741824 * byte
TiB = 1099511627776 * byte

# Time aliases (legacy uppercase — prefer ms/microsecond/nanosecond in new code)
MS = 1e-3 * second
US = 1e-6 * second
NS = 1e-9 * second

# ML operation counts — their OWN base dimension [flop] (2026-06-06).
# Compute work must never silently add to or convert into bytes, counts,
# params, or dollars: "989 TFLOP/s + 3.35 TB/s" is a category error and now
# raises DimensionalityError. Counts/bytes stay dimensionless so
# params x bytes/param -> bytes still composes; arithmetic intensity
# (flop/byte) carries the [flop] dimension and is displayed via fmt helpers.
flop = [flop]
KFLOP = 1e3 * flop
KFLOPs = 1e3 * flop
MFLOP = 1e6 * flop
MFLOPs = 1e6 * flop
GFLOP = 1e9 * flop
GFLOPs = 1e9 * flop
TFLOP = 1e12 * flop
TFLOPs = 1e12 * flop
PFLOP = 1e15 * flop
PFLOPs = 1e15 * flop
EFLOP = 1e18 * flop
EFLOPs = 1e18 * flop
ZFLOP = 1e21 * flop
ZFLOPs = 1e21 * flop

# Integer operation rates — same [flop] dimension as floating-point ops
# (precision is a convention, not a physical dimension; edge registries store
# marketing TOPS in the same compute-rate fields as TFLOP/s).
OPS = flop / second
KOPS = 1e3 * OPS
MOPS = 1e6 * OPS
GOPS = 1e9 * OPS
TOPS = 1e12 * OPS

# Network shorthand
Gbps = 1e9 * bit / second

# Currency (display via fmt_usd only)
dollar = 1 * count
USD = dollar
# Parity alias only: the package is single-currency (USD). EUR converts 1:1
# with no FX rate — do not use it to represent real euro amounts.
EUR = dollar

# Model parameter counts
param = 1 * count
Kparam = 1e3 * param
Mparam = 1e6 * param
Bparam = 1e9 * param
Tparam = 1e12 * param
