igneum/tools/chip-model/rtl/flow/edge.py
2026-10-08 14:32:44 +00:00

26 lines
2.3 KiB
Python

#!/usr/bin/env python3
"""The chip edge rows at the synthesised chip cost. Usage: edge.py <chip pJ per lane-op at N3> [<at N2>]
Absolute convention: E_chip = E_mem + N_ops x e_chip (the chip's shadow cost does not depend on the card's point).
The record's convention beside it: E_chip = E_mem + k x F with k = e_chip / e_gpu at the card's point."""
import sys
e3 = float(sys.argv[1]); e2 = float(sys.argv[2]) if len(sys.argv) > 2 else e3 * 0.72
NOPS = 102100 # class v4 counted ops per hash (the packs job)
# the 5090 rows: (name, card microjoules per hash, premium F, pJ per counted op at that point)
cards = [('5090 stock (class v4)', 3.36, 1.10, 10.8), ('5090 at the 1,300 MHz lock', 2.33, 0.652, 6.4)]
honest = [('M5 Max (class v4 1.40 microjoules, class v3 0.78; 6.9 pJ per op; F 0.62)', 1.40, 0.62, 6.9)]
chips = [('GDDR7 board, 28 nm controller (the record)', 0.466), ('HBM3E one stack', 0.321), ('HBM4 one stack, N12 base die', 0.22),
('custom HBM4E base die, N3P', 0.18), ('DRAM on logic, hybrid bonded (2029 to 2031)', 0.15), ('SRAM full store, one N2 reticle', 0.14)]
def edge_abs(card, mem, e): return card / (mem + NOPS * e * 1e-6)
def edge_rec(card, F, mem, k): return card / (mem + k * F)
print(f'Chip shadow per hash, absolute: N3 {NOPS*e3*1e-6:.3f} microjoules, N2 {NOPS*e2*1e-6:.3f}.')
print('| Chip (E_mem, microjoules) | Card row | Zero shadow | Absolute, N3 core | Absolute, N2 core | Record convention at the measured k (N3) | at k = 1 | at k = 0.5 |')
print('|---|---|---|---|---|---|---|---|')
for cn, mem in chips:
for rn, card, F, egpu in cards + honest:
k3 = e3 / egpu
print(f'| {cn} ({mem}) | {rn} | {(card-F)/mem:.1f}x | {edge_abs(card,mem,e3):.1f}x | {edge_abs(card,mem,e2):.1f}x | {edge_rec(card,F,mem,k3):.1f}x (k {k3:.2f}) | {edge_rec(card,F,mem,1):.1f}x | {edge_rec(card,F,mem,0.5):.1f}x |')
print('\nFloor lane 1 assumption (not in by 18:00 UK): the honest 5090 at 1.0 microjoules per hash at zero shadow.')
print('| Chip | Premium kept at 0.652 (card 1.652): absolute N3 / N2 | Premium scaled with the card, 0.390 (card 1.390): absolute N3 / N2 | zero shadow |')
print('|---|---|---|---|')
for cn, mem in chips:
print(f'| {cn} | {edge_abs(1.652,mem,e3):.1f}x / {edge_abs(1.652,mem,e2):.1f}x | {edge_abs(1.390,mem,e3):.1f}x / {edge_abs(1.390,mem,e2):.1f}x | {1.0/mem:.1f}x |')