AGENT SKILL

ssl-building-blocks

Assemble Lightly low-level SSL data, transform, loss, head, and memory-bank components.

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

01 前言 Front Matter

name
ssl-building-blocks
license
MIT
metadata
{ "disco-role": "operating" }
description
Assemble Lightly low-level SSL data, transform, loss, head, and memory-bank components.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

SSL Building Blocks

Use this sub-skill when a task asks how to compose LightlySSL's low-level pieces without committing to a full CLI or training recipe. It is the right route for API signatures, transform/loss/head selection, tensor shapes, optional component availability, and no-download component smoke tests.

Use this sub-skill for

  • lightly.data.LightlyDataset, LightlyDataset.from_torch_dataset, image/video dataset behavior, and collate functions.
  • Method transforms such as SimCLR, BYOL, SimSiam, MoCo, DINO, SwaV, VICReg, MAE, MSN, iBOT, CAPI, LeJEPA, Pixio, and related families.
  • SSL losses, projection/prediction heads, prototypes, and memory banks.
  • Deprecated high-level model wrappers only as compatibility references; prefer low-level modules for new workflows.
  • Optional lightly[timm] and lightly[video] branches when a task explicitly needs TIMM/ViT modules or direct video-file datasets.
  • Tensor-only smoke checks that should not download datasets, run notebooks, or start long training.

Route elsewhere for

  • Full training loops, PyTorch Lightning recipes, local-folder training plans, or distributed training decisions: use training-workflows.
  • CLI/Hydra/data-folder/crop/embedding commands: use cli-data-embedding.
  • KNN/linear evaluation, benchmark utilities, repository tests, docs, notebooks, or maintainer checks: use evaluation-maintenance.

First actions

  1. Identify the method family and output arity: two-view, multi-crop/multi-view, masked-image, dense/local, or clustering/prototype.
  2. Read Method map to choose compatible transforms, collates, heads, losses, and optional dependencies.
  3. Confirm signatures and tensor contracts in API reference, especially input_dim, output feature width, gather_distributed, memory-bank shape, and optional TIMM/video availability.
  4. Run Smoke script on CPU before moving to real data or a full training loop.
  5. If the smoke fails, read Troubleshooting and fix shape/arity/optional-extra issues before routing to training-workflows.

Common decisions

  • Prefer SimCLRTransform + SimCLRProjectionHead + NTXentLoss for simple contrastive smoke checks.
  • Use DINO/SwaV/MSN/iBOT transforms or collates only when the downstream code expects a list of global/local crops.
  • Set projection-head input_dim to the actual backbone feature width; do not force the loss to compensate for mismatched dimensions.
  • Set gather_distributed=True only inside an initialized distributed process group.
  • Install lightly[timm] or lightly[video] only for workflows that need those optional branches; base pip install lightly is enough for most CPU component checks.

Install reminder

  • Base package: pip install lightly
  • Optional TIMM/ViT modules: pip install "lightly[timm]"
  • Optional direct video support: pip install "lightly[video]"

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