Skip to content

fix(hexagon): correct buffer contracts and physical memory projections - #128

Merged
Alok-Ranjan23 merged 3 commits into
speechfrom
feat/whisper-hexagon-fit
Oct 23, 2026
Merged

Alok-Ranjan23 merged 3 commits into
speechfrom
feat/whisper-hexagon-fit

Conversation

@Alok-Ranjan23

@Alok-Ranjan23 Alok-Ranjan23 commented Oct 22, 2026 •

Copy link
Copy Markdown

Whisper HTP fit undercounted physical allocation guards and treated unknown FastRPC capacity as a zero-byte dedicated memory pool. Quantized matmul also advertised bufferless/default-host support even though DSP execution requires repacked weights. This fixes sizing/capacity metadata and storage support; no numerical grading or kernel arithmetic changes.

Head: d1b3e16c0c3b2da178c9c0d04685240bf69d7df5. Base: speech, the actual shared producer consumed by Fabric Speech. Paired engine: Speech PR #360, current head 9dfcfcd5cd88a934e125cac3b2d061af648a06e2.

Changes

  • Add an allocation-free physical-buffer size callback, exact per-chunk projections, checked guard arithmetic and safe shared-buffer detachment on growth. Existing backends keep identity behavior; backend interface layouts are unchanged.
  • Declare HTP unified memory and keep real guard metadata consistent. Paired Whisper fit uses OS RAM only for unknown unified capacity and charges prospective metadata growth.
  • Reject unsupported canonical quantized storage before allocation; add actual explicit-REPACK HTP0-versus-CPU math coverage with unchanged tolerances.
  • Add portable allocator/lifetime/overflow regressions and focused Linux/macOS/Windows shared/static native CI. Shared-growth lifetime regression failed before the fix and passes afterward.

Validation

One real device: OnePlus CPH2723, SM8750, Android16, HTP v79. Android arm64 Release/API28 uses NDK r28b, Hexagon SDK6.6.0.0 /Tools19.0.07; matching DSP skeletons v73/v75/v79/v81 build.

Check Result
Shared native CI Six host lanes (Ubuntu/macOS/Windows ×shared/static), each 3 host tests passed; 2 HTP arms explicitly skipped on each host
Exact-SHA paired Speech CI 24/24 CPU fixtures passed against Speech 9dfcfcd5; no skips or failures
Device contracts, each environment Buffer and runtime-info contracts passed; 26 support assertions +5 actual REPACK Q8 math cases passed with queue/compute stage bits verified
Focused operators, default 58 passed /0 failed /15 unsupported
Focused operators, GGML_HEXAGON_NDEV=1 GGML_HEXAGON_HOSTBUF=0 65 passed /0 failed /8 unsupported
Fit with current paired engine 7 supported cases ×5 components =35/35 exact projected/measured byte pairs; pressure control correctly rejects; 10,833,920 prospective metadata bytes independently verified
Failed graph measurement Four unsupported full-Whisper HOSTBUF=0 graphs now correctly return Error / measurement-failed in paired Speech; no full-model HOSTBUF=0 support claim
Repeated model corpus 228/228 native calls complete; all transcripts exactly match the original corresponding backend/model/clip

The same original 73 instances /70 unique operator cases were selected in each environment. Seven default canonical-Q8 cases previously failed; the support fix now truthfully marks them unsupported, not passed. The explicit REPACK tests supply five real DSP math comparisons per environment; worst NMSE is 1.45089067e−5 versus unchanged 5e−4. Four F16 GELU and four non-contiguous NORM cases remain unsupported in each environment. All 24 follow-up native test commands exit0; exit codes alone are not used as case counts. No full backend suite was run.

Fit's four default tiny/base Q8 variants plus CPU/OpenCL compatibility and pressure control have exact component parity. VAD component is zero; no VAD inference claim. The paired Speech graph-measurement fix propagates scheduler failure instead of returning a false-small success for existing unsupported preallocated KV copies.

Exact-SHA paired native workflow and automatic shared host workflow are green. Shared PR rollup: 10 successful checks, one intentional paired-job skip on the PR event. HTP host skips are separate from actual device execution above. Full logs, native exit receipts, source/artifact hashes and JUnit artifacts are retained locally. Independent source/workflow reviews found no remaining blocking implementation issue.

Device fit/corpus/operator counts above remain attributed to the previously recorded fit-error/runtime deployments. The new Speech-only default preference changes native CLI/fit selection and passes the updated paired host fixtures; its optional short phone selector smoke was not rerun because wireless debugging is unreachable. Shared code and its prior device math validation are unchanged.

Accepted French exception and scope

Ready for human review with the paired engine. On 2026-10-22, Alok explicitly accepted its known tiny multilingual Q8 French difference for this task because HTP matches OpenCL and the intended meaning is essentially unchanged. Original scores remain CPU 26/63 errors (41.26984% WER), HTP/OpenCL 27/63 (42.85714% WER), +1.58730pp versus the unchanged +1.0pp limit. The différents→différentes substitution retains the intended adjective meaning but has incorrect grammatical gender agreement. This is a documented acceptance exception for that result; the raw numerical gate still fails, and the score, scorer, corpus, model and tolerance are unchanged.

All 228 repeated transcripts are unchanged. Exact-dequantized F32 on the same phone CPU also selects the accelerator word; diagnostics support precision-sensitive ranking without proving every upstream operation correct. This producer PR does not change the recorded recognition output. Task completion remains pending review and merge.

Task: https://app.asana.com/1/45238840754660/project/1214153063536860/task/1219734880954142

Fabric-only. QVAC/SDK, consumer packages/prebuilds, registry rollout and releases remain deferred until legal review and separate authorization.

@Alok-Ranjan23
Alok-Ranjan23 merged commit 33c690b into speech Oct 23, 2026
32 checks passed
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.

3 participants