Skip to content

Make zero-temperature LiteRT generation greedy - #508

Merged
leehack merged 2 commits into
mainfrom
fix/litert-zero-temperature-sampling
Sep 17, 2026
Merged

leehack merged 2 commits into
mainfrom
fix/litert-zero-temperature-sampling

Conversation

@leehack

@leehack leehack commented Sep 17, 2026

Copy link
Copy Markdown
Owner

Summary

Native LiteRT-LM requests with temp: 0 and the default topK: 40 can produce corrupt Windows GPU output. Request a single greedy candidate for zero-temperature raw generation and chat; preserve positive-temperature sampling settings.

Production-readiness scope

Validation

  • Pinned SDK workspace preparation, repository formatting and analysis passed.
  • All 61 native service tests passed. Six new cases cover raw/chat zero-temperature requests with top-k 0, 1 and 40; existing positive-temperature cases verify unchanged forwarding.
  • Removing the normalization causes the raw/chat regression cases to fail.
  • Full VM suite passed: 2,085 tests, 77 skipped; line coverage 78.62%. Chrome passed 925 tests. Docs build and link validation passed. All 15 final-head GitHub checks passed.
Matrix row Platform/model/backend Result Evidence
windows-x64-ci-runtime (targeted device extension) Windows Server 2022, NVIDIA L4, driver 582.53, D3D12; Qwen3 0.6B and Gemma 4 E2B PASS patched service Fresh math/capital answers, streaming cancellation and reuse. Unpatched Qwen service fails with the same candidate/model/driver. Qualification-only service subclass exposes the known test GPU; stock platform gates stay intact.
windows-x64-ci-runtime Same Windows VM, repaired Qwen3 CPU PASS Patched-service CPU regression control.
macos-arm64-runtime-smoke Apple Silicon, repaired Qwen3, published v0.17.0-3 Metal PASS Existing public-engine chat/thinking/history smoke; strict tool-choice rejection retained.
web-chrome-runtime-smoke LiteRT browser regression PASS 925 Chrome tests; Web sampling implementation is unchanged.

Windows native inputs are the final PR50 candidate at 4c66cb9f1f037f91eed9b1cbe9101463efd8e46a, with upstream-pinned DXC 1.9.2602. Qwen3 bundle revision 8414150f2e9dcc82449bcc9c5abc404b399a4d06 uses the original-tokenizer repair merged in native PR49. Gemma bundle revision b3ca0d2f076785a8f4b2219ddbd2bdb99954eae1 uses gemma-4-E2B-it.litertlm.

Additional isolation: both models fail GPU sampling with temperature 0/top-k 40, pass top-k 1, and pass temperature 0.8/top-k 40. Removing the optional sampler in a test copy and using an explicit library path confirms native CPU sampling fallback while D3D12 model execution remains active; both models pass that control. The temporary VM, disk and firewall rule were deleted after evidence collection.

High-risk regression review

  • Classification: high-risk (backendRuntime)
  • Implementation task: Windows sampler isolation and greedy-service fix in this thread.
  • Independent blocking QA task: /root/litert_greedy_adversarial_audit: complete, no blocking findings; eight independently rerun focused tests passed.
  • Exact head / current base: f6132610181734d2411ed7161b789adc8e6ca9c5 / a5df1c4fcbb1766d26efb5b1d9becda191df89a3.
  • Production-branch deletion proof: Removing both normalization expressions fails raw and chat regression tests for zero-temperature multi-candidate requests.
  • Affected-family real-model evidence: Windows Qwen3/Gemma4 service before/after controls; Mac public-engine Qwen3 Metal smoke.
  • Unavailable-family/platform evidence: Pixel and iOS were not rerun for this change; platform gates and runtime pins remain unchanged. Web real-model GPU was not exercised.
  • Known PR-caused P1 regressions: 0 known after independent review and completed validation.
  • Unresolved review threads: 0 independently verified at final head.

The repository-local readiness evaluator reports internally consistent evidence with unverifiedPrerequisites: external authenticated enforcement prerequisites are unavailable. This is not a claim that those prerequisites are configured. The independent exact-head review above is complete.

@github-actions

github-actions Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Chat app preview removed for leehack/llamadart-chat-pr-508.

@leehack
leehack marked this pull request as ready for review September 17, 2026 00:31
@leehack
leehack merged commit 2a9abd7 into main Sep 17, 2026
16 checks passed
@leehack
leehack deleted the fix/litert-zero-temperature-sampling branch September 17, 2026 00:35
leehack added a commit that referenced this pull request Sep 18, 2026
* fix(deps): bump svgo

Bumps the npm_and_yarn group with 1 update in the /website directory: [svgo](https://github.com/svg/svgo).


Updates `svgo` from 3.3.4 to 3.3.5
- [Release notes](https://github.com/svg/svgo/releases)
- [Commits](svg/svgo@v3.3.4...v3.3.5)

---
updated-dependencies:
- dependency-name: svgo
  dependency-version: 3.3.5
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>

* Exclude metadata and import archives from LiteRT runtime inventory (#498)

* Load LiteRT companions independently of inventory order (#500)

* Preserve required LiteRT iOS provider targets during sync (#501)

* Harden LiteRT runtime synchronization and smoke loading (#502)

* Adopt qualified LiteRT v0.17.0-1 runtime artifacts

* Retain compatible runtime and fix LiteRT smoke dependency loading

* Adopt qualified LiteRT v0.17.0-3 runtime (#503)

* Adopt qualified LiteRT v0.17.0-2 runtime

* Align companion tests with qualified SwiftPM topology

* Adopt the published LiteRT Pixel GPU repair

* Fix LiteRT Qwen3 thinking control and native system messages (#507)

* Fix native Qwen3 thinking-disabled chat templates

* Preserve native system-message content and verify chat history

* Exercise LiteRT chat in existing Linux and Windows smoke jobs

* Make zero-temperature LiteRT generation greedy (#508)

* Use greedy sampling for zero-temperature LiteRT generation

* Clarify greedy sampling applies to LiteRT CPU and GPU

* Adopt LiteRT v0.17.0-5 and enable explicit desktop GPU (#510)

* Update LiteRT runtime to v0.17.0-4

* Adopt corrected LiteRT runtime and expose explicit desktop GPU

* Test desktop GPU capability boundaries across ABIs

* docs: record published desktop GPU qualification

* docs: correct LiteRT desktop GPU capability guide (#512)

* fix: preserve native GGUF detokenization UTF-8 bytes (#516)

* Adopt native v0.4.1 runtime and precision bindings (#497)

* Adopt native v0.4.1 runtime and precision bindings

* Align performance guide with adopted native runtime

* Align native and Web qualification and fix Windows wrapper loading

* Fix Windows precision test loading and companion install docs

* Resolve Windows precision symbols through native asset declarations

* Preserve released install compatibility and test Windows wrapper wiring

* Reuse bundled libraries in Windows wrapper regression probes

* fix(deps): bump svgo

Bumps the npm_and_yarn group with 1 update in the /website directory: [svgo](https://github.com/svg/svgo).


Updates `svgo` from 3.3.4 to 3.3.5
- [Release notes](https://github.com/svg/svgo/releases)
- [Commits](svg/svgo@v3.3.4...v3.3.5)

---
updated-dependencies:
- dependency-name: svgo
  dependency-version: 3.3.5
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: remediate website dependency advisories

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jhin Lee <leehack@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant