advanced-topics
Use Optax projections, tree utilities, assignment, second-order helpers, and contrib algorithms.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- advanced-topics
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use Optax projections, tree utilities, assignment, second-order helpers, and contrib algorithms.
- disable-model-invocation
- true
03 SKILL.md 正文
Advanced Topics
Use this sub-skill when the user is asking about constraint handling, tree manipulation, assignment, second-order utilities, or contrib/experimental algorithms. This is the route for the more specialized Optax modules.
Include here
- Projection helpers in
optax.projections, especially simplex, box, ball, orthant, hyperplane, and halfspace projections. - Assignment helpers such as
optax.assignment.hungarian_algorithm. - Tree utilities in
optax.tree_utils. - Numerical and linear-algebra helpers such as
safe_norm,matrix_inverse_pth_root,power_iteration, andnnls. - Second-order helpers such as
hvp,fisher_diag, andhessian_diag. - Contrib and experimental algorithms such as
sam,schedule_free,dpsgd,muon,galore,prodigy,mechanic,momo,adopt,acprop,sophia,reduce_on_plateau, andoptax.experimental.aggregating.
Exclude or route elsewhere
- Ordinary optimizer composition, wrapper selection, and
apply_updates: usecore-optimization. - Plain loss or schedule selection: use
losses-and-schedules.
Good questions for this route
- “How do I project parameters onto the simplex or non-negative orthant?”
- “How do I solve a Hungarian assignment problem in Optax?”
- “How do I manipulate parameter trees safely?”
- “How do I use a contrib algorithm like SAM, Muon, or Schedule-Free?”
- “How do I get a Hessian-vector product or another second-order diagnostic?”
Read first
../../references/advanced-topics.mdfor the distilled reference on projections, assignment, trees, second order, and contrib/experimental features.../../references/examples-index.mdfor example notebooks such aslinear_assignment_problem.ipynb,freezing_parameters.ipynb, and the contrib notebooks.../../references/troubleshooting.mdfor tree-shape, projection-feasibility, numerical-stability, and API-drift notes.
Core workflow
- Decide whether the request is primarily about constraints, trees, assignment, curvature, or a contrib algorithm.
- Check tensor/tree shapes and the intended feasible set before calling a projection helper.
- For tree utilities, confirm which tree is the parameter tree and which tree is auxiliary data.
- For second-order and linear-algebra helpers, verify the dtype and conditioning assumptions.
- For contrib algorithms, check whether the feature is stable enough for the user’s intended workflow or whether the request should stay in the exploratory/experimental lane.
Signals that this route is correct
- The user mentions projections, simplex constraints, assignment, tree arithmetic, or Hessian-like helpers.
- The user names a contrib algorithm or asks for a feature that is clearly outside the main optimizer surface.
- The user wants to study or adapt a specialized notebook rather than a plain training loop.
Common mistakes
- Applying a projection helper to the wrong tree shape or the wrong feasible set.
- Using tree utilities interchangeably on mismatched trees.
- Assuming a contrib example is interchangeable with the stable main-package API.
- Ignoring the numerical sensitivity of curvature or linear-algebra helpers.
Useful examples
../../references/examples-index.mdpoints tolinear_assignment_problem.ipynb,freezing_parameters.ipynb,lookahead_mnist.ipynb, and several contrib notebooks that belong here.
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).