runtime-and-installation
Install, validate, select backends, and troubleshoot Jittor runtime, compiler, cache, profiling, and performance behavior.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- runtime-and-installation
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Install, validate, select backends, and troubleshoot Jittor runtime, compiler, cache, profiling, and performance behavior.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/profiling-debugging.md4.5 KB
- 参考文档references/runtime-flags-and-backends.md6.2 KB
- 参考文档references/troubleshooting.md5.7 KB
- 脚本scripts/jittor_perf_probe.py4.2 KB
03 SKILL.md 正文
Runtime and installation
Use this sub-skill when the task is to install Jittor, validate an import or first JIT compile, select CPU/GPU/distributed runtime flags, diagnose cache/compiler/backend failures, or run a bounded performance/profiling check.
Do not use this sub-skill for deep Tensor/Var/autograd API usage, neural-network layer or optimizer recipes, dataset/model downloads, or custom C++ operator authoring; route those to the matching Jittor sub-skill.
Default operating stance
- CPU JIT import and a tiny CPU operation are the required baseline.
- CUDA, ROCm, MPI/NCCL, ACL/vendor accelerators, and MKL/DNNL acceleration are optional. Only claim an optional backend after a backend-specific smoke passes.
- A visible GPU is not enough to claim CUDA. Require
jt.has_cudaand a tiny synchronized op after settingjt.flags.use_cuda = 1. - First import or first op may compile runtime code and fetch optional CPU acceleration assets. Do not time that first compile as model performance.
- Prefer scoped flags (
with jt.flag_scope(...):) for temporary backend/debug changes.
Read or run map
- Read runtime flags and backends to choose pip, Docker, or manual installation; set compiler/CUDA/MPI flags; and separate required CPU JIT from optional hardware.
- Read profiling and debugging to localize lazy-execution errors, profile synchronized code, inspect memory, and avoid misleading timings.
- Read troubleshooting for symptom-driven fixes covering unsupported platforms, compiler issues, cache corruption, CUDA/nvcc, MKL/DNNL downloads, NaN/Inf, OOM, MPI deadlock, and timing mistakes.
- Run jittor_perf_probe.py for a safe CPU-first timing smoke. Use
--use-cudaonly after CUDA is intentionally configured.
Minimum validation flow
-
Install with a supported Python and a working C++ compiler, then run a CPU import/JIT smoke:
python - <<'PY' import jittor as jt x = jt.float32([1, 2, 3]) y = (x * x).sum() print({ "version": jt.__version__, "sum_squares": float(y.data), "has_cuda": bool(jt.has_cuda), "use_cuda": int(jt.flags.use_cuda), "cc_type": jt.flags.cc_type, }) PY -
Prefer bundled support checks over original repo tests for routine validation:
python ../../scripts/check_jittor_env.py python ../../scripts/jittor_cache_doctor.py -
For CUDA, first prove availability and then enable it:
python - <<'PY' import jittor as jt if not jt.has_cuda: raise SystemExit("CUDA is not available to Jittor; validate CPU or configure CUDA first.") jt.flags.use_cuda = 1 x = jt.float32([1, 2, 3]) print(float((x * x).sum().data)) PY -
For performance timing, run from this sub-skill directory:
python scripts/jittor_perf_probe.py --warmup 1 --rerun 5
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).