unslothai/unsloth · info · SttLoadCancelledError

GGUF STT model loading was cancelled so training could start

Error message

GGUF STT model loading was cancelled so training could start.

What it means

SttLoadCancelledError raised in GgmlSttSidecar._wait_for_server: while polling for whisper-server readiness (up to _SERVER_START_TIMEOUT_SECONDS), the cancel_event is set, typically because a training run requested the GPU/engine back. The pending child spawn is abandoned instead of racing training.

Source

Thrown at studio/backend/core/inference/stt_ggml_sidecar.py:1041

                self._schedule_idle_unload_locked()
            finally:
                reservation.close()  # no-op when already released before spawn
                with self._load_state_lock:
                    self._loading = False
                    self._load_cancel_event = None
                    self._load_owner_cancel_event = None
                    self._starting_process = None

    @staticmethod
    def _wait_for_server(
        process: subprocess.Popen,
        port: int,
        cancel_event: Optional[threading.Event] = None,
    ) -> None:
        deadline = time.monotonic() + _SERVER_START_TIMEOUT_SECONDS
        while time.monotonic() < deadline:
            if cancel_event is not None and cancel_event.is_set():
                raise SttLoadCancelledError(
                    "GGUF STT model loading was cancelled so training could start."
                )
            if process.poll() is not None:
                raise SttEngineUnavailableError(
                    "The local transcription runtime exited before becoming "
                    "ready; the model file may be corrupt or unsupported."
                )
            # Require a whisper-server-specific response twice, with the managed
            # child alive around each probe. An arbitrary local process that won
            # the bind race would otherwise be mistaken for the sidecar and
            # receive the user's microphone audio.
            if GgmlSttSidecar._probe_is_whisper_server(process, port) and (
                GgmlSttSidecar._probe_is_whisper_server(process, port)
            ):
                return
            time.sleep(0.2)
        raise SttEngineUnavailableError("The local transcription runtime did not start in time.")

View on GitHub (pinned to 203007d190)

Solutions

  1. Retry the dictation after training completes — the load was cancelled intentionally, not failed.
  2. Pre-warm the GGML model (call load() without a cancel event) before starting training so dictation works mid-training on CPU/queued.
  3. Do not treat this as engine breakage; it must not call note_runtime_inference_failure or disable the GGML engine.
Defensive patterns

Strategy: retry

Try / catch

try:
    sidecar.load(model_id)
except SttLoadCancelledError:
    # training claimed the engine; retry when it completes
    enqueue_retry(after_training_done)

Prevention

When it happens

Trigger: load() spawned whisper-server and is inside the readiness poll loop when cancel_event (owned by training coordination or the request) is set; the loop raises before the server ever answers.

Common situations: User starts a fine-tune while a dictation model is cold-loading; slow model load from disk on first use overlaps with a queued training job; GPU-constrained machines where loads take tens of seconds.

Related errors


AI-assisted analysis of unslothai/unsloth@203007d190 (2026-08-15). Data as JSON: /api/errors/4f7b2400528990b2. Report an issue: GitHub.