AGENT SKILL

custom-op-console-and-tools

Use advanced Jittor extension APIs for custom operators, jt.code kernels, C++ console embedding, and safe utility or converter workflows.

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

01 前言 Front Matter

name
custom-op-console-and-tools
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Use advanced Jittor extension APIs for custom operators, jt.code kernels, C++ console embedding, and safe utility or converter workflows.
disable-model-invocation
true

02 资源文件 5

03 SKILL.md 正文

Custom op, console, and tools

Use this sub-skill when a task asks for advanced Jittor extension surfaces: inline jt.code, compiled custom ops, meta-operator design, C++ console embedding, utility CLI flags, or bounded PyTorch conversion/interoperability notes.

Do not use it for ordinary model/layer training, package installation, CUDA toolkit setup, dataset/model zoo workflows, or low-level framework internals that are not exposed by the public APIs. Route those tasks to the appropriate sibling sub-skill.

Read and run map

Need Use
Decide between meta-operators, jt.code, compile_custom_op, and compile_custom_ops Read references/custom-op-and-code.md.
Write or review a CPU-first custom code-op smoke check Run scripts/custom_op_smoke.py with --help, then --skip-compile or the default tiny CPU smoke.
Generate C++ console compile flags, example source, or a compile command template Read references/console-and-utilities.md and run scripts/jittor_console_flags.py.
Diagnose compiler, shape, dtype, CUDA, console-link, converter, or unsafe-service failures Read references/troubleshooting.md.

Default operating workflow

  1. Confirm the user really needs an extension surface. Prefer meta-operators for shape-indexing algebra, jt.code for small inline C++/CUDA kernels, and compile_custom_op(s) only for larger op classes or multi-file C++/CUDA implementations.
  2. Verify a CPU path first. A CUDA kernel, CUDA branch in a custom op, or CUDA-only jt.code snippet is a separate optional verification step and must be guarded by CUDA availability.
  3. Keep shape and dtype contracts explicit. Record output shapes/dtypes before writing source strings; verify with tiny arrays and synchronized values before scaling.
  4. For C++ console embedding, use jittor_utils.config through the bundled wrapper to generate flags or example code. Do not assume the host has a linkable Python shared library or a C++17-capable compiler.
  5. Treat converter and service utilities as boundary tools. Text conversion still requires manual review and tests; service/server scripts are not safe defaults.

Safety gates

  • Do not start long-running converter services, Docker containers, network listeners, or network downloads unless the user explicitly requests that service work and accepts the boundary.
  • Do not claim CUDA verification from a CPU run. Use optional CUDA probes only when the runtime backend is available and intentionally selected.
  • Do not paste local include, library, cache, or checkout paths into generated guidance. CLI wrappers may print user-local flags at run time because those are compile inputs, but reference material should stay path-agnostic.

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