model-inference
Construct bounded AlphaFold 3 models, choose forward loss or sampling modes, load compatible checkpoints, and inspect confidence, distogram, and ranking outputs.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- model-inference
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Construct bounded AlphaFold 3 models, choose forward loss or sampling modes, load compatible checkpoints, and inspect confidence, distogram, and ranking outputs.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/model-and-forward-api.md12.5 KB
- 参考文档references/troubleshooting.md8.4 KB
- 参考文档references/workflows.md7.7 KB
- 脚本scripts/smoke_model.py9.5 KB
03 SKILL.md 正文
Model inference
Use this sub-skill after an input has been converted to model-ready tensors, or use the tiny smoke helper to validate the model contract before allocating a large run. Start with workflows, then consult the API contract for exact shapes and troubleshooting for recovery.
Route by responsibility
- Send proteins, nucleic acids, ligands, metals, atom features, batching, masks, representative-atom indices, and output structure conversion to input-representation.
- Send mmCIF/PDB parsing, MSA and template acquisition or preprocessing to data-pipeline. This model accepts already prepared tensors; it does not fetch biological data for you.
- Send
Trainer, datasets, optimizers, YAML, EMA, and checkpointed training loops to training-configuration. - Send Click command construction, output files, and Gradio operation to cli-serving.
Operating sequence
- Select CPU for contract checks and reduced tests; select CUDA only after the device, dtype, and memory budget are explicit.
- Construct a deliberately reduced
Alphafold3with dimensions and depths appropriate to the available memory. The constructor's production defaults are not a smoke configuration. - Validate
atom_inputs, atom-pair inputs, token counts, molecule lengths, masks, and all index offsets before callingforward. - Choose the return mode deliberately: coordinates for inference, or loss and an optional breakdown when ground-truth positions/labels are supplied.
- Add confidence/distogram logits only when they are needed; rank multiple samples/models with the dedicated scoring classes rather than treating raw logits as scores.
- For a checkpoint, prefer
init_and_loadwhen the file was saved by this package, and verify version, constructor dimensions, device, and strictness before production inference.
Run the bundled safe check. The examples assume this sub-skill directory is the current directory; from any other directory, invoke the linked script by its resolved path because the helper has no current-directory assumptions:
python scripts/smoke_model.py --help
python scripts/smoke_model.py --mode signature --device cpu
# Only for an explicitly bounded tiny forward:
python scripts/smoke_model.py --mode forward --device cpu --num-sample-steps 2
python scripts/smoke_model.py --mode forward --device cpu --num-sample-steps 2 --with-distogram
The helper never downloads weights, enables PLM/NLM encoders, trains, starts a server, or uses production-scale defaults. It is a contract probe, not evidence of useful structural accuracy or production throughput.
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).