core-api
Routes LibMTL's Trainer, shared configuration, and built-in API surface.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- core-api
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Routes LibMTL's Trainer, shared configuration, and built-in API surface.
- disable-model-invocation
- true
02 资源文件 3
- 参考文档references/troubleshooting.md1.5 KB
- 参考文档references/workflows.md2.1 KB
- 脚本scripts/check_core_api.py1.8 KB
03 SKILL.md 正文
core-api
Use this sub-skill when the task is about the shared LibMTL API rather than a specific benchmark dataset.
Covers
LibMTL.Trainerconstruction and runtime behavior.LibMTL.config.LibMTL_argsandprepare_args.- Built-in losses, metrics, architectures, weightings, and backbone builders.
- The shared utility helpers in
LibMTL.utils. - Direct inspection of the API surface before writing a custom benchmark or a new method.
Does not cover
- Dataset-specific file layouts or benchmark commands.
- New-task adaptation recipes; use
customizationfor that. - NYUv2/Cityscapes, Office-31/Office-Home, QM9, or PAWS-X details.
When to use this sub-skill
Choose this route when the user asks things like:
- "How do I instantiate
Trainercorrectly?" - "Which weighting and architecture names are supported?"
- "What does
prepare_argsreturn?" - "How do the built-in backbones and utilities fit together?"
- "Why did a direct
Trainercall fail even though the docs looked correct?"
Read next
../../references/api-reference.mdfor the verified signature and exported classes.../../references/configuration.mdfor shared CLI and method flags.../../references/troubleshooting.mdfor configuration and runtime failures.
Workflow
- Confirm whether the user is passing string names or class objects.
- Confirm whether
prepare_argsis being used. If not, check that bothweight_argsandarch_argsare supplied. - Confirm the runtime has CUDA. The trainer's default device is
cuda:0. - Check the requested weighting and architecture names against the exported module lists.
- If the request is to validate the install rather than solve a dataset task,
run
scripts/check_core_api.py.
Common gotchas
Trainerresolves weighting and architecture names internally. Pass strings such as"EW"and"HPS".- The supported optimizer/scheduler combinations in the current code are
narrower than the parser help suggests;
adam/sgdandstepare the safe choices. resnet18andresnet_dilatedreturn feature maps. They are not end-to-end classifiers.MOML,FORUM, andAutoLambdaare treated as bilevel methods and use the trainer's special path.
Exit criteria
Leave this sub-skill when you can answer, from the bundled files alone:
- which object to import,
- which string names to pass,
- which kwargs must be present,
- and what failures mean the configuration is wrong versus the environment is incomplete.
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).