operators-and-variables
Customize pymoo variables, sampling, crossover, mutation, repair, initialization, duplicate elimination, and mixed-variable search workflows.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- operators-and-variables
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Customize pymoo variables, sampling, crossover, mutation, repair, initialization, duplicate elimination, and mixed-variable search workflows.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/operator-api-reference.md6.1 KB
- 参考文档references/troubleshooting.md4.1 KB
- 参考文档references/variable-and-operator-workflows.md6.2 KB
- 脚本scripts/mixed_variable_smoke.py2.8 KB
03 SKILL.md 正文
operators-and-variables
Use this sub-skill when a task asks how to customize pymoo's search space or evolutionary operators: real/integer/binary/choice variables, mixed-variable problems, permutation or discrete encodings, sampling, crossover, mutation, repair, selection/survival, duplicate elimination, initial populations, or algorithm hyperparameter helper APIs.
Route first
- Objective/constraint
_evaluateshapes,G <= 0, bounds warnings, or built-in test problems belong toproblem-modeling. - Running
minimize, choosing termination, callbacks, direct stepping, or interpretingResultbelongs tooptimization-workflows. - Parallel evaluation, optional joblib/dask/ray, compiled-extension checks, and
resource controls belong to
performance-and-parallelization. - Hypervolume, IGD/GD, MCDM, reference directions, decomposition, or plots belong
to
analysis-and-visualization. - Stay here for how candidate values are represented and transformed during initialization and variation.
Fast operating checklist
- Match the encoding to the variables: ordinary real-valued algorithms use
float arrays; mixed-variable workflows use
vars={...}withReal,Integer,Binary, andChoiceobjects plusMixedVariableGAor compatible mixed-variable mating. - Repair integer/discrete values after float variation: SBX/PM can produce
floats unless you use integer-aware variables,
RoundingRepair, or custom repair. - Respect operator shapes:
Sampling._doreturns(n_samples, n_var)or an object-compatible list/matrix;Crossover._doreceives(n_parents, n_matings, n_var)and returns(n_offsprings, n_matings, n_var);Mutation._doreturns mutatedXrows. - Keep object encodings explicit: for strings, lists, routes, subsets, or
dictionaries, use
dtype=object, custom duplicate elimination, and problem-specific sampling/crossover/mutation. - Initialize deliberately: pass sampling operators, initial arrays, or evaluated populations when the starting design matters.
- Use repair for feasibility-preserving encodings: bounds repair, rounding, or domain-specific repair can outperform penalty-only constraint handling.
- Treat optional helper integrations as optional:
optunaandcomocmaare optional extras; do not assume them in a base pymoo environment.
Open the bundled references
- Operator API reference: variable classes, operator base contracts, common import paths, and shape conventions.
- Variable and operator workflows: mixed-variable GA, integer repair, custom object/string operators, initial populations, duplicate elimination, and hyperparameter helper recipes.
- Troubleshooting: fixes for float integers, object dtype mistakes, crossover/mutation shape errors, duplicate handling, invalid initial populations, and missing optional extras.
Bundled script
- scripts/mixed_variable_smoke.py: safe
CPU-only smoke that solves a tiny
Real/Integer/Binary/Choiceproblem withMixedVariableGAand asserts valid result types.
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).