Skip to content

The time it takes to execute setBackend varies across different backends. #7847

Open
@jhl13

Description

@jhl13
import * as tf from '@tensorflow/tfjs';
import { model } from '@tensorflow/tfjs';
import { setWasmPaths, setThreadsCount, getThreadsCount } from '@tensorflow/tfjs-backend-wasm';
setWasmPaths('https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm/wasm-out/');
import '@tensorflow/tfjs-backend-webgpu';

async function Init() {
    await tf.setBackend("webgpu");
    console.log("done");
}
Init();

Is it normal for the webgpu backend to take a long time when using setBackend? Is there any way to reduce the duration of this operation?

cpu backend

cpu

wasm backend

wasm

webgl backend

webgl

webgpu backend

webgpu

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions