Skip to main content

Model load baselines

Reference wall-clock times for model preload, so regressions are easy to spot and user-facing timeouts have a basis. They measure the ONNX from_pretrained path in src-tauri/src/transcription/onnx_backend.rs; look for the [ONNX timing] log lines.

Measured baselines

From the dev log:

Warm versus cold

DirectML JIT-compiles its compute shaders the first time a model runs on a given GPU architecture, then the driver caches them persistently per machine.
  • Warm reload (shaders already cached) is fast: the roughly 7 s above.
  • Cold first run (new GPU architecture, fresh driver or shader cache) can be much slower, from seconds to minutes. This is what real users hit on first launch.
So:
  • A preload reports failure after 60 s (PRELOAD_CEILING_SECS): the DirectML workaround for ORT#26858 makes session creation return in seconds, so a real hang fails fast. A transcription that races a load still in progress waits up to 300 s for it (LOAD_LOCK_TRY_TIMEOUT), so a cold JIT on a new GPU architecture finishes instead of failing.
  • A fast preload on a development machine (warm cache) does not validate the cold-JIT deadlock fix, where model loading was moved outside the cache mutex and concurrent from_pretrained calls were serialized. Reproducing that path needs a genuinely cold cache, ideally on an unseen GPU architecture.
  • The ONNX Runtime DirectML runtime is the same pinned version (scripts/ensure-ort.mjs) in dev and in the bundled app, so this is a cold-versus-warm distinction, not a dev-versus-release one.
Treat about 7 s as the warm regression baseline, not the worst case.

Capturing a new baseline

  1. Run the app (bun run tauri:dev) and watch the [ONNX timing] lines, or read the dev log file Echophrase.log.
  2. Note the model id, execution provider (DirectML or CoreML), the GPU, and whether the shader cache was warm (a prior run on this machine and GPU) or cold.
  3. Add a row to the table. Keep warm and cold rows separate; never average them.
Memory baselines for long clips are on GPU and models.