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

businesslion/scaffdiff on Ascend NPU

模型与任务

  • 模型:businesslion/scaffdiff
  • Revision:2a0165a5b93259d5ced2f26b196298b36e55dbf0
  • 适配路线:point-cloud-scene-completion (scaffold-dominant diffusion teacher)
  • 设备:npu:0 (Ascend910_9362, CANN 8.5.1, torch_npu 2.9.0)

环境依赖

{
  "soc": "Ascend910 (2 chips, npu:0 used)",
  "cann": "8.5.1",
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0.post1",
  "python": "3.11.14 (aarch64)",
  "key_ops_replaced": [
    "spconv.SubMConv3d -> pure-PyTorch gather-based sub-manifold conv (identical weight layout)",
    "torch_scatter.segment_csr -> index_add / padded-max CSR reduction",
    "spconv.SparseConvTensor -> lightweight container",
    "int64 tensor bit shifts -> multiply / floor-div emulation",
    "torch.cdist (denoiser kNN) -> matmul squared-distance topk"
  ]
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "fixture": "deterministic synthetic outdoor LiDAR-like scan (ground plane + 5 boxes + 4 poles), seed=42",
  "raw_points": 17195,
  "points_after_voxelization": 16965,
  "scaffold_points": 7951,
  "voxel_size_m": 0.05,
  "timestep_t": 200,
  "dtype": "fp32",
  "device_tensors": "coord/color/normal/batch all on npu:0"
}

真实推理结果

{
  "pred_x0_shape": [
    7951,
    3
  ],
  "finite_ratio": 1.0,
  "pred_mean_m": [
    -0.0445,
    0.2764,
    -0.0251
  ],
  "pred_std_m": [
    20.9239,
    20.8521,
    0.8629
  ]
}

CPU-NPU 一致性

{
  "protocol": "identical weights (strict state-dict load, sha256 eb599c52...), identical fixture/seed/dtype, CPU baseline vs npu:0",
  "mean_abs_diff_m": 0.004994,
  "max_abs_diff_m": 0.105203,
  "mean_abs_diff_relative_to_scene_scale": 0.000122,
  "within_one_scaffold_voxel_005m_ratio": 0.997,
  "criteria": "mean diff <= 1% scene scale (41.1 m), max diff <= 5% scale, >=99% points within one 0.05 m voxel",
  "passed": true
}

性能

{
  "latency_first_run_s": 1.283,
  "latency_stable_mean_s": 1.2853,
  "latency_stable_std_s": 0.0024,
  "fps_stable": 0.778,
  "peak_memory_gb": 1.069,
  "warmup_runs": 3,
  "timed_runs": 12,
  "timing": "torch.npu.synchronize() before/after each timed run"
}

自验证截图

Agent workflow

NPU device call

Model result

已知限制

  • 仅对本次记录的模型 revision、输入契约、dtype(fp32) 与 Ascend 910 环境完成验证。
  • 验证输入为确定性合成 LiDAR 样式场景 fixture(seed=42,SHA-256 记录),非 SemanticKITTI 真实数据集。
  • teacher_v2gt checkpoint 在 GT-scaffold 分布内最优;部署式 LiDAR scaffold 场景应使用 teacher_v2gt_ft(本次未覆盖)。

标签

#NPU #Ascend #Ascend910