Download warm.py from SQuADDS/squadds-ml-inference-api: direct link, hf CLI and curl.
- Browser
- Download file 1.1 kB
-
https://huggingface.co/spaces/SQuADDS/squadds-ml-inference-api/resolve/main/warm.py
- Command line
-
hf download hf://spaces/SQuADDS/squadds-ml-inference-api/warm.py
-
curl -L -o warm.py https://huggingface.co/spaces/SQuADDS/squadds-ml-inference-api/resolve/main/warm.py
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) | |