#32627·onnxruntime

[WebGPU] BEN2-ONNX `Failed to create a WebGPU compute pipeline: [Invalid ShaderModule "LayerNorm"] is invalid due to a previous error.`

Author: xenovaCreated Sep 16, 2026Updated Sep 16, 2026
Labelsmodel:transformerplatform:web.NETep:WebGPU

Describe the issue

Running https://huggingface.co/onnx-community/BEN2-ONNX/resolve/main/onnx/model_fp16.onnx in-browser on WebGPU produces this error:

An error occurred during model execution: "Error: failed to call OrtRun(). ERROR_CODE: 1, ERROR_MESSAGE: /mnt/azure_nvme_temp/_work/1/s/onnxruntime/core/providers/webgpu/buffer_manager.cc:562 WGPUBuffer onnxruntime::webgpu::BufferManager::Create(size_t, wgpu::BufferUsage, bool, bool) const [ONNXRuntimeError] : 1 : FAIL : Failed to create a WebGPU compute pipeline: [Invalid ShaderModule "LayerNorm"] is invalid due to a previous error.
 - While validating compute stage ([Invalid ShaderModule "LayerNorm"], entryPoint: "main").

To reproduce

javascript
import { pipeline } from 'https://cdn.jsdelivr.net/npm/@huggingface/[email protected]';

const segmenter = await pipeline('background-removal', 'onnx-community/BEN2-ONNX', {
  device: 'webgpu'
});
const url = 'https://fastly.picsum.photos/id/669/600/400.jpg?hmac=bLAdpG18lXVIyqPBMPwwlhVGhHlsl-KMMmOPa3NYxw0';
const output = await segmenter([url]);
output[0].save('mask.png');

Urgency

high: blocks BEN2-ONNX usage in Transformers.js 4.3.0 (previously working in 4.2.0)

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

latest

Execution Provider

'webgpu' (WebGPU)