mcmc-diagnostics
Run and troubleshoot NumPyro MCMC workflows with diagnostics, predictive sampling, reparameterization, and JAX chain configuration.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- mcmc-diagnostics
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Run and troubleshoot NumPyro MCMC workflows with diagnostics, predictive sampling, reparameterization, and JAX chain configuration.
- disable-model-invocation
- true
02 资源文件 6
- 参考文档references/backend-and-chain-configuration.md4.8 KB
- 参考文档references/diagnostics-and-reparameterization.md5.2 KB
- 参考文档references/mcmc-workflows.md8.2 KB
- 参考文档references/predictive-loglikelihood.md3.8 KB
- 参考文档references/troubleshooting.md3.9 KB
- 脚本scripts/eight_schools_smoke.py4.5 KB
03 SKILL.md 正文
mcmc-diagnostics
Use this sub-skill when the task is to run, configure, inspect, or repair a NumPyro MCMC workflow: NUTS/HMC, alternative kernels, multiple chains, diagnostics, posterior predictive sampling, pointwise log likelihood, bad-geometry fixes, or JAX backend selection.
Quick workflow
- Choose a kernel and MCMC layout from references/mcmc-workflows.md.
- Configure the backend and chains before the first JAX computation using references/backend-and-chain-configuration.md.
- Run
MCMC.run(...)with usefulextra_fields, then inspectget_samples(...),get_extra_fields(...), andprint_summary(...). - Diagnose
diverging,potential_energy, lown_eff, highr_hat, and weak ESS using references/diagnostics-and-reparameterization.md. - Generate posterior predictive samples or log likelihood arrays with references/predictive-loglikelihood.md.
- If execution or diagnostics fail, use references/troubleshooting.md.
Bundled smoke script
Run the CPU-safe 8-schools smoke test when you need a deterministic sanity check of NUTS, diagnostics fields, and optional posterior predictive sampling:
python scripts/eight_schools_smoke.py --help
python scripts/eight_schools_smoke.py --num-warmup 20 --num-samples 30 --predict-new-school
The script uses tiny defaults for fast validation only; do not treat its diagnostics as convergence evidence for a real analysis.
Routing and boundaries
- Model primitives, plates, handlers, and observation-site basics belong in ../modeling-primitives/.
- Distribution shape/support details and transform catalogs belong in ../distributions-transforms/.
- SVI, autoguides, and the prefit phase needed before
NeuTraReparambelong in ../svi-autoguides/; return here for NeuTra-backed MCMC after a guide is trained. - Optional nested sampling, SteinVI, and other contrib inference routes belong in ../advanced-contrib/.
Prefer this sub-skill for
- Selecting between
NUTS,HMC,BarkerMH,MixedHMC,HMCGibbs,DiscreteHMCGibbs,HMCECS,SA,AIES, andESS. - Using
MCMC.run,warmup,post_warmup_state,get_samples,get_extra_fields, andprint_summary. - Collecting
potential_energy,diverging,num_steps,accept_prob, oradapt_state.step_size. - Applying
TransformReparam,LocScaleReparam, orNeuTraReparamto reduce bad posterior geometry. - Explaining
num_chains,chain_method, CPU host devices, GPU/TPU backend selection, and x64 precision.
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).