Skip to content

[WebGPU] JSEP crashes when running Gemma 3 (1b-it) #1469

@KevinL10

Description

@KevinL10

System Info

version: 3.8.0
browser: Chrome 142.0.7444.176
os: macOS 15.6.1

Environment/Platform

  • Website/web-app
  • Browser extension
  • Server-side (e.g., Node.js, Deno, Bun)
  • Desktop app (e.g., Electron)
  • Other (e.g., VSCode extension)

Description

Loading onnx-community/gemma-3-1b-it-ONNX-GQA with either device: "webgpu" or device: "wasm" causes a JSEP crash (see #1239).

The raised error in the reproduction case below is just the string 3436070408, but in some cases it seems like the model load throws a stack trace that looks like:

worker.ts:78 Error details: Aborted(). Build with -sASSERTIONS for more info. RuntimeError: Aborted(). Build with -sASSERTIONS for more info.
    at L (https://cdn.jsdelivr.net/npm/@huggingface/[email protected]/dist/ort-wasm-simd-threaded.jsep.mjs:22:101)
    at tb (https://cdn.jsdelivr.net/npm/@huggingface/[email protected]/dist/ort-wasm-simd-threaded.jsep.mjs:60:98)
    at https://cdn.jsdelivr.net/npm/@huggingface/[email protected]/dist/ort-wasm-simd-threaded.jsep.wasm:wasm-function[1255]:0x1365fa
    at https://cdn.jsdelivr.net/npm/@huggingface/[email protected]/dist/ort-wasm-simd-threaded.jsep.wasm:wasm-function[303]:0x404b9
    at https://cdn.jsdelivr.net/npm/@huggingface/[email protected]/dist/ort-wasm-simd-threaded.jsep.wasm:wasm-function[545]:0x75f9b
    at https://cdn.jsdelivr.net/npm/@huggingface/[email protected]/dist/ort-wasm-simd-threaded.jsep.wasm:wasm-function[82]:0xd24b
    at https://cdn.jsdelivr.net/npm/@huggingface/[email protected]/dist/ort-wasm-simd-threaded.jsep.wasm:wasm-function[153]:0x1bdf9
    at https://cdn.jsdelivr.net/npm/@huggingface/[email protected]/dist/ort-wasm-simd-threaded.jsep.wasm:wasm-function[690]:0x9d8cc
    at https://cdn.jsdelivr.net/npm/@huggingface/[email protected]/dist/ort-wasm-simd-threaded.jsep.wasm:wasm-function[10708]:0xed51eb
    at https://cdn.jsdelivr.net/npm/@huggingface/[email protected]/dist/ort-wasm-simd-threaded.jsep.wasm:wasm-function[1110]:0x114f19 RuntimeError: Aborted(). Build with -sASSERTIONS for more info.
    at L (ort-wasm-simd-threaded.jsep.mjs:22:101)
    at tb (ort-wasm-simd-threaded.jsep.mjs:60:98)
    at ort-wasm-simd-threaded.jsep.wasm:0x1365fa
    at ort-wasm-simd-threaded.jsep.wasm:0x404b9
    at ort-wasm-simd-threaded.jsep.wasm:0x75f9b
    at ort-wasm-simd-threaded.jsep.wasm:0xd24b
    at ort-wasm-simd-threaded.jsep.wasm:0x1bdf9
    at ort-wasm-simd-threaded.jsep.wasm:0x9d8cc
    at ort-wasm-simd-threaded.jsep.wasm:0xed51eb

The same code snippet works fine with Node (tested on v24.7.0).

@xenova maybe we could re-upload the onnx models with the latest conversion scripts?

Reproduction

The example from the docs causes a crash on webgpu/wasm:

import { pipeline } from "@huggingface/transformers";

const generator = await pipeline(
  "text-generation",
  "onnx-community/gemma-3-1b-it-ONNX-GQA",
  { dtype: "q4" },
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions