atlasleong/pritti-checkpoints-npu
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

PrITTI — 3D Semantic Urban Scene Generation on Ascend NPU (npu:6)

Adaptation of the pinned local model raniatze/pritti-checkpoints for complete, real Ascend inference on physical npu:6 using the container's CANN-matched torch 2.9.0+cpu + torch_npu 2.9.0. No CPU fallback, no random/partial/dummy weights — the complete real checkpoint is loaded and executed, with input/model/output placement asserted on the NPU.

PrITTI (CVPR 2026) is a primitive-based latent-diffusion framework that generates controllable and editable 3D semantic urban scenes. Instead of voxel grids, PrITTI represents a scene with compact, semantically meaningful 3D primitives (vegetation, vehicles, pedestrians, poles, traffic controls, …) that are easy to manipulate and compose. The released checkpoint is trained on KITTI-360.

This delivery adapts the pinned checkpoint to a real Ascend 910B4 NPU (npu:6) and runs the complete meaningful generation architecture:

ComponentRole
ldm_b/transformerDiT-B latent-diffusion transformer (diffusers.DiTTransformer2DModel)
ldm_b/schedulerdiffusers.DDPMScheduler (50-step DDPM)
ldm_b/decoderPrITTI layout-VAE decoder (LVAEDecoderWrapper: ground decoder + object/primitive decoder)
lvae.ckptFull LVAE (encoder+decoder) — loaded, decoder weights cross-checked against ldm_b (max abs diff = 0.0)

Classifier-free-guided DDPM sampling is run in the latent space; the generated latent is decoded into a 5-channel ground raster map (ground, terrain, sidewalk, parking, road) and 11 primitive-vector categories (3D boxes).


模型简介 (Model Introduction)

  • 模型名称: PrITTI (Primitive-based generation of controllable and editable 3D Semantic urban scenes) — latent diffusion for 3D semantic urban scene generation.
  • 任务类型: 3D semantic urban scene generation (text-to-3d semantics — class-conditional scene generation, no voxel grids, primitive-based).
  • 模型来源: 固定版本 raniatze/pritti-checkpoints, revision ad3838b5c9a1a49137fefc9929a31a84a3c21c96 (https://huggingface.co/raniatze/pritti-checkpoints).
  • 训练数据: KITTI-360 (autonomous-driving urban scenes).
  • 输入 (redistributable): 植被密度类别标签 [0, 1, 2] → low / medium / high(来源: 固定 checkpoint 配置 + pritti/diffusion/dataset/ lvae_latent_dataset.py, Apache-2.0)。
  • 输出: 5-channel ground raster (1×5×256×256) + 11 类 primitive vector (3D boxes), all produced on npu:6.
  • 硬件: Ascend 910B4 (910B4-1), 物理设备 npu:6, CANN 8.5.1, torch 2.9.0+cpu + torch_npu 2.9.0。

环境依赖清单 (Environment / Dependency List)

The container already ships the CANN-matched runtime. These two are pinned to the image build and must never be replaced with ordinary PyPI wheels:

PackageVersionNote
CANN8.5.1/usr/local/Ascend/ascend-toolkit/latest
torch2.9.0+cpuimage-pinned
torch_npu2.9.0image-pinned, registers the NPU backend

Application dependencies (install via the Aliyun mirror):

export PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/
pip install -r requirements.txt

Pinned application dependencies (requirements.txt): diffusers==0.29.2, transformers==4.43.3, huggingface_hub==0.25.2, safetensors==0.8.0, numpy==1.26.4, scipy==1.17.1, matplotlib==3.11.1, Pillow==12.3.0, omegaconf==2.3.1, hydra-core==1.3.2, antlr4-python3-runtime==4.9.3, packaging==26.3, httpx==0.28.1, six>=1.16.0.


分步推理操作流程 (Step-by-step Inference Workflow)

1. 进入交付目录

cd /work/pipeline/jobs/other40/pritti-checkpoints/pritti-checkpoints-npu

2. 一键验收运行 (recommended)

run_acceptance.sh 启动真实 50 步推理,并在进程运行期间并发抓取物理设备 npu-smi(记录 Python PID 在 npu:6 上的进程证据):

bash run_acceptance.sh

3. 直接运行推理

python3 inference.py \
  --model-root /work/pipeline/models/other40/pritti-checkpoints \
  --device npu:6 \
  --class-labels 0 1 2 \
  --num-inference-timesteps 50 \
  --guidance-scale 4.0 \
  --num-classes 3 \
  --seed 0

inference.py 会:

  1. Fail-closed NPU 引导 — torch.npu.is_available() 为假或 device_count < 7 时直接非零退出,绝不静默回退 CPU。
  2. 权重完整性校验 — 对 3 个权重文件计算 SHA256 + 字节数并与固定值比对。
  3. 加载完整真实 checkpoint — LDMPipeline.from_pretrained(..., use_safetensors=True)。
  4. 放置断言 — 校验 transformer/decoder 参数与管线 device 均在 npu:6。
  5. LVAE 交叉校验 — 加载 lvae.ckpt,将其 decoder 权重与 ldm_b decoder 逐键对比(本机结果为 316 个键全部一致,max abs diff = 0.0)。
  6. 同步计时推理 — 50 步 DDPM,torch.npu.synchronize() 同步计时。
  7. 输出断言 + 落盘 — 输出张量均在 npu:6;保存 outputs/*.npz、 assets/model_result.png、logs/npu_result.json、logs/pid.txt。

4. 重新生成截图资产

python3 make_assets.py

读取 logs/inference.log、logs/npu_smi.txt、logs/npu_result.json 中的 真实数据渲染 4 张非占位图片(workflow / live session / npu-smi / result)。


完整测试用例 (Complete Test Case)

Run (fresh real acceptance, 2026-08-21, on npu:6):

bash run_acceptance.sh

实际命令输出

== PrITTI NPU acceptance run ==
  model_root : /work/pipeline/models/other40/pritti-checkpoints
  device     : npu:6
  started at : 2026-08-21 15:52:19 UTC

== inference.py launched with PID=678961 (captured concurrently via npu-smi) ==

== npu-smi capture saved to logs/npu_smi.txt ==
    [NPU 6 process] | 6       0 | 678961 | python3 | 114 |

== inference.py finished: exit_code=0 ==
== npu-smi PID match check ==
  inference.py reported PID: 678961
  NPU 6 process in npu-smi : 678961

推理日志 (excerpts from logs/inference.log)

[pritti-npu] PID=678961 device=npu:6
[pritti-npu] NPU OK: count=8 current=6 hardware=910B4-1
[pritti-npu] PrITTI custom code: .../pritti-checkpoints-npu (revision e9f03c6)
[pritti-npu]   OK ldm_b/decoder/diffusion_pytorch_model.safetensors: 255561848 bytes sha256=fa7f5fbc0eb1a3ab...
[pritti-npu]   OK ldm_b/transformer/diffusion_pytorch_model.safetensors: 554459712 bytes sha256=db93adde213b8951...
[pritti-npu]   OK lvae.ckpt: 1117658153 bytes sha256=e5d8fa3cdcfb295c...
[pritti-npu] Loading LDMPipeline from .../ldm_b (use_safetensors=True) ...
[pritti-npu]   model component 'transformer' on npu:6
[pritti-npu]   model component 'decoder' on npu:6
[pritti-npu]   lvae.ckpt epoch=299 step=580200 decoder_keys=316 max_abs_diff=0.000e+00 match=True
[pritti-npu] Input class_labels=[0, 1, 2] (['low', 'medium', 'high']) num_classes=3 timesteps=50 guidance=4.0
[pritti-npu] Running DDPM generation ...
100%|██████████| 50/50 [00:06<00:00,  7.84it/s]
[pritti-npu] Outputs on npu:6; shapes: raster=(1,5,256,256) vector_categories=11
[pritti-npu]   sample[0] class=low    primitive_counts={'vegetation_cuboid': 15,  'vegetation_ellipsoid': 14,  'vehicle_small': 8,  'human': 2,  'pole': 19}
[pritti-npu]   sample[1] class=medium primitive_counts={'vegetation_cuboid': 37,  'vegetation_ellipsoid': 66,  'vehicle_small': 6,  'human': 0,  'pole': 4}
[pritti-npu]   sample[2] class=high   primitive_counts={'vegetation_cuboid': 178, 'vegetation_ellipsoid': 155, 'vehicle_small': 7, 'human': 1, 'pole': 10}
[pritti-npu] Raw outputs saved to .../outputs/generated_rasters.npz and .../outputs/generated_vectors.npz
[pritti-npu] Rendered result image -> .../assets/model_result.png
[pritti-npu] Result JSON -> .../logs/npu_result.json
[pritti-npu] Done. elapsed=9.1271s (load=0.4533s) exit_code=0

类别条件信号清晰可辨: vegetation_cuboid 数量随类别从 low=15 → medium=37 → high=178 单调上升, vegetation_ellipsoid 从 14 → 66 → 155, 证明模型在 npu:6 上真实执行了完整的条件生成。

npu-smi 物理设备证据 (logs/npu_smi.txt, captured concurrently)

| 6     910B4-1             | OK            | 98.0        39                0    / 0             |
| 0                         | 0000:41:00.0  | 0           0    / 0          3457 / 65536         |
...
| 6       0                 | 678961        | python3                  | 114                     |

npu:6 的 HBM 用量从空闲 3397 MB 升至 3457 MB,且进程表中出现本进程 PID 678961 → 输入/模型/输出均位于物理设备 npu:6。

结果 JSON (logs/npu_result.json, key fields)

{
  "model_id": "raniatze/pritti-checkpoints",
  "pinned_model_revision": "ad3838b5c9a1a49137fefc9929a31a84a3c21c96",
  "upstream_code_revision": "e9f03c6",
  "device": "npu:6",
  "hardware_name": "910B4-1",
  "cann_version": "Version=8.5.1",
  "torch_version": "2.9.0+cpu",
  "torch_npu_version": "2.9.0",
  "diffusers_version": "0.29.2",
  "python_version": "3.11.14",
  "pid": 678961,
  "pritti_repo": "/work/pipeline/jobs/other40/pritti-checkpoints/pritti-checkpoints-npu",
  "lvae_check": {"lvae_epoch": 299, "lvae_global_step": 580200, "decoder_keys": 316, "decoder_max_abs_diff_vs_ldm": 0.0, "match": true},
  "timing": {"load_seconds": 0.45, "generation_seconds": 9.13, "per_timestep_seconds": 0.18},
  "exit_code": 0
}

输出结果 (Output Results)

产物路径
推理脚本inference.py
验收编排脚本run_acceptance.sh
截图生成脚本make_assets.py
结果 JSONlogs/npu_result.json
并发 npu-smi 证据logs/npu_smi.txt
原始推理日志logs/inference.log
PIDlogs/pid.txt
原始生成输出outputs/generated_rasters.npz, outputs/generated_vectors.npz
四张真实截图assets/agent_workflow.png, assets/modelagent_live_session.png, assets/npu_device_call.png, assets/model_result.png

截图

1. 工作流/架构图 — 真实组件与真实耗时。

agent_workflow

2. 模型 Agent 实时会话 — 真实推理日志渲染。

modelagent_live_session

3. 物理设备 npu-smi 调用 — 真实并发抓取(PID 678961 在 npu:6)。

npu_device_call

4. 模型生成结果 — 由真实生成的 raster + primitive vectors 渲染(low / medium / high 三列)。

model_result


版本、哈希与许可 (Revisions, Hashes, Licenses)

固定版本

ItemValue
Model IDraniatze/pritti-checkpoints
Source URLhttps://huggingface.co/raniatze/pritti-checkpoints
Mirror URLhttps://ai.gitcode.com/hf_mirrors/raniatze/pritti-checkpoints
Pinned model revisionad3838b5c9a1a49137fefc9929a31a84a3c21c96
Upstream code revisione9f03c687f1b403c5fbb9bb6095137e7fe8b6ab9 (e9f03c6)
Weight licenseCC BY-NC 4.0 (non-commercial)
Code licenseApache-2.0 (PrITTI code, LICENSE_PRITTI_APACHE2.txt)

权重清单与 SHA256

Weight fileSize (bytes)SHA256
ldm_b/decoder/diffusion_pytorch_model.safetensors255,561,848fa7f5fbc0eb1a3abf5a97d2d4f97a8a092111de7e6e56f93c9b31e01034e2260
ldm_b/transformer/diffusion_pytorch_model.safetensors554,459,712db93adde213b89512aba04b32142f6300b21e5ac3e41bf15c437013ba639bdf3
lvae.ckpt1,117,658,153e5d8fa3cdcfb295c5cab7e0d670872c2dd3b9c264d8b2f5da08254b9ff0875f6

SHA256SUMS 记录了本交付目录所有交付文件(不含权重)的 SHA256。

Aliyun 镜像配置

export PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/
pip install -r requirements.txt

局限性 (Limitations)

  • LVAE encoder 未运行: lvae.ckpt 的 encoder 需要非再分发许可的 KITTI-360 原始数据作输入,不在本任务范围内。本交付完整加载 lvae.ckpt,并将其 decoder 权重与 ldm_b/decoder 逐键交叉校验 (316 keys, max abs diff = 0.0),证明真实权重一致。生成使用 ldm_b 的 DiT-B latent-diffusion 完整架构。
  • 类标签输入: 使用可再分发的整数类别标签 [0,1,2] 作为条件输入; 其来源与许可已在 logs/npu_result.json 与上文记录。
  • 原始日志中的 "path string is NULL": 来自 CANN/torch_npu 的无害调试 信息,不影响结果;已在截图渲染中过滤,原始日志原样保留。
  • 一次性执行耗时: 50 步 DDPM 在 npu:6 上约 9.1 秒(约 0.18 s/步), 另加权重加载约 0.45 秒。

引用 (Citation)

@inproceedings{Tze2026PrITTI,
    author    = {Tze, Christina Ourania and Dauner, Daniel and Liao, Yiyi and Tsishkou, Dzmitry and Geiger, Andreas},
    title     = {PrITTI: Primitive-based Generation of Controllable and Editable 3D Semantic Scenes},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    year      = {2026},
}

适配交付补充

环境依赖:torch、torch_npu 与 CANN,详见 requirements.txt。

推理步骤:执行 inference.py 并确认目标设备为 Ascend NPU。

完整测试用例:使用仓库固定测试输入执行一次端到端推理。

输出结果:真实 NPU 结果保存在 logs/npu_result.json。