AGENT SKILL

custom-models

Build or debug Asteroid custom models, blocks, registries, DSP helpers, and tracing behavior.

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

01 前言 Front Matter

name
custom-models
license
MIT
metadata
{ "disco-role": "operating" }
description
Build or debug Asteroid custom models, blocks, registries, DSP helpers, and tracing behavior.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

Custom models and core APIs

Use this sub-skill when the user is building a new Asteroid architecture, extending a block, or debugging a low-level API rather than running a recipe or applying a pretrained model.

Typical triggers

  • custom BaseModel or BaseEncoderMaskerDecoder subclasses
  • asteroid.models.get(...) or register_model(...)
  • asteroid.masknn, asteroid.dsp, asteroid.complex_nn, or asteroid.utils
  • filterbanks, encoders, decoders, mask networks, or normalization layers
  • TorchScript / tracing / shape issues
  • register_norm(...), register_optimizer(...), or prepare_parser_from_dict(...)

What to do first

  1. Identify the exact block or API family the user wants to extend.
  2. Decide whether they need:
    • a built-in model family
    • a reusable block
    • a custom serialization contract
    • a tracing or shape-debugging pass
  3. Check the expected input/output shape and the sample-rate contract before editing anything.

Standard workflow

  • Read references/api-reference.md for the model/block/registry surface.
  • Read references/jit-and-tracing.md when TorchScript or torch.jit.trace is involved.
  • Read references/troubleshooting.md when the issue looks like a shape, serialization, or registry mismatch.
  • Use scripts/smoke_building_blocks.py to exercise representative blocks and utilities locally.

Common task families

  • new source-separation architectures
  • custom encoders/decoders or filterbanks
  • mask network experiments
  • complex-number-aware layers
  • batch or source-dimension shape debugging
  • registry-based extension points for activations, norms, optimizers, or models

Built-in model families worth recognizing

The repo exposes ready-to-use model families such as:

  • ConvTasNet
  • DPRNNTasNet
  • DPTNet
  • LSTMTasNet
  • DeMask
  • DCUNet
  • DCCRNet
  • SuDORMRFNet / SuDORMRFImprovedNet
  • FasNetTAC
  • XUMX

Those are often the right starting point when the user wants to modify an existing Asteroid model rather than write a fresh stack from scratch.

Troubleshooting reminders

  • get_model_args() should be able to reconstruct the model cleanly.
  • BaseModel.from_pretrained(...) round-trips are a good shape/serialization smoke.
  • BaseEncoderMaskerDecoder expects waveform-like tensors with time last.
  • Complex-mask helpers and JIT helpers have their own shape rules.
  • If a registry lookup fails, check whether the class was actually registered and whether the name collides with an existing symbol.

Inputs to inspect

  • desired input shape and output shape
  • time axis, channel axis, and batch axis conventions
  • whether the user needs a built-in family, a reusable block, or a registry extension point
  • whether tracing or serialization must work in addition to eager execution

Smoke sequence

  1. Instantiate a tiny built-in model or block.
  2. Run a forward pass on a tiny tensor.
  3. Round-trip through serialize() / from_pretrained() if a model is involved.
  4. Trace the same block if the request mentions JIT or export.
  5. Confirm any registry or helper function the user cares about.

What to avoid

  • Do not hand-wave shape conventions.
  • Do not treat a successful eager forward pass as proof of tracing correctness.
  • Do not rely on the original repo checkout in runtime instructions.
  • Do not blur custom-model work with recipe training unless the task truly spans both.

Common model-building signals

  • filterbank, encoder, decoder, or masker usually point to architecture assembly.
  • complex and beamforming usually point to DSP or complex-valued helpers.
  • register_* almost always means a registry extension point.
  • torch.jit or trace means the tracing-safe path should be considered explicitly.

Good questions to ask when unclear

  • Is this a new model or a modification of an existing family?
  • Which dimensions should be preserved in the output?
  • Does the user need a round-trip serialization contract?
  • Should the answer focus on eager execution, tracing, or both?

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