mirror of
https://github.com/storytold/lightcraft.git
synced 2026-10-26 02:59:17 -06:00
On an Intel Mac with an AMD Radeon Pro 5300M the Metal compiler crashes on candle's mlx_gemm kernel, candle-metal-kernels panics on the compile error, and the worker reported "the AI model failed unexpectedly" and loaded the model on Metal again for every next job, so AI masks never worked there. The worker now retries a job that fails on the GPU (a panic or a candle error) once on the CPU, after freeing the model. When that works, the model stays on the CPU for the session and the job's outcome carries a notice that segment_poll shows once; when the CPU fails too, the GPU was not the cause and the next job uses it again. Missing or damaged model files, render and remote-worker errors are not retried. Only builds with a GPU path (macOS) retry; LIGHTCRAFT_GPU=0 and LIGHTCRAFT_GPU_BACKEND=off now keep SAM 3 on the CPU from the start (lightcraft_gpu::env_off_reason), like AI Denoise and the face models. lightcraft-segment: Sam3::load_cpu, GPU_BUILD; text_logits returns the crate's Error so Describe failures are classified like clicks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>