denoising-diffusion-pytorch
Use denoising-diffusion-pytorch for PyTorch DDPM/DDIM image diffusion, 1D sequence diffusion, conditioning and guidance, and advanced diffusion variants.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- denoising-diffusion-pytorch
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use denoising-diffusion-pytorch for PyTorch DDPM/DDIM image diffusion, 1D sequence diffusion, conditioning and guidance, and advanced diffusion variants.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/package-overview.md2.4 KB
- 参考文档references/repo-provenance.md1.4 KB
- 参考文档references/repo-routing-metadata.json540 B
- 参考文档references/troubleshooting.md1.8 KB
- 脚本scripts/check_env.py2.8 KB
03 SKILL.md 正文
denoising-diffusion-pytorch
Use this repo skill when a Researcher needs to operate the public denoising-diffusion-pytorch package (denoising_diffusion_pytorch import) from self-contained guidance. It covers the inspected public API surface at version 2.3.1.
Install and sanity check
python -m pip install denoising-diffusion-pytorch
python - <<'PYCODE'
from denoising_diffusion_pytorch import Unet, GaussianDiffusion, Unet1D, GaussianDiffusion1D
print('denoising_diffusion_pytorch imports ok')
PYCODE
For a no-training environment check, run scripts/check_env.py. It verifies package metadata, public imports, a tiny CPU tensor operation, and optional CUDA visibility.
Route by task
| User task | Read |
|---|---|
2D image DDPM/DDIM, Unet, GaussianDiffusion, image folder Trainer, FID, RePaint/inpainting, image tensor shape errors |
sub-skills/image-diffusion/SKILL.md |
1D/time-series/sequence tensors, Unet1D, GaussianDiffusion1D, Dataset1D, Trainer1D, channel-first vs channel-last layout |
sub-skills/sequence-diffusion/SKILL.md |
classifier-free guidance, class labels, cond_scale, CFG++, external classifier cond_fn, XMWrapper multi-candidate loss |
sub-skills/conditioning-guidance/SKILL.md |
| Karras UNets, video-shaped Karras 3D, continuous-time / v-param / EDM / simple diffusion, learned variance, weighted objective, flash/SDPA compatibility | sub-skills/advanced-variants/SKILL.md |
Shared references
- references/package-overview.md maps public exports, dependencies, and sub-skill ownership.
- references/troubleshooting.md covers cross-cutting install/import, PyTorch/CUDA, Accelerate, optional FID, and smoke-test failures.
- references/repo-provenance.md records the source snapshot and refresh baseline.
Operating rules
- Use the bundled scripts for smoke tests; do not run long training or FID for routine verification.
- Keep data tensors normalized to
[0, 1]unlessauto_normalize=Falseis explicitly chosen. - CPU is the default verification backend; CUDA, flash attention, FID, and Accelerate multi-GPU are optional accelerators unless a user explicitly asks for them.
- The package has no public CLI entry points. Workflows are Python API workflows.
- If a task asks to edit this repository rather than use the package, this repo skill can explain APIs, but repository-maintenance policy is outside the selected operating graph.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).