凤
weixin_44093752/flooddiffusion-ascend-npu
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

FloodDiffusion Ascend NPU adaptation

This repository adapts the official ShandaAI/FloodDiffusion model at revision b70b9d7e7e7002eec136bf763245d76361fcf4a1. The official source is Apache-2.0 and the upstream implementation is also available at ShandaAI/FloodDiffusion.

Real Ascend910 smoke result

The official diffusion and VAE safetensors were loaded strictly in the QuietPhoenix Ascend container. The adapted runtime completed a real npu:0 forward with torch_npu, using the official minimum legal denoise schedule of five steps. The result is finite and is a smoke-only execution record, not a full precision or generation-quality claim.

ItemResult
Devicenpu:0
Model revisionb70b9d7e7e7002eec136bf763245d76361fcf4a1
Latent output[1,4]
Decoded output[1,263]
Dtypetorch.float32
Finitetrue
Parameters131,221,455 including VAE
NPU forward0.420409s

Ascend compatibility changes

  • RoPE frequency construction is explicitly complex64; Ascend rejects the official complex128 cat path.
  • The official FlashAttention CUDA assertion is replaced on NPU with a float32 matmul-softmax attention fallback.
  • The CUDA default-device lookup is bypassed on the CPU-only PyTorch build in the container.
  • The smoke entrypoint uses deterministic fixed text features instead of downloading the separate UMT5-XXL text checkpoint.

Weights are intentionally excluded from Git by .gitignore; model-lock.json records the official revision, file sizes, and SHA-256 values. Place model.safetensors and vae.safetensors beside ldf.yaml before running.

Run

source /usr/local/Ascend/ascend-toolkit/set_env.sh
python inference.py --model-dir . --device npu --output validation/npu-runtime.json

Evidence

Agent workflow

NPU device call

Model result