Repository navigation
Conversation
This was referenced Nov 9, 2026
Owner
Author
|
Landed through the 0.19.2 batch integration PR #1870 (rebase merge, one commit per constituent; this PR's pinned head was audited/CI-gated there). |
Contributor
|
Chat app preview removed for |
14 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
autoengine failure on both GPU and CPU stays unremembered. The next call that needs an engine retries both, so a cause the caller can clear (an unwritable or full cache directory) recovers without reloading the model.backend-selection.md.lib/change. Items 1, 2 and the item 4 harness mapping already landed in #1658; evidence below.Refs #1458
Refs #1845
metalhint0cf17cf94)lib/src/backends/litert_lm/litert_lm_service.dart:1932-1938exempts an unchanged automatic hint naming the load-time backend (_loadedBackend); testrecreates a CPU fallback context with unchanged metal hints(test/unit/backends/litert_lm/litert_lm_service_test.dart:3152). Mutants re-run on this head: guard disabled -> killed with the issue's exactcannot change the loaded backend from cpu to gpu;device == autoguard dropped -> killed (explicit GPU context no longer refused).autofailure has no retrywebsite/docs/guides/backend-selection.md("Whenautoalready resolves to CPU ... without a second attempt"). Code:_mayRetryAutoGpuOnCpurequiresbackend == gpu(litert_lm_service.dart:1693), default is CPU off Android/iOS/macOS arm64 (litert_lm_platform.dart:36), and a non-GPU/NPU device mapsLiteRtLmEngineCreateErrortoLlamaModelException. Test:a CPU engine that fails to start under ComputeDevice.auto is not retried.autotoGpuBackend.cpupackages/llamadart_validation/lib/src/manifest.dart:766maps onlycputoGpuBackend.cpu; testLiteRT profiles preserve automatic and explicit device selection. Mutant (auto -> cpu) killed.Production-readiness scope
autois retried on the next call, with another warning, and recovers without a reload.autoresolves to GPU (Android, iOS, macOS arm64, or a GPUpreferredBackendhint).gpu/npustill throwLlamaUnsupportedExceptionwithout a CPU retry; CPU-resolvedautothrowsLlamaModelExceptionwithout a second attempt.autodevice run (LiteRT-LM auto CPU fallback: Galaxy S24 device evidence (#1456 audit follow-up) #1458 item 4b), which needs a maintainer-authorized Firebase run.Completeness checklist
PR type guidance
Test Plan
dart run tool/prepare_workspace.dart(clean on base87aaec616)dart format --output=none --set-exit-if-changed .(0 changed)dart analyze(no issues)dart test -p vm -j 1 --exclude-tags local-only: affectedlitert_lm_service_test.dart332 passed; Markdown-selected suites (tool/ci/markdown_test_suites.txt) 729 passed, 4 skipped; full suite in CI.dart test -p chrome --exclude-tags local-only: N/A, the changed test is@TestOn('vm')and no web code changed; CI runs the lane.coverage-libmatrix row: N/A, nolib/change.dart run tool/testing/check_platform_boundaries.dartOK;packages/llamadart_validationdart test -p vm638 passed, 4 CLI tests timed out under parallel host load and passed on a serial rerun (110 passed,-j 1 --timeout 3x). Mutation checks listed in Review Notes.Matrix Evidence
static-format-analyzeroot-vmroot-chromecoverage-liblib/changevalidation-harnessautomapping mutant killeddocs-siteDocs Build Checkpassed; localbuild_site.shcould not bind port 8080 (in use by another worktree)high-risk-exact-head-independent-qastandardReview Notes
Item 3 decision. Remembering the failure per loaded model is not simple and safe:
_ensureClientrebuilds the engine for vision, audio,maxNumImagesand speculative decoding), so a failed image request must not poison a later text request. A correct memo would need a key over those options plus both errors to keep the "throws the GPU error" contract.Mutation results (production restored after each;
git statusclean):false && _automaticBackend)recreates a CPU fallback context with unchanged metal hintscannot change the loaded backend from cpu to gpuparams.device == ComputeDevice.autofrom that exemptionComputeDevice.gpucontext no longer throwsautotoGpuBackend.cpuLiteRT profiles preserve automatic and explicit device selectionGpuBackend.auto, gotGpuBackend.cpu_activeBackend = cpu)the next call after a failed CPU retry tries the GPU and the CPU againS24 run (item 4b), not run here. It is a device/paid Firebase run. With a Galaxy S24 (
SC-51E, API 36) row in an ignoredfirebase.json(seedoc/cross_platform_validation.md, "Firebase setup"):Expected: Qwen3 0.6B fails GPU engine creation on Adreno 750 (binding-size limit), the cases then pass on the CPU, and logcat shows one fallback warning.
Coordination:
lib/src/backends/litert_lm/litert_lm_service.dartis not touched. The test is one added block in theComputeDevice.auto GPU engine fallbackgroup.Independent review status: N/A, standard risk.
CI status / head SHA: all checks green (pass or intentionally skipped), 0 failures, head
43877dd11583cc3cfd98defdbbb45de821528386.High-risk regression review