unslothai/unsloth · info · SttLoadCancelledError

GGUF STT model loading was cancelled.

Error message

GGUF STT model loading was cancelled.

What it means

SttLoadCancelledError raised inside load()'s try block after _load_state_lock registered the load (self._loading=True, _load_cancel_event set): the cancel event is set right before releasing the warm model and spawning whisper-server. This checkpoint keeps the load state machine consistent before the expensive process spawn.

Source

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

                # A deliberate CPU install must stay CPU: the slim wiring links
                # every llama ggml backend (including CUDA/ROCm), so without
                # this flag a cpu-selected install would still grab the GPU.
                command.append("--no-gpu")
            logger.info(
                "Starting whisper-server for STT model %s on 127.0.0.1:%s",
                model_id,
                port,
            )
            cancel_event = (
                request_cancel_event if request_cancel_event is not None else threading.Event()
            )
            with self._load_state_lock:
                self._load_cancel_event = cancel_event
                self._load_owner_cancel_event = request_cancel_event
                self._loading = True
            try:
                if cancel_event.is_set():
                    raise SttLoadCancelledError("GGUF STT model loading was cancelled.")
                self._release_locked()
                # Release the reservation as late as possible: whisper-server
                # binds the port moments after this close.
                reservation.close()
                process = subprocess.Popen(
                    command,
                    stdout = subprocess.DEVNULL,
                    stderr = subprocess.DEVNULL,
                    stdin = subprocess.DEVNULL,
                    # Co-located GPU libs on the loader path (WSL system HIP first),
                    # secrets scrubbed from the downloaded binary's env.
                    env = _whisper_server_child_env(binary),
                    # Die with Studio (Linux PDEATHSIG, Windows job) so a crash
                    # never orphans a server holding the model.
                    **child_popen_kwargs(),
                )
                with self._load_state_lock:
                    self._starting_process = process

View on GitHub (pinned to 203007d190)

Solutions

  1. Catch SttLoadCancelledError and retry the load once the conflicting operation (training) yields, with a fresh cancel event.
  2. Serialize loads: do not start a new load while training acquires the GPU; wait for the coordination event to clear.
  3. Verify the caller is not pre-setting the cancel event it passes in.
Defensive patterns

Strategy: retry

Try / catch

try:
    sidecar.load(model_id, request_cancel_event=ev)
except SttLoadCancelledError:
    retry_after_training_or_user_action(model_id)  # fresh event

Prevention

When it happens

Trigger: A load switches models (warm model must be unloaded), and between registering the load state and calling _release_locked()/Popen the request_cancel_event (or the internal load cancel event) is set — e.g. training wants the GPU back or the user cancelled.

Common situations: Model switch during dictation; training job starting exactly as a cold load begins; a previous load's cancel event being reused for a new load.

Related errors


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