runtime-and-scaling
Install, start, probe, and scale PySR runtime without tuning equations.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- runtime-and-scaling
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Install, start, probe, and scale PySR runtime without tuning equations.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/cli-reference.md3.2 KB
- 参考文档references/install-runtime.md6.5 KB
- 参考文档references/scaling-and-parallelism.md7.2 KB
- 参考文档references/troubleshooting.md6.4 KB
- 脚本scripts/pysr_environment_probe.py9.0 KB
03 SKILL.md 正文
PySR runtime and scaling
Use this sub-skill when the task is about making PySR import, start its Julia/SymbolicRegression backend, run within a resource budget, use threads/processes/Slurm safely, or call PySR's command-line test wrapper. Keep equation design, operators, constraints, losses, and objective debugging routed to customization-and-constraints; keep hall-of-fame CSVs, checkpoints, SymPy/LaTeX/JAX/Torch export, and reload work routed to export-and-artifacts.
Route within this sub-skill
| Request | Use |
|---|---|
| Install PySR, choose pip/conda/source, explain first import, set JuliaCall environment variables, containers, backend checkout | references/install-runtime.md |
Pick parallelism, procs, Slurm settings, batching, time/evaluation budgets, deterministic recipe |
references/scaling-and-parallelism.md |
Run or interpret python -m pysr commands and native test subsets |
references/cli-reference.md |
| Diagnose import hangs, Julia package resolution, stdin/notebook hangs, GLIBCXX, worker, Slurm, and reproducibility symptoms | references/troubleshooting.md |
| Probe an environment without fitting a model | scripts/pysr_environment_probe.py |
Non-negotiable runtime facts
import pysrimports JuliaCall and loads the SymbolicRegression Julia backend. On a fresh environment, the first import can download or resolve Julia packages; the first fit can spend additional time compiling Julia code. Do not diagnose that alone as a failed search.- Set JuliaCall environment variables before any
import pysrorimport juliacall. PySR sets sensible defaults only if JuliaCall was not already imported. For thread control usePYTHON_JULIACALL_THREADS=<n>orautobefore import;JULIA_NUM_THREADSis not the PySR/JuliaCall control path. - In notebooks, embedded shells, CI, or noninteractive runners that may not provide usable stdin, pass
input_stream="devnull"toPySRRegressorand bound the run withtimeout_in_secondsormax_evals. - The default search is multithreaded. Use
parallelism="serial"only for tiny checks or deterministic reproduction; useparallelism="multiprocessing"withprocs=...only when the extra Julia worker startup cost is worth it. - Slurm is launched from one Python process inside an existing allocation:
parallelism="multiprocessing", cluster_manager="slurm", procs=<total allocation tasks>. Do not wrap the Python script insrun. - Deterministic runs require all three:
deterministic=True, a fixedrandom_state, andparallelism="serial". Seeded parallel runs remain stochastic.
Fast safe probe
The bundled probe never fits a model. Start with the no-import form when you only need package metadata and environment-variable state:
python scripts/pysr_environment_probe.py --skip-import --json
Then, when a first import/Julia initialization is acceptable:
python scripts/pysr_environment_probe.py --json
python scripts/pysr_environment_probe.py --json --check-cli
--check-cli is intentionally optional because python -m pysr --help imports the package and can trigger the same first-import Julia setup.
Minimal bounded run template
import os
# Must happen before import pysr/juliacall if overriding the default thread policy.
os.environ.setdefault("PYTHON_JULIACALL_THREADS", "auto")
import numpy as np
from pysr import PySRRegressor
rng = np.random.RandomState(0)
X = rng.randn(200, 2)
y = X[:, 0] + 2 * X[:, 1]
model = PySRRegressor(
niterations=20,
timeout_in_seconds=120,
max_evals=50_000,
binary_operators=["+", "*", "-"],
parallelism="multithreading",
input_stream="devnull",
random_state=0,
)
model.fit(X, y)
print(model.equations_)
For operator or loss changes in this template, route to customization-and-constraints. For inspecting the resulting equation table or persisted files, route to export-and-artifacts.
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).