dalle-training
Train and resume DALLE-pytorch transformer workflows with image-text folders, WebDataset shards, VAE choices, tokenizers, and checkpoints.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- dalle-training
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Train and resume DALLE-pytorch transformer workflows with image-text folders, WebDataset shards, VAE choices, tokenizers, and checkpoints.
- disable-model-invocation
- true
02 资源文件 6
- 参考文档references/checkpoints-and-tokenizers.md2.4 KB
- 参考文档references/data-formats.md2.3 KB
- 参考文档references/troubleshooting.md1.9 KB
- 参考文档references/workflows.md2.6 KB
- 脚本scripts/build_train_dalle_command.py4.7 KB
- 脚本scripts/validate_image_text_folder.py3.0 KB
03 SKILL.md 正文
DALL-E transformer training
Use this sub-skill for DALLE transformer training, resume checkpoints, image-text folder/WebDataset preparation, tokenizer choices, model hyperparameters, and DALL-E checkpoint payloads.
Read first
references/workflows.mdfor API and command-style training flows.references/data-formats.mdfor image-text folder and WebDataset schemas.references/checkpoints-and-tokenizers.mdfor VAE/DALL-E checkpoint and tokenizer compatibility.references/troubleshooting.mdfor empty datasets, tokenization, CUDA, W&B, VAE mismatch, and resume failures.scripts/validate_image_text_folder.pybefore training on a folder dataset.scripts/build_train_dalle_command.pyto produce a shell-safe training command template.
Typical routes
| Request | Action |
|---|---|
| "Train DALL-E on my image/caption folder" | Run/describe validate_image_text_folder.py, choose VAE path or VAE wrapper, then build a command template. |
| "Use WebDataset" | Read data-formats.md, require --wds image_key,caption_key, and confirm tar/shard/URL/GCS source behavior. |
| "Resume training" | Inspect checkpoint keys; use --dalle_path and keep original model/tokenizer/VAE assumptions. |
| "Use a custom tokenizer" | Read tokenizer section; make sure vocab_size and padding id match checkpoint/training choices. |
| "Write DALLE API code" | Use references/workflows.md and root references/api-reference.md for constructor/forward details. |
Minimal API pattern
import torch
from dalle_pytorch import DiscreteVAE, DALLE
vae = DiscreteVAE(image_size=128, num_layers=3, num_tokens=8192, codebook_dim=512, hidden_dim=256)
dalle = DALLE(dim=512, vae=vae, num_text_tokens=10000, text_seq_len=256, depth=2, heads=8)
text = torch.randint(0, 10000, (4, 256))
images = torch.randn(4, 3, 128, 128)
loss = dalle(text, images, return_loss=True)
loss.backward()
Boundary notes
- VAE pretraining and VAE-only checkpoints belong to
../vae-training/SKILL.md. - Generation and CLIP reranking belong to
../generation-and-ranking/SKILL.md. - DeepSpeed, Apex, Horovod, Docker, sparse attention backend installation, and CUDA wheel decisions belong to
../distributed-and-backends/SKILL.md.
Validation checklist
Before giving a training answer:
- data layout has been validated or failure points are explicit;
- VAE source (
--vae_path, OpenAI VAE, or VQGAN) is chosen deliberately; - tokenizer path/Chinese flag/truncation is compatible with
text_seq_len; - checkpoint path and resume semantics are clear;
- GPU/W&B/checkpoint side effects are approved before execution;
- optional distributed backend flags are not suggested unless backend availability is known.
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).