vae-training
Train and inspect DALLE-pytorch discrete VAE workflows, VAE checkpoints, and pretrained VAE alternatives.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- vae-training
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Train and inspect DALLE-pytorch discrete VAE workflows, VAE checkpoints, and pretrained VAE alternatives.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/troubleshooting.md1.6 KB
- 参考文档references/workflows.md3.3 KB
- 脚本scripts/build_train_vae_command.py3.5 KB
- 脚本scripts/tiny_vae_api_smoke.py1.1 KB
03 SKILL.md 正文
VAE training
Use this sub-skill when the user asks about DiscreteVAE, VAE codebooks, VAE image folders, VAE checkpoint files, OpenAI's pretrained VAE, Taming Transformers VQGAN, or the VAE stage before DALL-E transformer training.
Read first
references/workflows.mdfor VAE API recipes, command construction, checkpoint contents, and pretrained VAE choices.references/troubleshooting.mdfor image-size assertions, OpenAI VAE torch limits, W&B/GPU side effects, and VQGAN path errors.scripts/tiny_vae_api_smoke.pywhen you need a no-download CPU check.scripts/build_train_vae_command.pywhen a user needs a reproducible VAE training command template.
Typical routes
| Request | Action |
|---|---|
"Train the VAE" or "prepare vae.pt" |
Validate image folder shape, build a command with scripts/build_train_vae_command.py, and warn about CUDA/W&B/checkpoint side effects before running long training. |
"Use DiscreteVAE in Python" |
Use the API recipe in references/workflows.md; verify with scripts/tiny_vae_api_smoke.py. |
| "OpenAI pretrained VAE fails" | Check torch version; source asserts torch <=1.10. Prefer a trained DiscreteVAE or VQGanVAE unless the user accepts a legacy environment. |
| "Use VQGAN VAE" | Require both model checkpoint and YAML config paths when not using the default download path; route backend/download questions to root troubleshooting. |
"What is in vae.pt?" |
Explain hparams and weights, and that DALL-E training reconstructs DiscreteVAE(**hparams) before loading weights. |
Minimal API pattern
import torch
from dalle_pytorch import DiscreteVAE
vae = DiscreteVAE(
image_size=256,
num_layers=3,
num_tokens=8192,
codebook_dim=512,
hidden_dim=64,
num_resnet_blocks=1,
)
images = torch.randn(4, 3, 256, 256)
loss = vae(images, return_loss=True)
loss.backward()
indices = vae.get_codebook_indices(images)
recon = vae.decode(indices)
Keep detailed constructor notes and training command options in references/workflows.md, not in this router.
Boundary notes
- DALL-E transformer training after VAE preparation belongs to
../dalle-training/SKILL.md. - Image generation and CLIP ranking belong to
../generation-and-ranking/SKILL.md. - DeepSpeed/Apex/Horovod/Docker/CUDA setup belongs to
../distributed-and-backends/SKILL.md. - Do not instantiate pretrained VAE wrappers merely to inspect the package; they can download model files or assert on torch version.
Validation checklist
Before approving a VAE workflow answer:
- image size is a power of two and matches the intended downstream DALL-E VAE;
- image mode (
RGBvs transparentRGBA) matcheschannels; - checkpoint side effects and output filenames are explicit;
- W&B/account/network behavior is acknowledged;
- if a full script command is produced, the user has a checkout or script copy that can run it;
- package-level API alternatives are offered for pip-only users.
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).