conditioning-guidance
Use denoising-diffusion-pytorch conditioning and guidance APIs: classifier-free guidance, classifier-gradient cond_fn guidance, and XMWrapper multi-candidate loss.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- conditioning-guidance
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use denoising-diffusion-pytorch conditioning and guidance APIs: classifier-free guidance, classifier-gradient cond_fn guidance, and XMWrapper multi-candidate loss.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md4.3 KB
- 参考文档references/troubleshooting.md2.8 KB
- 参考文档references/workflows.md3.1 KB
- 脚本scripts/smoke_conditioning_guidance.py4.7 KB
03 SKILL.md 正文
Conditioning Guidance
Use this sub-skill for conditioning and guidance surfaces in denoising-diffusion-pytorch: classifier-free guidance, class-label sampling controls, external classifier-gradient cond_fn guidance, and XMWrapper multi-candidate loss selection.
Route here when
- The task mentions classifier-free guidance, class conditioning,
num_classes, class labels,classes,cond_drop_prob,cond_scale,rescaled_phi, or CFG++ /use_cfg_plus_plus. - The task asks for an external classifier
cond_fn,guidance_kwargs, classifier-gradient sampling, label-conditioned classifier logits, or guidance shape/device debugging. - The task asks about
XMWrapper, explorative / multi-candidate loss,candidates,max_batch_size,random_time_method, orrandom_time_kwarg.
Route elsewhere for base setup
- 2D image
Unet,GaussianDiffusion, image folders,Trainer, FID, DDIM/DDPM basics, interpolation without classes, or RePaint setup: ../image-diffusion/SKILL.md. - 1D tensors,
Unet1D,GaussianDiffusion1D,Dataset1D,Trainer1D, sequence layout, sequence sampling, orchannel_first: ../sequence-diffusion/SKILL.md. - Karras models, continuous-time wrappers, learned variance, weighted objectives, simple diffusion, flash/SDPA attention, or other advanced variants: ../advanced-variants/SKILL.md.
Operating map
- Read references/api-reference.md for import paths, signatures, tensor contracts, and guidance-specific semantics.
- Read references/workflows.md for safe recipes: CFG loss/sample, classifier-gradient
cond_fn,XMWrapper, and candidate chunking. - Read references/troubleshooting.md for label shape errors, CFG schedule assertions, guidance strength issues,
cond_fngradient failures, andXMWrapperfailures. - Run scripts/smoke_conditioning_guidance.py after installing the package to verify tiny CPU or CUDA guidance checks without training, downloads, or data files.
Safe defaults
For quick local checks, keep models tiny: dim=8, dim_mults=(1,), channels=1, image_size=8 or seq_length=8, timesteps=8, sampling_timesteps=4, random tensors in [0, 1], candidates=2, and max_batch_size no larger than batch * candidates.
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).