Skip to content

local: LocalClefTypeSafeClient.loadOnGpu; no GPU option for Laya - #19

Merged
dfa1 merged 1 commit into
mainfrom
gpu-option
Oct 3, 2026
Merged

dfa1 merged 1 commit into
mainfrom
gpu-option

Conversation

@dfa1

@dfa1 dfa1 commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Follow-up to #14: a public GPU option where the GPU is both faster and reliable.

  • LocalClefTypeSafeClient.loadOnGpu(Path): Clef-flash on ONNX Runtime's WebGPU backend (Metal). macOS on Apple Silicon only: the WebGPU backend ships only in ONNX Runtime's macOS native library, so elsewhere it throws IllegalStateException.
  • No GPU option for Laya. Measured on an Apple M5, three process launches each:
CPU WebGPU
Clef-flash 4-bit, 3 questions 7–13 s 2–4 s, identical answers on every launch
Laya, billing probability for the same input 0.653 0.49–0.65, varies between launches (fp32 and fp16)

Laya's WebGPU drift is the same silent, hardware-dependent failure mode that removed int8 Laya, for a saving of tens of milliseconds. Its package-private load(dir, gpu) stays for the test harness.

Timings are in the how-to, not the javadoc. Docs, reference, explanation (why Laya has none), CLAUDE.md and CHANGELOG are updated. ./mvnw verify passes; loadOnGpu was also called from another package against the 4-bit model.

🤖 Generated with Claude Code

Clef-flash's 4-bit graph on WebGPU gives the same answers as the CPU on every
launch and runs about 3.5x faster, so it gets a public loadOnGpu (macOS on
Apple Silicon: the WebGPU backend ships only in ONNX Runtime's macOS native
library). Laya stays CPU-only in the public API: on WebGPU its choice
probabilities drifted between process launches (0.49-0.65 for an input the CPU
answers 0.65), the failure mode that removed int8 Laya. Timings live in the
how-to, not the javadoc.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@dfa1
dfa1 merged commit 0a17c9e into main Oct 3, 2026
3 checks passed
@dfa1
dfa1 deleted the gpu-option branch October 3, 2026 18:58
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