jsjs1258/ruv-ruview-NPU
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

ruv/ruview on Ascend NPU

模型与任务

  • 模型:ruv/ruview
  • Revision:472cfbe8482403256d45f4acb0aed1a5f0db41be
  • 适配路线:csi-encoding (WiFi CSI → 128-dim 感知嵌入, presence 检测, 可扩展 Wiflow 姿态)
  • 设备:npu:0 (Ascend910_9362)
  • 原始任务标注:asr (实际为 WiFi 感知编码, 按 npu-adapt-signal 的 csi-encoding 路由实现; 已在 NPU 上验证)
  • 说明: 本次适配检测到模型非 ASR 而是 WiFi CSI 感知模型, 按最匹配的 signal 技能完成真实 NPU 验证, 保证不伪造 ASR 转写。

环境依赖

{
  "python": "3.11.14",
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0.post1+gitee7ba04",
  "cann": "8.5.1",
  "device": "Ascend910_9362",
  "device_count": 2,
  "npu_available": true
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

可选参数:--model-dir /data/adapt-npu-agent/hf/cache/ruv_ruview --device npu:0

脚本从本地 model_dir 加载 model.safetensors (48KB) 与 wiflow-v1/wiflow-v1.json (974KB), 均显式迁移到 npu:0, 输入/输出 Tensor 同步校验 device, 计时前后调用 torch.npu.synchronize().

真实输入

{
  "csi_encoding_input": {
    "shape": [1, 8],
    "dtype": "float32",
    "sampling": "synthetic CSI features @1Hz, seed 42, scale 0.5",
    "values_sample": [0.2483, -0.0691, 0.3238, 0.7615]
  },
  "wiflow_input": {
    "shape": [1, 35, 20],
    "dtype": "float32",
    "description": "CSI amplitude matrix, 35 subcarriers x 20 time steps, rand [0,1]"
  },
  "quantization": "4-bit default (model-q4.bin 8KB) documented, full precision used for NPU parity"
}

真实推理结果

{
  "output_emb_shape": [1, 128],
  "output_emb_sample": [71.074798, -123.797943, -28.56604, 37.443977, 43.146385],
  "presence_prob": 0.0,
  "presence_threshold": 0.3,
  "presence_label": "empty",
  "device": "npu:0",
  "consistency": {
    "max_abs_diff": 2.3e-05,
    "mean_abs_diff": 4e-06,
    "cosine_sim": 1.0,
    "pass": true,
    "threshold": "cos >=0.999, max_diff <1e-3"
  },
  "timing": {
    "avg_ms": 3.076,
    "min_ms": 0.865,
    "max_ms": 22.347,
    "throughput_windows_per_sec": 325.1,
    "batch": 1,
    "window_sec": 1,
    "note": "includes first compile ~22ms, stable ~0.9ms"
  },
  "wiflow_pose": "load warning shape mismatch (flat weights vs arch), not required for csi-encoding PASS; encoder route verified"
}

原始 NPU 日志见 model_result.png, 包含完整环境、设备证明、同步计时与 PASS 标记。

CPU-NPU 一致性

{
  "route": "csi-encoding",
  "input": "same 1x8 CSI vector, same weights, same dtype float32",
  "cpu_emb_sample": [71.074806, -123.797943, -28.566034],
  "npu_emb_sample": [71.074798, -123.797943, -28.56604],
  "max_abs_diff": 2.3e-05,
  "mean_abs_diff": 4e-06,
  "cosine": 1.0,
  "pass": true,
  "method": "torch.nn.functional.cosine_similarity, synchronize before timing"
}

单条信号仅称为 smoke consistency, 不称完整任务评测。已按 task-adaptation.md 的 csi-encoding 指标 (cosine >=0.999) 验收。

性能

{
  "avg_latency_ms": 3.076,
  "min_ms": 0.865,
  "throughput_windows_per_sec": 325.1,
  "window_shape": [1, 8],
  "dtype": "float32",
  "device": "npu:0",
  "warmup": 3,
  "measured_runs": 10,
  "note": "稳定态 <1ms, 编译开销计入平均; 8KB 量化模型理论更快但未单独计时"
}

自验证截图

Agent workflow

NPU device call

Model result

已知限制

  • 仅对本次记录的模型 revision、输入契约、dtype 与 Ascend 环境完成验证。
  • 官方标注为 asr 但实际为 csi-encoding WiFi 感知, 已按最匹配路线实现, 不伪造语音转写。
  • WiFlow 姿态分支因 flat 权重与 arch 描述不完全一致而跳过, 编码与 presence 分支已通过 NPU 一致性。
  • 量化 variant (q2/q4/q8) 存在但本次使用全精度路径对齐 CPU 基线。
  • 单条合成 CSI 仅为 smoke consistency, 非完整数据集评测。

标签

#NPU #Ascend #Ascend910