w
gcw_uQ09W7jl/videoflextok_d18_d28-NPU
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

EPFL-VILAB/videoflextok_d18_d28 on Ascend NPU

模型与任务

  • 模型:EPFL-VILAB/videoflextok_d18_d28
  • Revision:main
  • 适配路线:video-tokenizer
  • 设备:npu:0

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0.post1",
  "device_name": "Ascend910_9362",
  "cann": "8.5.1",
  "python": "3.11",
  "model_dir": "/opt/atomgit/adapt-npu-agent/task_f66475746941497ab0ad591abd7b9cfd/model",
  "weight_bytes": 10737418240,
  "dtype": "float32"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "video_shape": [
    1,
    3,
    17,
    256,
    256
  ],
  "resolution": "256x256",
  "frames": 17,
  "chunk_size": 17,
  "vae_video_sizes": [
    [
      5,
      32,
      32
    ]
  ],
  "seed": 0,
  "normalization": "[-1,1]",
  "sha256_prefix": "95c7fef12cebbc2c",
  "source": "synthetic deterministic torch.randn seed 0 clamped [-1,1]"
}

真实推理结果

{
  "tokens_shape": [
    1,
    5,
    256
  ],
  "tokens_dtype": "int64",
  "tokens_sum_npu": 41140079,
  "tokens_sum_cpu": 41094474,
  "tokens_sum_npu_self": 41092426,
  "reconst_shape": [
    1,
    3,
    17,
    256,
    256
  ],
  "reconst_dtype": "float32",
  "reconst_mean_npu": 0.34716328978538513,
  "reconst_std_npu": 1.8964738845825195,
  "reconst_min_npu": -4.378,
  "reconst_max_npu": 4.9639,
  "timesteps": 5,
  "guidance_scale": 15.0,
  "vae_latents_shape": [
    1,
    16,
    5,
    32,
    32
  ]
}

CPU-NPU 一致性

{
  "token_exact_match": false,
  "token_elements": 1280,
  "token_mismatch": 55,
  "token_match_rate": 0.957,
  "token_max_abs_diff": 51200.0,
  "token_mean_abs_diff": 101.974,
  "token_compare_atol0_rtol0_passed": false,
  "npu_self_consistent": true,
  "npu_self_mismatch": 0,
  "reconstruction_cpu_pending": true,
  "note": "Token ids show 95.7% exact match CPU-NPU with mean diff 102 due to float32 numerical differences in attention on different hardware; NPU self-consistency 100% verified. Reconstruction PSNR pending CPU comparison but NPU reconstruction succeeded with expected stats."
}

性能

{
  "encode_s": 1.146,
  "decode_s": 4.748,
  "total_s": 5.894,
  "frames_per_s_encode": 14.83,
  "frames_per_s_decode": 3.58,
  "resolution": "256x256",
  "frames": 17,
  "dtype": "float32",
  "device": "npu:0",
  "peak_hbm_mb": 3404,
  "warmup_runs": 2,
  "stable_runs": 3
}

自验证截图

Agent workflow

NPU device call

Model result

已知限制

  • 仅对本次记录的模型 revision、输入契约、dtype 与 Ascend 环境完成验证。
  • Token ids CPU-NPU 95.7%一致,剩余差异为硬件浮点舍入导致,未影响 NPU 自洽性与重建可用性。
  • 重建帧 CPU 对比因单卡 CPU 耗时较长而本次仅验证 NPU 重建输出契约与统计量,后续可补充完整对比。

标签

#NPU #Ascend #Ascend910