model-library
Discover timm model names, instantiate models, load pretrained or local weights, adapt heads/input channels/pooling, inspect pretrained configs, extract features, and debug model registry or weight-loading issues.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- model-library
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Discover timm model names, instantiate models, load pretrained or local weights, adapt heads/input channels/pooling, inspect pretrained configs, extract features, and debug model registry or weight-loading issues.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md8.6 KB
- 参考文档references/model-workflows.md7.2 KB
- 参考文档references/troubleshooting.md6.6 KB
- 脚本scripts/model_smoke_check.py2.8 KB
03 SKILL.md 正文
Model Library
Use this sub-skill when a task asks an agent to choose or instantiate a timm architecture, enumerate available models or pretrained tags, load weights, adapt classification heads or input channels, inspect model defaults, extract feature maps, or troubleshoot model creation and pretrained loading.
Fast Path
- Import from the public package surface:
import timm, then usetimm.list_models,timm.list_pretrained,timm.get_pretrained_cfg, andtimm.create_model. - Prefer no-download checks while iterating:
timm.create_model(name, pretrained=False)and run a small random forward pass. - Use
list_models(filter='*resnet*')for architecture discovery andlist_pretrained(filter='*resnet*')for exactarchitecture.tagpretrained identifiers. - Create a model with the exact signature from timm 1.0.28.dev0:
create_model(model_name, pretrained=False, pretrained_cfg=None, pretrained_cfg_overlay=None, checkpoint_path=None, cache_dir=None, scriptable=None, exportable=None, no_jit=None, **kwargs). - Adapt common dimensions at construction time:
num_classes,in_chans,global_pool,features_only,out_indices,output_stride,scriptable,exportable, andno_jit. - Inspect
model.pretrained_cfgortimm.get_pretrained_cfg(model_name).to_dict()before choosing transforms, class counts, input channels, or cache/download behavior.
Decision Guide
- Need model discovery or exact API signatures: read
references/api-reference.md. - Need classifier/input/pooling/feature-extraction recipes: read
references/model-workflows.md. - Need to diagnose unknown names, tag failures, cache/auth/download problems, checkpoint mismatches, or feature shape surprises: read
references/troubleshooting.md. - Need a safe local smoke test without network access: run
python sub-skills/model-library/scripts/model_smoke_check.py --model resnet18 --num-classes 7from the skill root or copy the script into a project.
Boundary Routing
- Use
../data-pipelines/for transforms, loaders,resolve_data_config, augmentation, and preprocessing pipelines after readingpretrained_cfghere. - Use
../training-workflows/for optimizers, schedulers, losses, training loops, fine-tuning scripts, and distributed training. - Use
../export-and-interoperability/for ONNX, TorchScript export flows, checkpoint conversion tools, Hugging Face push/pull packaging, and deployment formats. - Use
../layers-and-components/for low-level timm layers, blocks, activations, pooling modules, and component internals.
Guardrails
- Do not set
pretrained=Truein smoke checks unless downloads, cache location, and Hugging Face authentication are expected and acceptable. - Do not assume all names returned by
list_models()have pretrained weights; uselist_pretrained()oris_model_pretrained()when weights matter. - Do not hardcode image normalization, crop size, or class count for pretrained models; inspect
pretrained_cfgand route preprocessing details todata-pipelines. - Do not assume
features_only=Truereturns the same number of feature levels for every model family; inspectmodel.feature_info.channels()andmodel.feature_info.reduction().
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).