HA app on Intel N150: every job fails with "Embedding contains non-finite values" (CLIP int8 on OpenVINO GPU)

Open
#189 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
machine-learning, python, yaml

Research direction

Start with the keystone.embedder and keystone.ort_runtime paths and reproduce the CLIP int8 failure through the OpenVINO GPU provider, checking /api/status and the worker logs. Use DOCS.md and run.py to understand memory_profile, then inspect the Home Assistant app's config.yaml schema. Done means non-finite GPU output triggers the existing CPU fallback path, or the requested acceleration configuration is exposed, with a regression test covering the chosen behavior.

Written by the indexing model from the issue text.

Description

needs-triage
What happened?

What happened?
Steps to reproduce:

Install the Keystone Home Assistant app on an amd64 host with an Intel N150 iGPU. Set controller_ip, leave all five feature switches on, and leave the vision URL blank.
Adopt the AI Key and the AI Port in Protect. Enable Basic Object Recognition, Face Recognition and Speech-to-Text.
Trigger smart detections on any camera.
Expected: Keystone indexes the detections, and Find Anything returns them.

Actual: every recognizeKeyFrames and describeImage job fails with ValueError: Embedding contains non-finite values, on both cameras that have sent events so far, and none have completed. Each failed job takes about 20 seconds. Once a few events arrive close together, the queue backs up: later jobs fail with TimeoutError, and speechToText jobs expire before they run.

/api/status shows CLIP vision running on the GPU through OpenVINO with the int8 model at FP16 precision. The inference tracker still counts those runs as successes (clip:vision failures=0, fellBack=false), so nothing falls back to CPU. The Whisper int8 encoder hit a GPU problem at startup too ("the graph is not acyclic") and did fall back to CPU on its own. int8 graphs on this GPU look like the common factor.

The Home Assistant app gives no way to work around this. Its options have no acceleration setting, and memory_profile (documented in DOCS.md and read by run.py) isn't in the app's config.yaml schema, so Supervisor rejects it.

Suggested fixes:

Treat non-finite OpenVINO outputs as an inference failure and retry on CPU, the way the CUDA, MIGraphX and CoreML paths already do.
Expose acceleration.provider / acceleration.cpu_models, or add memory_profile to the app's schema, so HA users can work around a model that misbehaves on their GPU.

Keystone version / commit

Home Assistant app 0.1.8 (amd64, Intel image)

UniFi Protect, UniFi OS, and console

Protect 7.3.74, UniFi OS 6.0.19, UNVR

Installation method

Home Assistant app

Relevant config (sanitized)
# Home Assistant app options
controller_ip: <protect-ip>
vision_provider: ollama
# vision_base_url: (blank, descriptions disabled)
speech_to_text: true
license_plate_recognition: true
enhance_face: true
face_recognition: true
ai_port: true

# Effective settings reported by /api/status
acceleration:
  provider: auto
  openvino_device: "AUTO:GPU,CPU"
  precision: FP16
  gpu_large_allocations: true
embeddings:
  backend: clip
  quantization: int8
  vision_model: vision_model_int8.onnx
  provider: OpenVINOExecutionProvider(AUTO:GPU,CPU)
Keystone DEBUG logs
Note: the Home Assistant app has no log_level option, so these are the default INFO-level logs from the app's Log tab.

13:16:29 INFO    [keystone.embedder] Loaded CLIP ViT-L/14 (quantization=int8, vision=vision_model_int8.onnx, text=lazy, provider=OpenVINOExecutionProvider(AUTO:GPU,CPU), threads=2)
13:16:38 INFO    [keystone.face] Loaded face models scrfd_2.5g (OpenVINOExecutionProvider(AUTO:GPU,CPU)) + w600k_r50 (OpenVINOExecutionProvider(AUTO:GPU,CPU))
13:16:42 WARNING [keystone.ort_runtime] OpenVINO session init failed for stt:whisper-base:encoder (device=AUTO:GPU,CPU): [ONNXRuntimeError] : 1 : FAIL : This is an invalid model. Error: the graph is not acyclic.; falling back to CPUExecutionProvider
13:16:47 WARNING [keystone.stt] Whisper whisper-base int8 encoder is running on CPU. OpenVINO GPU can reject dynamic integer graphs during session initialization. For GPU inference set stt.quantization to fp16 or fp32.
13:16:50 INFO    [keystone.lpr] License plate recognition ready (detector=yolox_tiny [OpenVINOExecutionProvider(AUTO:GPU,CPU)], ocr=cct_s_v2 [OpenVINOExecutionProvider(AUTO:GPU,CPU)], 2 threads)
13:16:55 INFO    [keystone.app] Keystone v0.1.8 ready (adopted=False)
13:19:17 INFO    [keystone.control] Adoption confirmed by Protect timeSync response!
13:19:17 INFO    [keystone.search] Connected Find Anything search WSS
13:19:19 INFO    [keystone.control] Console linked: NVR (Protect 7.3.74)
13:19:26 INFO    [keystone.aiport] AI Port adoption confirmed by Protect paramAgreement!
13:24:00 INFO    [keystone.worker] Admitted recognizeKeyFrames (camera=69b444700092ed03e4069e86 event=59d21a00-70c2-44d9-a4f0-edc2bfeb93e5 queue=1)
13:24:21 WARNING [keystone.worker] Job recognizeKeyFrames failed (camera=69b444700092ed03e4069e86 event=59d21a00-70c2-44d9-a4f0-edc2bfeb93e5): ValueError: Embedding contains non-finite values
13:25:33 INFO    [keystone.worker] Admitted describeImage (camera=69b444700092ed03e4069e86 event=6b14570e003abc03e40ef8f6 queue=1)
13:25:53 WARNING [keystone.worker] Job describeImage failed (camera=69b444700092ed03e4069e86 event=6b14570e003abc03e40ef8f6): ValueError: Embedding contains non-finite values
13:31:44 WARNING [keystone.worker] Job describeImage failed (camera=69b0313c001eed03e4002fc7 event=6b145825006fbc03e40efbbf): ValueError: Embedding contains non-finite values
13:32:45 WARNING [keystone.worker] Job describeImage failed (camera=69b0313c001eed03e4002fc7 event=6b1458570188bc03e40efc77): ValueError: Embedding contains non-finite values
13:33:03 WARNING [keystone.worker] Job describeImage failed (camera=69b444700092ed03e4069e86 event=6b14585c0372bc03e40efc9b): TimeoutError
13:33:18 WARNING [keystone.worker] Dropping expired speechToText job (camera=69b0313c001eed03e4002fc7 event=6b145825006fbc03e40efbbf)
13:33:27 WARNING [keystone.worker] Job describeImage failed (camera=69b0313c001eed03e4002fc7 event=6b145875007cbc03e40efce0): TimeoutError
13:33:30 INFO    [keystone.worker] STT camera=69b0313c001eed03e4002fc7 event=6b145875007cbc03e40efce0 audio=14.1s segments=0 (11796 ms)
Additional context
  • Hardware: GMKtec G3 Plus mini PC, Intel N150 (Twin Lake, 4 cores / 4 threads, Intel UHD graphics), 16 GB DDR4.

  • Host OS: Home Assistant OS 18.4, Home Assistant Core 2026.12.0.

  • Acceleration: OpenVINO auto-selected AUTO:GPU,CPU at FP16 for CLIP, face, LPR and the AI Port detector. The Whisper encoder fell back to CPU at startup. Keystone uses about 7 GB of RAM after first start.

  • Network: the HAOS host and the UNVR are on the same LAN and subnet. Discovery and adoption worked straight away.

  • What works: adoption of both the AI Key and the AI Port, the control and search connections, Protect settings sync (Face Recognition and Speech-to-Text on), and speech-to-text on CPU. That one STT job ran but found no speech in 14 s of audio.

  • What fails: every job that needs a CLIP image embedding.

  • Ports: no conflicts on 8080, 443, 5432 or UDP 10001.

Dominant language
Python
Stars
1k
Forks
114
Avg merge
1h
Merged PRs (30d)
115

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from seeARMS/keystone

All issues in seeARMS/keystone

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.