shanto268's picture
SQuADDS ML API 2: squadds ec4414d6, registry 1dbf099a
8a0986e verified
Raw History Blame Contribute Delete
1.1 kB
"""Build-time warm-up without weights: the physics priors and the geometric embedding of the example layout compile every
numba kernel the capacitance models use, so the image carries the compiled cache."""
import time
from squadds.ml.capacitance import physics_prior, optimized_physics_prior, prepare_layout
from squadds.ml.capacitance import _runtime as RT
from squadds.ml.capacitance._core import api as A
from squadds.ml.capacitance._core import paper as PA
from squadds.ml.capacitance._core._tlsq.uge import blocks as B
from squadds.ml.capacitance._core._tlsq.uge.graph import scene_graph
GDS = "examples/interdigital.gds"
for f in (optimized_physics_prior, physics_prior):
t = time.perf_counter()
r = f(GDS)
print("warm.py", f.__name__, r.names, round(time.perf_counter() - t, 1), "s", flush=True)
t = time.perf_counter()
with RT.LOCK:
RT.configure(2)
B.FAR_DECIMATION.update(k=64, d_far=100.0)
sc = A.scene_from_prepared(prepare_layout(GDS))
PA.lt.add_tokens(sc, scene_graph(sc))
print("warm.py embedding", round(time.perf_counter() - t, 1), "s", flush=True)