image-architectures
Routes vit-pytorch 2D image classification backbones, architecture-family selection, constructor shape constraints, and image-only variant troubleshooting.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- image-architectures
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Routes vit-pytorch 2D image classification backbones, architecture-family selection, constructor shape constraints, and image-only variant troubleshooting.
- disable-model-invocation
- true
02 资源文件 3
- 参考文档references/model-overview.md13.7 KB
- 参考文档references/troubleshooting.md10.8 KB
- 脚本scripts/smoke_image_architectures.py14.7 KB
03 SKILL.md 正文
image-architectures
Use this sub-skill when the user wants a vit-pytorch model that consumes a regular image tensor shaped (batch, channels, height, width) and returns classification logits, or when they need to choose among the 2D architecture zoo.
Route here for
- Baseline image classifiers:
ViT,SimpleViT,DeepViT,CaiT,T2TViT, andCCT. - Multi-scale or hierarchical 2D image classifiers:
CrossViT,PiT,LeViT,CvT,TwinsSVT,RegionViT,CrossFormer,ScalableViT,SepViT,MaxViT,NesT,MobileViT,XCiT,JetViT, andViT-5. - Image-only variants: patch dropout, patch merger, small-dataset SPT/LSA, QK-norm, relative projected position bias, specialized CLS, value residual, KEEL post-LN, local/rotary/normalized/look/detection-pooling variants, and
simple_flash_attn_vitas a PyTorch SDPA-backed image classifier. - Practical tasks such as selecting a small-memory backbone for
32x32or64x64tensors, repairingimage_size/patch_sizedivisibility errors, choosingpool='cls'vspool='mean', and keeping README-style examples small enough for CPU smoke checks.
Route elsewhere
- Variable-resolution image lists, grouped NaViT packing, nested tensors, 1D/3D/N-D tensors, medical/video tensors, or
ViViT: route tovariable-shapes-video. - Distillation, MAE/SimMIM/MPP/MP3/DINO/EsViT and other loss/pretraining/adaptation wrappers: route to
pretraining-and-adaptation. - Attention maps, embeddings, hook wrappers, external efficient/custom transformer injection, and Recorder/Extractor usage: route to
introspection-and-customization.
First steps for future agents
- Confirm the input is a fixed-size 4D image batch and the desired output is logits. If the user has variable image sizes, videos, patch-token outputs, or training losses, stop and route as above.
- Read references/model-overview.md to pick a family. Start with
ViT/SimpleViT/CCTfor baselines, use hierarchical families only when the user needs local windows, convolutional stems, mobile efficiency, or multi-scale structure. - Keep constructors tiny until the shape works. For
32x32or64x64tests, use dimensions likedim=32,depth=1,heads=2,dim_head=16,mlp_dim=64, and smallnum_classes; do not copy large README dimensions unless the user is explicitly benchmarking. - Check shape constraints before instantiating:
image_sizeandpatch_sizemust divide exactly for patch-based families; many hierarchical/window families also require input feature-map sizes divisible by their window or stage settings. - For classifier heads, set a positive
num_classes. In baseViT-style classes,pool='cls'andpool='mean'are the valid pooling choices when that argument exists; many SimpleViT-style and hierarchical classes hard-code mean/global pooling and do not acceptpool. - If a constructor or forward pass fails, read references/troubleshooting.md before changing families.
- Use the bundled smoke helper for safe CPU checks:
python scripts/smoke_image_architectures.py --case quick. It uses reduced random tensors, asserts logits shapes, and never downloads data.
Bundled runtime files
- references/model-overview.md — family table, selection guidance, tiny constructor patterns, and variant import notes.
- references/troubleshooting.md — repair paths for shape divisibility, pooling, constructor mismatch, memory-heavy defaults, and optional flash-attention branch pitfalls.
- scripts/smoke_image_architectures.py — safe CPU smoke checks for representative 2D image constructors and expected failure cases.
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).