放风铃的兔子头像
【Bug已解决】[WebNN][WebGPU EP] Device tensor can not be properly initialized 解决方案封面图

【Bug已解决】[WebNN][WebGPU EP] Device tensor can not be properly initialized 解决方案

【Bug已解决】[WebNN][WebGPU EP] Device tensor can not be properly initialized 解决方案

一、现象长什么样

在 WebNN 或 ORT 的 WebGPU EP 上,模型尝试创建一个 device tensor(常驻设备显存的张量,比如预分配的 KV cache、常驻常量、或跨 run 复用的 buffer)时,初始化失败,报错类似“device tensor can not be properly initialized”:

// WebNN / ORT Web 上预分配设备侧 tensor(用于 KV cache 等)
const session = await ort.InferenceSession.create("model.onnx", {
  executionProviders: ["webgpu"],
});
// 某些初始化阶段:device tensor 创建失败 -> 报错

最小信号:

device tensor(设备侧常驻张量)初始化失败
WebGPU / WebNN 后端特有
可能是 buffer 创建标志不对、设备或队列未就绪、初始化顺序错

注意:这不是普通推理错,而是设备资源(device tensor)创建阶段失败,常发生在 session 初始化 / 第一次 run 之前。

二、背景

“device tensor”指的是分配在 GPU

转载自 CSDN-专业IT技术社区

原文链接:https://blog.csdn.net/mrdeam/article/details/163732746

文章来源转载

评论

评论列表

微信小程序
QQ小程序

关于作者

点赞数:0
关注数:0
粉丝:0
文章:0
关注标签:0
加入于:--