executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
introspection-and-customizationRoutes vit-pytorch attention recording, embedding extraction, custom transformer injection, flash-attention-style wrappers, and parallel transformer customization helpers.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this sub-skill when the user wants to inspect a vit-pytorch backbone or swap in a transformer implementation, especially prompts mentioning Recorder, Extractor, attention maps, embeddings/latents, efficient.ViT, Nystromformer, x-transformers, simple_flash_attn_vit, simple_flash_attn_vit_3d, or parallel_vit.
vit_pytorch.recorder.Recorder. Read API reference and run smoke_introspection.py when validating an install. The recorder wraps a backbone, registers hooks on first forward, returns (predictions, attention_maps), and must be ejected when hooks are no longer needed.vit_pytorch.extractor.Extractor. Read API reference before choosing layer_name, layer, layer_save_input, return_embeddings_only, or detach. Use this for transformer outputs, multi-scale outputs, and custom hook points.vit_pytorch.efficient.ViT when the user already has or wants to provide a token-sequence transformer. Read API reference. External examples such as nystrom-attention and x-transformers are optional; the CPU-supported contract can be checked with the bundled smoke helper's tiny in-script transformer stub.parallel_vit and simple_flash_attn_vit questions here. Treat flash/SDPA and CUDA behavior as optional performance paths, not requirements for the selected CPU scope. Read API reference and troubleshooting.This sub-skill owns hook lifecycle, attention-map capture, latent extraction, custom transformer token contracts, optional acceleration caveats, and safe fallback advice for introspection/customization wrappers.
Route elsewhere instead of duplicating guidance:
ViT/SimpleViT classifier construction belong to the image-architecture route.simple_flash_attn_vit_3d as a flash/SDPA customization wrapper.Wrap raw backbones deliberately. Recorder and Extractor are wrappers around a model object; avoid stacking wrappers unless you explicitly pass the inner layer object to Extractor. If a wrapper is ejected, use the returned backbone or create a fresh wrapper for more introspection.
Validate hook targets before long runs. Hooks register on the first forward, so wrong layer_name values and unsupported attention-module types often fail only when the model is called. Prefer a tiny random tensor smoke check before training or large inference.
Keep custom transformer outputs token-shaped. efficient.ViT supplies tokens shaped (batch, token_count, dim) and then performs pooling and the classifier head itself. The injected transformer must return a compatible token tensor, not pooled logits, a tuple, or a changed embedding dimension.
Treat accelerations as optional. The flash-attention-style modules use PyTorch scaled dot-product attention when enabled; they do not require the external flash-attn package for CPU functional checks. If a backend or optional package is unavailable, fall back to standard vit-pytorch backbones or a stub/standard transformer rather than blocking the CPU workflow.
Use the bundled smoke helper for confidence. After installing vit-pytorch, run:
python sub-skills/introspection-and-customization/scripts/smoke_introspection.py
Run it from the generated vit-pytorch skill directory, or pass the script path directly from any working directory. It imports the installed package and does not read external source files.