mattergen
Guide MatterGen inorganic-crystal generation, structure evaluation, dataset preparation, Hydra training, and property fine-tuning with CUDA-aware validation and safe artifact handling.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- mattergen
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Guide MatterGen inorganic-crystal generation, structure evaluation, dataset preparation, Hydra training, and property fine-tuning with CUDA-aware validation and safe artifact handling.
- disable-model-invocation
- true
02 资源文件 6
- 参考文档references/api-and-cli-overview.md2.3 KB
- 参考文档references/installation-and-assets.md3.1 KB
- 参考文档references/repo-provenance.md2.0 KB
- 参考文档references/repo-routing-metadata.json330 B
- 参考文档references/troubleshooting.md4.3 KB
- 脚本scripts/check_environment.py4.0 KB
03 SKILL.md 正文
MatterGen
MatterGen is a generative model for inorganic materials design. Use this root route to choose the smallest workflow-specific guide before running commands. The generated skill is self-contained: it describes package contracts and bundles safe preflight helpers, but it does not download checkpoints, datasets, MatterSim potentials, or start expensive jobs implicitly.
First route the request
- Generate crystal structures — read generation. This covers named or local checkpoints, unconditional/property/multi-property sampling, CSP target compositions, guidance, sampling overrides, and output files.
- Score or relax structures — read evaluation. This covers MatterSim relaxation, precomputed-energy evaluation, matching, compatible references, correction schemes, and metrics.
- Prepare or validate data — read data-preparation. This covers MP-20 and Alex-MP-20 layout, CSV schema, cache splits, custom properties, and storage preflight.
- Train or fine-tune — read training-finetuning. This covers Hydra base/CSP training, adapters, multi-property wiring, custom embeddings, resource controls, and no-launch validation.
For a request that spans routes, prepare data first, train/fine-tune second, generate third, and evaluate last. Keep each stage's inputs, resolved config, checkpoint identity, data/reference version, device, and output directory in an external experiment record.
Install and smoke-check
MatterGen requires Python 3.10+; the repository's documented Linux path uses a CUDA-capable PyTorch stack. Install the package using its supported distribution or editable source checkout, then run the bundled environment check:
python -m pip install -e <mattergen-source>
python <mattergen-skill-root>/scripts/check_environment.py
The source distribution pins a Linux CUDA family around PyTorch 2.2.1 + cu118
and matching PyG extensions. Respect the package's platform-specific install
instructions rather than mixing CPU/CUDA/ROCm wheels. Apple Silicon is
experimental and requires PYTORCH_ENABLE_MPS_FALLBACK=1 for documented MPS
runs. Read installation and assets
when deciding package variants, checkpoints, Git LFS, Hugging Face access, or
large data acquisition.
The helper checks package metadata/imports and reports CUDA/MPS availability; it does not install packages, contact external services, or launch a model. Read API and CLI overview for the five console entry points and the verified public Python objects.
Operational guardrails
- Treat checkpoint, dataset, reference, and potential files as explicit inputs. An LFS pointer is not a hydrated model or archive.
- Preflight arguments, paths, schemas, and backend availability before any large job. Use the nearest bundled helper; dry-run is the default where offered.
- Keep generation/evaluation on a visible CUDA device when the workflow needs the GPU. CPU checks validate imports and lightweight behavior, not full generation throughput or MatterSim relaxation.
- Use a new output directory for retries. Preserve resolved configs and partial artifacts rather than silently overwriting them.
- Do not compare MP2020 and TRI2024 evaluation results as if they used the same hull/reference convention; do not treat MatterSim predictions as DFT.
- Before publication or scientific claims, record data/license provenance, conditioning/checkpoint identity, random seeds, sampling settings, device, and whether metrics came from MatterSim or DFT.
For cross-cutting install, import, backend, asset, and artifact failures, read troubleshooting. For source-version checks or refresh decisions, read repository provenance.
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).