AGENT SKILL

pretraining-and-adaptation

Routes vit-pytorch loss wrappers, self-supervised pretraining helpers, distillation, and adaptation or fine-tuning flows.

License 许可
MIT
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
pretraining-and-adaptation
license
MIT
metadata
{ "disco-role": "operating" }
description
Routes vit-pytorch loss wrappers, self-supervised pretraining helpers, distillation, and adaptation or fine-tuning flows.
disable-model-invocation
true

02 资源文件 3

03 SKILL.md 正文

pretraining-and-adaptation

Use this sub-skill when the user asks how to build or smoke-test vit-pytorch loss-based wrappers, self-supervised learners, distillation flows, or adaptation heads. The goal is to route to the right wrapper, identify expected inputs and outputs, and surface version/dependency pitfalls before a user starts a long training run.

Read first

  • Read references/workflows.md for wrapper roles, tiny construction patterns, expected input/output shapes, and which helpers return logits versus scalar losses.
  • Read references/troubleshooting.md when a wrapper fails during construction, hook registration, augmentation, optional dependency import, checkpoint loading, or the first loss backward pass.
  • Run scripts/smoke_pretraining_wrappers.py to check the installed package with tiny CPU random tensors. The helper reports verified, version_fragile, dependency_gap, and unexpected_failure statuses.

Route here for

  • DistillableViT, DistillableT2TViT, DistillableEfficientViT, and DistillWrapper one-step teacher/student distillation.
  • Masked-image or masked-position pretraining: MAE, SimMIM, MPP, and MP3.
  • Self-supervised crop/view learners: Dino, EsViTTrainer, and LeJEPA.
  • Adaptation/fine-tuning helpers: Learnable Memory ViT Adapter, VAT, SigLIP-VAT, optional VAAT, WWT, and vit_with_decorr.ViT.
  • Questions like “does this wrapper still work after upgrading?”, “can I run a one-step loss check on random tensors?”, and “what dependencies do I need for this adaptation flow?”

Do not route here for

Current compatibility gates

Treat these as live caveats for this generated snapshot until the bundled smoke helper proves otherwise for the installed version:

  • MAE and SimMIM are intended to return scalar reconstruction losses, but tiny current-package smokes with base ViT reproduce a positional-embedding shape mismatch. Do not promise they work after an upgrade without rerunning the helper.
  • MPP is intended to return a scalar masked patch prediction loss, but the current base-ViT usage is token-shape fragile around class-token and patch embedding expectations.
  • MP3, DistillWrapper, Dino, EsViTTrainer, Learnable Memory Adapter, LeJEPA, VAT, SigLIP-VAT, WWT, and vit_with_decorr.ViT have tiny CPU smoke patterns in the bundled helper. Still rerun the helper in the user’s runtime, because optional dependencies and installed versions can differ.

Fast workflow

  1. Identify the user’s requested wrapper and whether they need a scalar loss, logits, action predictions, or an adapter head.

  2. Read references/workflows.md for the wrapper’s construction pattern and expected tensors.

  3. Run a bounded check before full training:

    python sub-skills/pretraining-and-adaptation/scripts/smoke_pretraining_wrappers.py
    

    Add --json for machine-readable output, or --case dino --case distill for a narrow check.

  4. If any result is version_fragile, explain the exact pitfall and avoid presenting that wrapper as verified. If any result is dependency_gap, name the missing optional package instead of starting a full training script.

  5. For long training, downloads, pretrained checkpoint loading, W&B/Accelerate, or real datasets, keep the one-step smoke separate from the heavyweight recipe and list the extra prerequisites explicitly.

Output expectations by wrapper family

  • Distillation: DistillWrapper(img, labels) returns a finite scalar loss; the distillable student can be converted back with .to_vit().
  • MAE/SimMIM/MPP/MP3: intended API returns a finite scalar loss and supports loss.backward(), but MAE/SimMIM/MPP require current-version compatibility checks before use.
  • DINO/EsViT/LeJEPA: constructors attach/hook a hidden layer, run augment/crop logic, and forward(images) returns a finite scalar self-supervised loss. DINO and EsViT also require update_moving_average() after optimizer steps.
  • Learnable Memory ViT: Adapter(vit=..., num_classes=...) freezes the supplied module-specific ViT and returns task logits.
  • VAT/SigLIP-VAT/VAAT: with actions=..., return an L1 action-prediction loss; without actions, return predicted action chunks. Prefer explicit view/time dimensions for smoke inputs.
  • WWT: returns class logits, and may also return token logits, task-head outputs, or a SigReg loss depending on constructor flags.
  • vit_with_decorr.ViT: returns (logits, decorr_aux_loss); train with ordinary task loss plus a weighted decorrelation auxiliary term.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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).

★ 351