From 13909b6e8dfeb2d65ffbfc0c4163a43de3fcae80 Mon Sep 17 00:00:00 2001 From: Jhin Lee Date: Sun, 8 Nov 2026 07:51:13 -0500 Subject: [PATCH] Stop passing a thread count to LiteRT-LM GPU and NPU validation profiles Since #1734 the LiteRT-LM C API 1.0 path rejects numberOfThreads for any backend but CPU, so every chat-litert-gpu case after C01.load failed with LlamaUnsupportedException before reaching the GPU engine. --- packages/llamadart_validation/lib/src/manifest.dart | 3 ++- packages/llamadart_validation/test/validation_test.dart | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/llamadart_validation/lib/src/manifest.dart b/packages/llamadart_validation/lib/src/manifest.dart index 4f6380de1..6d50455cf 100644 --- a/packages/llamadart_validation/lib/src/manifest.dart +++ b/packages/llamadart_validation/lib/src/manifest.dart @@ -766,7 +766,8 @@ class ValidationProfile { preferredBackend: device == ComputeDevice.cpu ? GpuBackend.cpu : GpuBackend.auto, - numberOfThreads: threads, + // LiteRT-LM rejects a thread count for any backend but CPU. + numberOfThreads: device == ComputeDevice.cpu ? threads : 0, ); } return LlamaCppModelParams( diff --git a/packages/llamadart_validation/test/validation_test.dart b/packages/llamadart_validation/test/validation_test.dart index e9a751227..979bc8636 100644 --- a/packages/llamadart_validation/test/validation_test.dart +++ b/packages/llamadart_validation/test/validation_test.dart @@ -587,6 +587,7 @@ void main() { ); expect(selected.effectiveConfig['backend'], device.name); expect(selected.effectiveConfig['gpu_layers_hint'], params.gpuLayers); + expect(params.numberOfThreads, device == ComputeDevice.cpu ? 4 : 0); expect(selected.effectiveConfig['batch_threads'], 0); expect( selected.effectiveConfig['sampling_application'],