x-transformers
Route x-transformers transformer construction, sequence wrappers, and recipe workflows through self-contained sub-skills.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- x-transformers
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Route x-transformers transformer construction, sequence wrappers, and recipe workflows through self-contained sub-skills.
- disable-model-invocation
- true
02 资源文件 9
- 参考文档references/api-reference.md5.8 KB
- 参考文档references/compatibility.md1.7 KB
- 参考文档references/installation.md1.5 KB
- 参考文档references/repo-provenance.md735 B
- 参考文档references/repo-routing-metadata.json525 B
- 参考文档references/troubleshooting.md2.7 KB
- 参考文档references/workflows.md2.2 KB
- 脚本scripts/probe_backend.py2.1 KB
- 脚本scripts/smoke_models.py6.3 KB
03 SKILL.md 正文
x-transformers
Use this skill when the user asks about the x-transformers package, its transformer constructors, wrapper APIs, vision wrapper, or the repository's training recipes.
Quick start
- For a safe installation check, read installation.
- For a fast runtime smoke, run
scripts/probe_backend.pyandscripts/smoke_models.py. - For exact constructor and wrapper signatures, read API reference.
- For feature-selection and compatibility questions, read compatibility and the relevant sub-skill reference.
- For task-specific failures, read troubleshooting.
Choose a route
core-models
Use this when the request is about building or tuning the base transformer stack: TransformerWrapper, XTransformer, ViTransformerWrapper, AttentionLayers, Attention, Encoder, Decoder, PrefixDecoder, CrossAttender, AttentionPool, and TransformerBlock.
Typical triggers:
- choosing attention flags or positional families
- debugging shape or mask errors in a constructor
- building text, seq2seq, or vision-wrapper models from scratch
sequence-workflows
Use this when the request is about wrapper and specialized-model workflows: autoregressive generation, continuous sequences, xVal mixed inputs, XL recurrence, belief-state or next-latent objectives, DPO, FreeTransformer, GPTVAE, NeoMLP, entropy tokenization, or XMLatentDecoder flows.
Typical triggers:
- generation and sampling APIs
- continuous or mixed discrete/continuous sequences
- latent or preference objectives
- memory or test-time-training wrappers
training-recipes
Use this when the request is about the repository's train_*.py examples, enwik8 data assumptions, or a safe smoke for recipe-style training.
Typical triggers:
- understanding which training script to run
- checking required extras and data files
- adapting a recipe to a smaller or safer smoke
Route selection rules
- If the task names a base constructor, attention flag, positional family, pooling mode, or vision wrapper, start with
core-models. - If the task names a wrapper, generation method, continuous/xVal/memory/latent objective, or preference objective, start with
sequence-workflows. - If the task names a
train_*.pyscript or enwik8 recipe, start withtraining-recipes. - If the task is only about install/import/runtime identity, begin with
references/installation.mdandscripts/probe_backend.py.
Notes for future agents
- The package has no dedicated end-user CLI entry point; most workflows are Python APIs or example scripts.
- Keep runtime instructions self-contained inside this skill tree.
- If you need a quick end-to-end smoke, prefer
scripts/smoke_models.pyor the copy-task smoke undersub-skills/training-recipes/scripts/rather than the long native recipes.
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).