Run WASM sessions at the default graph optimization level now that ort-web 1.31 loads the 8-bit decoders
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9f1d58c0b7
commit
cc8e031d6b
6 files changed
+70
-11
No files matched your search
@@ -260,14 +260,12 @@ async function createPipeline(
|
||||
const pipelineOptions: PretrainedModelOptions & { sequentialSessionLoad?: boolean } = {
|
||||
device,
|
||||
dtype,
|
||||
// WASM sessions cap graph optimization at "basic" (D-014): the level-2
|
||||
// QDQ transform in the bundled onnxruntime-web build rejects the 8-bit
|
||||
// decoders' tied embed_tokens weight ("Missing required scale …
|
||||
// DequantizeLinear"). q4 models use native MatMulNBits ops, so the
|
||||
// lower level costs them nothing. WebGPU keeps the default level.
|
||||
...(device === "wasm" && {
|
||||
session_options: { graphOptimizationLevel: "basic" as const },
|
||||
}),
|
||||
// No session_options: every backend runs at onnxruntime's default
|
||||
// graph optimization level. D-014's WASM "basic" cap worked around a
|
||||
// level-2 QDQ bug in ort-web 1.26.0-dev that rejected the 8-bit
|
||||
// decoders; the 1.31.0-dev build bundled with Transformers.js 4.3.2
|
||||
// loads them at every level (D-WS1c, pinned in
|
||||
// tests/transformers-runtime.test.ts).
|
||||
progress_callback: forwardProgress,
|
||||
// D-027/D-029: sequential sub-model session loading trades load speed
|
||||
// for a lower peak-memory footprint — only worth it where the UI
|
||||
|
||||
Reference in new issue
Block a user