System Info
Browser and all environments that support WebGPU.
Environment/Platform
Description
Due to a bug in onnxruntime, after we dispose a pipeline or a model the WebGPU is destroyed, but the JavaScript reference in env.webgpu.device is never cleared, leaving a stale reference to a destroyed device.
This means next time it tries create a WebGOU session, it tries to access the destroyed WebGPU device and fails.
Reproduction
-
install Transformers.js v4 npm i @huggingface/transformers@next
-
create a pipeline with webgpu:
const pipe = await pipeline(
"feature-extraction",
"onnx-community/all-MiniLM-L6-v2-ONNX",
{
device: "webgpu",
}
);
- destroy the pipeline
- create a new pipeline with webgpu:
const pipe2 = await pipeline(
"feature-extraction",
"onnx-community/all-MiniLM-L6-v2-ONNX",
{
device: "webgpu",
}
);
System Info
Browser and all environments that support WebGPU.
Environment/Platform
Description
Due to a bug in onnxruntime, after we dispose a pipeline or a model the WebGPU is destroyed, but the JavaScript reference in env.webgpu.device is never cleared, leaving a stale reference to a destroyed device.
This means next time it tries create a WebGOU session, it tries to access the destroyed WebGPU device and fails.
Reproduction
install Transformers.js v4
npm i @huggingface/transformers@nextcreate a pipeline with webgpu: