problem-modeling
Define, validate, and troubleshoot pymoo optimization problems, built-in test problems, constraints, bounds, and evaluation output shapes.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- problem-modeling
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Define, validate, and troubleshoot pymoo optimization problems, built-in test problems, constraints, bounds, and evaluation output shapes.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md6.4 KB
- 参考文档references/problem-definition-workflows.md5.5 KB
- 参考文档references/troubleshooting.md4.2 KB
- 脚本scripts/validate_problem_shapes.py3.0 KB
03 SKILL.md 正文
problem-modeling
Use this sub-skill when a task asks how to represent an optimization problem in
pymoo: built-in benchmark problems, custom vectorized or elementwise objectives,
functional objectives, bounds, constraint signs, equality constraints, Pareto
front/set methods, evaluation shape validation, or confusing Problem warnings.
Route first
- Algorithm choice,
minimize, termination, ask-and-tell, callbacks, and result interpretation belong tooptimization-workflows. - Mixed variables, sampling/crossover/mutation/repair, duplicate elimination,
initialization, and custom operators belong to
operators-and-variables. - Vectorization vs parallel runners and optional joblib/dask/ray backends belong
to
performance-and-parallelization. - Indicators, reference directions, decomposition, MCDM, convergence, and plots
belong to
analysis-and-visualization. - Stay here for problem metadata,
_evaluatecontracts, objective/constraint sign conventions, built-inget_problem, and validation ofF/G/H.
Fast operating checklist
- Convert the math to pymoo conventions: every objective is minimized.
Negate objectives that the source problem describes as maximized. Inequality
constraints belong in
out["G"]and are feasible whenG <= 0; equality constraints belong inout["H"]and should be near zero. - Pick the problem style: use vectorized
Problemfor matrix-friendly NumPy/SciPy objectives; useElementwiseProblemfor one-candidate black-box calls; useFunctionalProblemfor concise objective/constraint functions. - Set metadata in
__init__:n_var,n_obj,n_ieq_constr,n_eq_constr,xl,xu, and optionalvtype/varsmust match the search space and outputs. - Return stable shapes: for vectorized multi-objective outputs, make
out["F"]a 2-D matrix with one row per candidate and one column per objective. For constraints, align rows withF. - Validate before optimizing: call
problem.evaluate(...)on tiny sample inputs, requestF,G, andH, assert finite values, and inspect signs. - Use built-in problems for smoke tests:
get_problem("zdt1"),get_problem("dtlz2", n_obj=3),Sphere(n_var=...), and constrained families are useful baselines before debugging custom code. - Treat deprecated
n_constrcarefully: this version maps it ton_ieq_constrwith a warning; new problem code should usen_ieq_constrandn_eq_constrexplicitly.
Open the bundled references
- API reference: signatures and output contracts
for
Problem,ElementwiseProblem,FunctionalProblem,get_problem, andevaluate. - Problem definition workflows: built-in problems, vectorized/elementwise/functional definitions, constraints, Pareto fronts, bounds, and validation recipes.
- Troubleshooting: fixes for wrong constraint sign, objective maximization, shape errors, bounds warnings, NaNs, deprecated arguments, and missing Pareto fronts.
Bundled script
- scripts/validate_problem_shapes.py: safe CPU-only assertions for a vectorized constrained problem and an elementwise constrained problem.
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).