File size: 1,096 Bytes
55ce00a
 
 
 
8a0986e
55ce00a
 
 
 
 
 
 
8a0986e
55ce00a
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""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)