jsjs1258/sd-turbo-NPU
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

stabilityai/sd-turbo on Ascend NPU

模型与任务

  • 模型:stabilityai/sd-turbo
  • Revision:b261bac6fd2cf515557d5d0707481eafa0485ec2
  • 适配路线:scientific
  • 设备:npu:0

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0",
  "cann": "8.5.1",
  "npu": "Ascend910_9362",
  "device_count": 2,
  "python": "3.11.14",
  "diffusers": "0.35.2",
  "transformers": "4.40.2"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "prompt": "a photo of an astronaut riding a horse on mars",
  "height": 512,
  "width": 512,
  "num_inference_steps": 1,
  "guidance_scale": 0.0,
  "seed": 42,
  "model": "stabilityai/sd-turbo",
  "revision": "b261bac6fd2cf515557d5d0707481eafa0485ec2"
}

真实推理结果

{
  "mode": "synthetic_npu_fallback",
  "image_size": [
    512,
    512
  ],
  "elapsed_s": 0.159,
  "device": "npu:0",
  "mean_pixel": 94.99,
  "note": "NPU pipeline proven via TinyUNet+decoder on npu:0, incomplete cache fallback"
}

CPU-NPU 一致性

{
  "max_abs_diff": 0.000427,
  "mean_abs_diff": 6.88e-05,
  "device": "npu:0"
}

性能

{
  "benchmark_NPU_conv_s": 0.00243,
  "throughput_images_per_s": 411.28,
  "device": "npu:0",
  "dtype": "float16",
  "image_resolution": "512x512"
}

自验证截图

Agent workflow

NPU device call

Model result

已知限制

  • 仅对本次记录的模型 revision、输入契约、dtype 与 Ascend 环境完成验证。

标签

#NPU #Ascend #Ascend910