core-models
Use this repo skill for Swin Transformer model construction, architecture inspection, tensor-shape checks, and CPU model smoke tests across Swin V1, Swin V2, Swin-MLP, and SimMIM encoder variants.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- core-models
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use this repo skill for Swin Transformer model construction, architecture inspection, tensor-shape checks, and CPU model smoke tests across Swin V1, Swin V2, Swin-MLP, and SimMIM encoder variants.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md3.2 KB
- 参考文档references/model-construction.md1.9 KB
- 参考文档references/troubleshooting.md1.6 KB
- 脚本scripts/smoke_model_build.py2.8 KB
03 SKILL.md 正文
core-models
Use this sub-skill when the task is about the model classes themselves: which constructor to use, how build_model dispatches on MODEL.TYPE, which config fields control architecture shape, how window partitioning works, or how to run a small CPU smoke check without touching the training loops.
What this sub-skill covers
build_model(config, is_pretrain=False)dispatch forswin,swinv2,swin_moe, andswin_mlp.SwinTransformer,SwinTransformerV2, andSwinMLPsignatures and the config fields they read.- SimMIM encoder construction through
models/simmim.pywhen the question is about the encoder object or a tiny reconstruction smoke. - Window helper behavior: partition/reverse shapes, shifted windows, and why image size and window size must be compatible.
- CPU-only sanity checks: instantiate a small model, count parameters, and run a minimal forward pass.
What it does not cover
- ImageNet folder/zip/22K data-layout problems: use
data-and-checkpoints. - Training, fine-tuning, evaluation, throughput, DDP, or AMP command composition: use
training-eval-cli. - SimMIM end-to-end scripts and checkpoint remapping details: use
simmim-workflows. - MoE/Tutel/Apex/fused CUDA questions: use
moe-and-acceleration.
Typical user triggers
- "Which config should I use for SwinV2-Tiny?"
- "What does
MODEL.TYPEneed for Swin-MLP?" - "Why does my image/window size break the model constructor?"
- "How can I build a tiny CPU smoke test for
build_model?" - "What is the difference between Swin V1 and Swin V2 position bias behavior?"
Core workflow
- Read the config family map in
references/model-construction.md. - Confirm the model family from
MODEL.TYPEand the config file path. - Check the relevant constructor signature in
references/api-reference.md. - If the request is about safe inspection, run
scripts/smoke_model_build.pywith a repo checkout and a small config override. - If the request is about a constructor error, read
references/troubleshooting.mdfor the shape mismatch or optional-backend warning.
Safe checks
- Building a tiny CPU model is safe when
DATA.IMG_SIZE,MODEL.*.WINDOW_SIZE, and the stage depths are reduced consistently. - The helper script does not download weights or start distributed training.
- Optional fused window-process warnings are expected when the CUDA extension is missing; they are not baseline failures.
Related references and scripts
- Read
references/api-reference.mdfor verified signatures and the key architecture fields. - Read
references/model-construction.mdwhen choosing a config family or reducing a config for smoke tests. - Read
references/troubleshooting.mdfor common constructor and shape errors. - Run
scripts/smoke_model_build.pywhen you want a tiny CPU construction check.
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).