scikit-opt
Use scikit-opt to solve GA, DE, PSO, SA, AFSA, routing, and objective-speedup workflows.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- scikit-opt
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use scikit-opt to solve GA, DE, PSO, SA, AFSA, routing, and objective-speedup workflows.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/package-overview.md2.6 KB
- 参考文档references/repo-provenance.md1.2 KB
- 参考文档references/repo-routing-metadata.json337 B
- 参考文档references/troubleshooting.md2.3 KB
- 脚本scripts/check_scikit_opt_env.py2.4 KB
03 SKILL.md 正文
scikit-opt
Use this repo skill for the scikit-opt / sko Python package when the task is about heuristic optimization, route/permutation search, objective-function shaping, or run-mode acceleration.
Install and import
- Install the published package with
pip install scikit-opt. - Check the import with
python -c "import sko; print(sko.__version__)". - If you are working from a local checkout during maintenance, see
references/troubleshooting.mdfor the editable-install caveat; the runtime skill itself stays package-centric.
Read this first when unsure
- Read
references/package-overview.mdfor the family map: GA, DE, PSO, SA, AFSA, TSP/routing, built-in demo functions, and run-mode helpers. - Read
references/troubleshooting.mdfor install/import issues, optional dependencies, thePSO_TSPcaveat, and common runtime failures. - Read
references/repo-provenance.mdwhen you need to know whether this skill still matches the current repository snapshot. - Run
scripts/check_scikit_opt_env.pywhen you want a quick environment sanity check without opening the source repository.
Route to the right sub-skill
genetic-algorithms— GA, EGA, RCGA, integer or mixed-precision search, continuation runs, and custom operators viaregister().continuous-optimizers— DE, PSO, SA schedules, and AFSA for continuous or constrained real-valued problems.routing-and-combinatorial— GA_TSP, SA_TSP, ACA_TSP, IA_TSP, fixed-endpoint route recipes, and permutation validation.objective-functions-and-speedups— objective shape contracts, built-in benchmark functions,set_run_mode, cached/vectorized/threaded modes, and optional GPU/plotting dependencies.
Minimal routing rules
- If the task is about GA-style discrete or mixed-precision optimization, go to
genetic-algorithms. - If the task is about a continuous objective, pick
continuous-optimizers. - If the task is about permutations, routes, or TSP, pick
routing-and-combinatorial. - If the task is about objective shape, demo functions, run modes, caching, or optional acceleration, pick
objective-functions-and-speedups.
Package facts to remember
- The import package is
sko. - The package version captured in this skill snapshot is
0.6.6. - Core package dependencies are NumPy and SciPy.
- Plotting, Pandas, Joblib, and PyTorch are optional surfaces that belong to specific workflows rather than the core package import.
PSO_TSPis a version-specific caveat in this snapshot and should not be treated as a reliable default route solver.
When to use the shared helpers
- Use
scripts/check_scikit_opt_env.pybefore a handoff when you want an import/signature sanity check. - Read
references/package-overview.mdbefore choosing a sub-skill if the user only names a problem shape, not a class. - Read
references/troubleshooting.mdbefore investigating a failure so you can separate install/import problems from algorithm-specific issues.
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).