objective-functions-and-speedups
Shape scikit-opt objectives, benchmark functions, and safe run-mode speedups.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- objective-functions-and-speedups
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Shape scikit-opt objectives, benchmark functions, and safe run-mode speedups.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/acceleration.md4.9 KB
- 参考文档references/demo-functions.md3.0 KB
- 参考文档references/objective-contracts.md3.8 KB
- 参考文档references/troubleshooting.md5.0 KB
- 脚本scripts/smoke_run_modes.py4.7 KB
03 SKILL.md 正文
objective-functions-and-speedups
Use this sub-skill when a task needs objective-function contracts, built-in sko.demo_func benchmarks, set_run_mode acceleration/cache choices, or optional plotting/GPU dependency guidance for scikit-opt / sko.
Route here when
- An optimizer fails because the objective receives the wrong shape or returns the wrong shape.
- You need to convert a scalar objective to vectorization mode, cached mode, or a safe thread-based mode.
- You need a quick built-in benchmark such as
sphere,schaffer,rosenbrock, orackley. - You need to explain
matplotlib,pandas,joblib,torch, or CUDA as optional dependencies rather than core requirements.
Route elsewhere
- Algorithm-specific parameters, bounds, constraints, continuation, and history interpretation belong to the owning algorithm sub-skill.
- GA integer/precision encoding and the
x2grayrelationship belong to../genetic-algorithms/. - TSP route-cost design and permutation outputs belong to
../routing-and-combinatorial/.
Bundled references
- Read references/objective-contracts.md before writing or adapting objective functions for scalar, vectorized, cached, threaded, or method-based use.
- Read references/acceleration.md when choosing
set_run_mode(func, mode), deciding whether to usecommon,vectorization,cached,multithreading,multiprocessing,joblib, or interpreting theparallelalias. - Read references/demo-functions.md when selecting built-in benchmark/demo objective functions or using
function_for_TSPas a tiny route fixture generator. - Read references/troubleshooting.md when run-mode assertions, vectorized shape errors, cached input errors, multiprocessing/joblib failures, plotting display problems, or optional GPU issues appear.
Bundled script
- Run scripts/smoke_run_modes.py to check that the installed package can execute tiny GA objectives in
common,vectorization,cached, andmultithreadingmodes without source-checkout data, plotting, network, or GPU requirements.
Fast operating rules
- Set the run mode before constructing the optimizer; constructors wrap the function immediately.
- Use scalar objectives for
common,multithreading,multiprocessing,cached, andjoblib: one candidate vector in, one finite scalar out. - Use vectorized objectives only after adapting the function to accept an
Xmatrix and return one value per row. - Treat multiprocessing, joblib, plotting, pandas workflows, and
GA.to(device)as optional surfaces with extra dependency/platform checks.
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).