advanced-contrib
Route and use optional NumPyro contrib workflows while keeping dependency and core-API boundaries explicit.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- advanced-contrib
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Route and use optional NumPyro contrib workflows while keeping dependency and core-API boundaries explicit.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/advanced-contrib.md11.4 KB
- 参考文档references/hsgp-and-tfp.md7.3 KB
- 参考文档references/optional-dependencies.md5.8 KB
- 参考文档references/troubleshooting.md7.9 KB
- 脚本scripts/check_optional_dependencies.py7.7 KB
03 SKILL.md 正文
advanced-contrib
Use this sub-skill when a NumPyro task explicitly involves optional or experimental numpyro.contrib.* workflows rather than always-installed core modeling, distributions, MCMC, or SVI.
Triggers
Load this sub-skill for requests involving:
numpyro.contrib.funsorenumeration helpers:config_enumerate,infer_discrete,markov, enum handlers, or exact marginalization of discrete latent variables.- Hilbert-space Gaussian process approximations in
numpyro.contrib.hsgp. numpyro.contrib.nested_sampling.NestedSamplerand nested sampling throughjaxns.numpyro.contrib.einsteinparticle/Stein inference:SteinVI,SVGD,ASVGD, Stein kernels, orMixtureGuidePredictive.numpyro.contrib.modulewrappers for Flax Linen, Flax NNX, or Equinox modules.- TensorFlow Probability integration through
numpyro.contrib.tfpor direct TFP JAX substrate distributions in NumPyro models. - Stochastic-support inference:
DCC,SDVI, or branch sites marked withinfer={"branching": True}.
First routing decision
- If the request is plain
sample,param,plate, handlers,module,mutable,scan, orcond, route to modeling-primitives. - If it is native
numpyro.distributions, constraints, transforms, support, shapes, or TFP distribution fallback selection, route to distributions-transforms and return here only for TFP-specific caveats. - If it is ordinary
MCMC,NUTS,HMC, diagnostics, chain methods, or discrete HMC Gibbs, route to mcmc-diagnostics and return here only forNestedSampleror TFP MCMC kernels. - If it is ordinary
SVI, ELBO choice, autoguides, optimizers, or predictive use, route to svi-autoguides and return here only for SteinVI/SVGD/ASVGD orSDVI. - If the task names
contrib, an optional dependency, or one of the APIs above, stay in this sub-skill and check optional dependencies before coding.
Required workflow
- Treat contrib features as optional. A missing optional dependency is not evidence that core NumPyro is broken.
- Before suggesting or executing contrib code in a minimal environment, run or adapt
scripts/check_optional_dependencies.py:python scripts/check_optional_dependencies.py --prettypython scripts/check_optional_dependencies.py --require nested_samplingpython scripts/check_optional_dependencies.py --require module_flax
- Keep examples bounded: tiny synthetic data, CPU-safe sample counts, no downloads, no plotting unless the task explicitly asks for plots and plotting dependencies are present.
- Prefer native NumPyro APIs for core tasks; use contrib only when it adds a capability not covered by the sibling sub-skills.
Reference map
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).