Kermt Pretrain Scratch
NVIDIAOfficialPublished by NVIDIA
- Skill
- Workflow
- Data and AI
- Apache-2.0
- Medium risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill orchestrates the end-to-end pretraining of a KERMT model from scratch. Unlike continuing an existing model, this process initializes the model randomly and builds a new vocabulary directly from the user-provided corpus. It is a computationally intensive workflow designed for domain-specific chemistry research where existing checkpoints are insufficient. The skill handles data validation, vocabulary generation, and the launch of distributed training within a containerized environment.
What it does
- Validates the user-provided SMILES corpus for pretraining compatibility.
- Generates a fresh vocabulary based on the provided dataset.
- Configures model architecture using default settings.
- Launches a detached distributed training process using the KERMT container.
- Provides a detailed run manifest for reproducibility and tracking.
- Offers monitoring guidance for long-running training sessions.
When to use it
- When you need to train a model on a custom chemistry domain not covered by released checkpoints.
- When you require a full end-to-end reproduction of a pretraining configuration.
- When you have sufficient compute resources for a multi-day training job.
Advantages
- Enables complete control over the model's training data and vocabulary.
- Supports multiple pretraining objectives including vocab, cmim, and hybrid modes.
- Ensures reproducibility through detailed manifest generation and command replay.
- Automates complex containerized orchestration for distributed training.
Usage examples
- “Pretrain a new KERMT model from scratch using my_corpus.csv with the hybrid objective.”
- The agent validates the CSV, builds a fresh vocabulary, estimates the required compute time, and launches the training process in a detached container.
- “Start a scratch pretraining run on my_data.csv and log to wandb.”
- The agent initiates the pretraining workflow, configuring the environment for Weights & Biases logging and providing the run directory for monitoring.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/nvidia/kermt-pretrain-scratch/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip kermt-pretrain-scratch.zip -d .agents/skills
Documentation by NVIDIA
kermt-pretrain-scratch
Pretrain a brand-new KERMT model from scratch on a user-provided corpus. Useful
when you want to retrain a model on a custom chemistry domain rather than
extending one of the released checkpoints. Significantly more expensive than
kermt-continue-pretrain — no warm start, so the loss curves need to descend
from scratch over many epochs.
Skill and runtime paths
Set SKILL_DIR to the absolute path of this installed skill directory. Export
KERMT_REPO as the absolute path to the KERMT checkout used for model
execution. The bundled container helper mounts that checkout at
/workspace and this skill at /skill (read-only). Commands inside
the container use /skill/scripts/; defaults are bundled in config/.
Hardware requirements
Same as kermt-continue-pretrain:
GPUs: 1–N CUDA-capable. The runner auto-detects via
torch.cuda.device_count();--gpus 0,2overrides. Single-GPU fallback:--batch_size 32 --save_interval 500. Multi-GPU keeps defaults (--batch_size 256etc.). Note:--gpus Nuses torch.cuda indexing, which can differ fromnvidia-smi's display order on multi-GPU hosts (PCI bus vs. CUDA enumeration). To target a specific physical GPU, setCUDA_VISIBLE_DEVICESbefore invoking, or runpython -c "import torch; print([torch.cuda.get_device_name(i) for i in range(torch.cuda.device_count())])"to confirm which device you're picking.VRAM: the default
--batch-size 256is sized for A100-class hardware (80 GB VRAM). On smaller GPUs, downscale to avoid OOM:GPU class VRAM Suggested --batch-sizeL4, T4, V100 16 GB 16–24 GB 32–64 A100 40 GB, L40, A40 40–48 GB 128 A100 80 GB, H100, H200 80 GB 256 (default) These are rough starting points — pass
--batch-size Nto override.Disk: tens of GB for shards + vocab + checkpoints, scaled by epochs.
Wall time: this is the big difference. Pretraining from scratch on an 11M-mol corpus at 100 epochs typically takes days even on a multi-GPU box. The skill prints an estimate before launching; confirm with the user.
When to invoke
User wants to train a new model on a custom corpus (e.g. domain-specific chemistry that the released ckpts don't cover).
User wants to reproduce a pretrain config end-to-end without depending on a released ckpt.
For continuing an existing released ckpt, use kermt-continue-pretrain. For
adding a cMIM decoder to an encoder-only grover_base ckpt, use
kermt-add-cmim-pretrain.
Inputs
Required:
--csv <path>— the pretrain corpus CSV with asmilescolumn. Single file by convention; multi-file corpora deferred. Use--val-csvfor a separate validation set.--pretrain-target-mode {vocab|cmim|hybrid}— which pretrain objective to use. No default — must be set explicitly so the user makes an informed choice:vocab— original GROVER-style atom + bond vocab prediction (encoder-only output, lightweight).cmim— contrastive + SMILES reconstruction objective. Requires building a SMILES vocab from the corpus.hybrid— both vocab and contrastive objectives jointly (the state-of-the-art config from the KERMT manuscript).
Optional:
--val-csv <path>— separate validation CSV. Without it, prepare_data auto-splits the input by--val-frac 0.1(random shuffle with--seed).Training-hyperparameter overrides:
--epochs N/--batch-size N/--init-lr F/--max-lr F/--final-lr F/--warmup-epochs F/--weight-decay F/--dropout F/--save-interval N/--seed N. Anything not given is filled fromconfig/defaults_pretrain.json.--vocab-loss-weight F(hybrid only) /--latent-dim N/--contrastive-temperature F(cmim and hybrid only).--wandb-project NAME/--wandb-run-name NAME— optional Weights & Biases logging. When--wandb-projectis set, rank 0 logs train/val losses; the run name is honored only alongside a project. Off by default.--gpus 0,2— restrict to a GPU subset.
Workflow
Let $KERMT_REPO be the path to your kermt repo checkout.
Pre-flight: ensure container + system probe (same as
kermt-continue-pretrainstep 1). Refuse to proceed ifcheck_systemreports gaps.Compute run directory.
RUN_DIR=$KERMT_REPO/runs/pretrain-scratch_$(date -u +%Y-%m-%dT%H-%M-%SZ)Validate the corpus (no ckpt to validate, so this is the only input check):
"$SKILL_DIR/scripts/kermt_container.sh" run --data <user-csv> -- \ "python /skill/scripts/check_data.py --mode pretrain --csv /data/<basename>"Abort on
ok: false.Prepare the data — no vocab pass-through (we want fresh vocab from corpus):
"$SKILL_DIR/scripts/kermt_container.sh" run --data <user-csv> --run-dir $RUN_DIR -- \ "python /skill/scripts/prepare_data.py --mode pretrain \\ --csv /data/<basename> --out /runs/data \\ [--val-csv /data/<val-basename>] [--val-frac 0.1] [--seed 0]"Outputs land at
$RUN_DIR/data/prepare_data.jsonwithvocab_source: "built_fresh".Estimate runtime + warn loudly. This is critical for pretrain-from-scratch:
"Pretraining from scratch is days-scale even on multi-GPU; the released KERMT checkpoints were each trained on millions of molecules for hundreds of GPU-hours. If you mainly want to leverage existing knowledge for a downstream task, consider
kermt-continue-pretrainfrom a released ckpt instead, which converges in hours instead of days."Show the corpus size × epochs × GPU count → estimated wall time.
Ask for explicit confirmation unless
--yeswas given.
Launch the runner detached.
"$SKILL_DIR/scripts/kermt_container.sh" run_detached \\ --name kermt-pretrain-scratch-<ts> \\ --run-dir $RUN_DIR -- \\ "python /skill/scripts/run_pretrain_local.py \\ --from-scratch --pretrain-target-mode <vocab|cmim|hybrid> \\ --prepare-manifest /runs/data/prepare_data.json \\ --out /runs \\ [--epochs N --batch-size N ...]"Note: NO
--ckptflag (the runner refuses if both--from-scratchand--ckptare given). The runner uses thearchgroup fromconfig/defaults_pretrain.jsonto size the model.Report to the user. Always include all of the following — do not omit the TensorBoard line under output-length pressure:
Container name + id
$RUN_DIR/run.json(the manifest withworkflow: pretrain-scratch,from_scratch: true,vocab_check: null,archfrom defaults, fullcmd_replay)Log file:
$RUN_DIR/logs/pretrain_ddp.logTensorBoard:
$RUN_DIR/logs/tb(open withtensorboard --logdir $RUN_DIR/logs/tb)Suggest
kermt-monitor <RUN_DIR>for progress.
Hard rules
Never accept a
--ckptflag. From-scratch is exclusive with input ckpt — the runner enforces this; the skill should too.Never silently default
--pretrain-target-mode. This is a significant architectural choice (vocab = lightweight, hybrid = SOTA). Prompt the user if not given on the CLI.Strong warning before launching. From-scratch pretrain is the most expensive workflow. The user needs to know what they're committing to.
Common errors
--pretrain-target-mode is required when --from-scratch is set→ user forgot the mode flag. Prompt.--from-scratch is incompatible with --ckpt→ user provided both; ask which one they meant.defaults_pretrain.json has no arch group→ repo state issue (should never happen on a fresh clone); points the user at runningkermt-setupagain.
What's in the manifest after a from-scratch run
Same reproducibility fields as continue-pretrain (repo.commit, kermt_image,
cmd_replay, args_applied), plus:
workflow:"pretrain-scratch"from_scratch:trueinputs.ckpt:nullckpt_symlink:nullvocab_check:null(not verified — vocab built from corpus is authoritative for from-scratch)arch: the values pulled fromconfig/defaults_pretrain.json'sarchgroup (with any future CLI overrides applied).
Replayability
Same as continue-pretrain: cmd_replay is a copy-pasteable command. If
ok_to_replay: false, the kermt repo working tree was dirty at launch
time — check repo.commit and git checkout it first.
Files
- ATTRIBUTION.mdAdded by AutoGineer851 B
- BENCHMARK.md7.6 KiB
- LICENSELicence file added by AutoGineer11.2 KiB
- SKILL.md9.3 KiB
- config/defaults_pretrain.json2.6 KiB
- evals/evals.json5.6 KiB
- scripts/_utils.pyScript14.1 KiB
- scripts/check_checkpoint.pyScript20.1 KiB
- scripts/check_data.pyScript11.9 KiB
- scripts/kermt_container.shScript18.9 KiB
- scripts/prepare_data.pyScript36.5 KiB
- scripts/run_pretrain_local.pyScript34.8 KiB
- skill-card.md4.9 KiB
- skill.oms.sig6.1 KiB
BENCHMARK.md
Skill Benchmark: kermt-pretrain-scratch
✅ Overall verdict: PASS — Recommended for publication
Publication Recommendation
Recommended for publication based on the completed evaluation evidence in this report.
Evaluation Metadata
Skill:
kermt-pretrain-scratchEvaluation date: 2026-09-15
Evaluator version:
1.5.6Agents: Claude Code (
aws/anthropic/bedrock-claude-opus-4-8), Codex (openai/openai/gpt-5.5)Tasks: 4 evaluation tasks (3 positive, 1 negative)
Dataset digest:
sha256:9e8d2c01c27435b23630efc8c43be8af9a181db81ff28ec5b78b169ec8877548(skill-evaluator-dataset-snapshot/1)Attempts per task: 3
Environment:
k8s-sandboxTier 2 evidence: required for publication
Tier 3 evidence: required for publication
Each task attempt ran in its own isolated sandbox pod.
What This Report Answers
The three-tier evaluation checks whether the skill:
is safe to use;
produces correct answers;
is discovered and activated when needed;
helps the agent complete the user's goal and expected workflow; and
avoids wasted skill and tool usage.
Results at a Glance
| Measure | Claude Code (Baseline → Skill Uplift) | Codex (Baseline → Skill Uplift) |
|---|---|---|
| Overall | 79.9% — baseline ran, but no comparable score was available; uplift unavailable | 80.5% — baseline ran, but no comparable score was available; uplift unavailable |
| Security | 100.0% → 75.0% (-25.0 points) | 50.0% → 100.0% (+50.0 points) |
| Correctness | 6.7% → 90.0% (+83.3 points) | 91.4% → 90.0% (-1.4 points) |
| Discoverability | 93.3% — baseline ran, but no comparable score was available; uplift unavailable | 88.3% — baseline ran, but no comparable score was available; uplift unavailable |
| Effectiveness | 20.0% → 55.0% (+35.0 points) | 30.4% → 48.1% (+17.7 points) |
| Efficiency | 86.2% — baseline ran, but no comparable score was available; uplift unavailable | 76.0% — baseline ran, but no comparable score was available; uplift unavailable |
How to read this table: baseline is the same task attempted without the target skill. Scores are rounded to one decimal; threshold-adjacent values use additional precision so their displayed band matches the verdict. Uplift is derived from those displayed scores and shown in percentage points.
Example: 47.0% → 92.0% (+45.0 points) means the skill-assisted run scored 92.0%, 45.0 percentage points above its 47.0% no-skill baseline.
A partial dimension was calculated from only the available configured signals; review the detailed report before relying on it.
Token Usage
Actual Tier 3 execution usage is reported for every observed agent/case pair and both conditions.
| Agent | Dataset case | With skill | Without skill | Delta | Change | Coverage |
|---|---|---|---|---|---|---|
| claude-code | All cases | 1,193,344 | 1,358,903 | N/A | N/A | skill 4/4; base 9/9 |
| claude-code | kermt-pretrain-scratch-001 | 325,016 | 640,126 | N/A | N/A | skill 1/1; base 3/3 |
| claude-code | kermt-pretrain-scratch-002 | 276,057 | 296,321 | N/A | N/A | skill 1/1; base 3/3 |
| claude-code | kermt-pretrain-scratch-003 | 309,523 | 293,817 | N/A | N/A | skill 1/1; base 2/2 |
| claude-code | kermt-pretrain-scratch-004 | 282,748 | 128,639 | +154,109 | +119.80% | skill 1/1; base 1/1 |
| codex | All cases | 1,472,593 | 8,395,936 | N/A | N/A | skill 4/4; base 7/7 |
| codex | kermt-pretrain-scratch-001 | 111,468 | 2,676,322 | N/A | N/A | skill 1/1; base 3/3 |
| codex | kermt-pretrain-scratch-002 | 197,440 | 412,299 | -214,859 | -52.11% | skill 1/1; base 1/1 |
| codex | kermt-pretrain-scratch-003 | 487,422 | 4,423,679 | N/A | N/A | skill 1/1; base 2/2 |
| codex | kermt-pretrain-scratch-004 | 676,263 | 883,636 | -207,373 | -23.47% | skill 1/1; base 1/1 |
| ALL AGENTS | Dataset aggregate | 2,665,937 | 9,754,839 | N/A | N/A | skill 8/8; base 16/16 |
Prompt tokens include cached reads, so total tokens are prompt + completion (cached is not added twice). The Efficiency score uses (prompt - cached) + completion. N/A means the relevant trajectory counters were not available; coverage is never estimated.
Tier Status
| Tier | Purpose | Status | Evidence |
|---|---|---|---|
| Tier 1 | Static validation | PASSED WITH OBSERVATIONS | 11 validator(s); 63 finding(s) |
| Tier 2 | Semantic deduplication | PASSED | 2 validator(s); 0 finding(s) |
| Tier 3 | Live agent evaluation | PASS | 2 agent(s); 4 task(s) |
Findings and Observations
<details> <summary>Show detailed findings and successful checks</summary>
MEDIUM QUALITY/quality_correctness: No documented scripts in table format (
skills/kermt-pretrain-scratch/SKILL.md)MEDIUM QUALITY/quality_correctness: Instructions don't mention 'run_script' (
skills/kermt-pretrain-scratch/SKILL.md)MEDIUM QUALITY/quality_correctness: SKILL_SPEC recommended field missing: 'metadata.author' (
skills/kermt-pretrain-scratch/SKILL.md)MEDIUM QUALITY/quality_correctness: SKILL_SPEC recommended field missing: 'metadata.tags' (
skills/kermt-pretrain-scratch/SKILL.md)MEDIUM SCHEMA/metadata_key_style: Metadata key 'risk_tier' is not kebab-case (
skills/kermt-pretrain-scratch/SKILL.md)58 additional finding(s) are available in the full evaluation artifacts.
</details>
Scoring Methodology
<details> <summary>Show dimension definitions, source signals, and thresholds</summary>
| Dimension | Question | Scored signals |
|---|---|---|
| Security | Is it safe to use? | security (100%) |
| Correctness | Is the answer correct? | accuracy (100%) |
| Discoverability | Was the right skill loaded when needed? | skill_execution (100%) |
| Effectiveness | Did the skill help complete the task? | goal_accuracy (50%) + behavior_check (50%) |
| Efficiency | Did it avoid wasted tool calls and token usage? | skill_efficiency (50%) + token_efficiency (50%) |
Dimension bands: PASS at 50% or above; NEUTRAL from 40% to below 50%; FAIL below 40%.
Overall Tier 3 lift: PASS at +5 points or more; FAIL at -10 points or less; values between those bands are NEUTRAL.
Overall verdict: PASS only when every configured dimension passes for at least one supported agent. Lift is reported as diagnostic evidence and does not override this gate.
The 50% attempt pass threshold is a separate per-task gate; it is not the dimension pass threshold.
Effectiveness is the equal-weight mean of goal completion (
goal_accuracy) and expected workflow adherence (behavior_check).Efficiency is 50% tool-call productivity (the backward-compatible
skill_efficiencywire id) and 50%token_efficiency. Positive-case skill routing is scored under Discoverability, not Efficiency; a negative case without a routing target is N/A. N/A sources are omitted, remaining weights are renormalized, and the dimension is marked partial.
Signals present in this run:
security(Security): unsafe operations, secret leakage, and unauthorized access.skill_execution(Skill Execution): whether the expected skill was selected, decoys were avoided, and the workflow executed.skill_efficiency(Tool Productivity): tool-call productivity (legacy wire id; routing is scored under Discoverability).accuracy(Accuracy): final-answer correctness against the reference answer.goal_accuracy(Goal Accuracy): whether the user's goal was achieved.behavior_check(Behavior Check): whether the expected workflow behavior was followed.token_efficiency(Token Efficiency): actual uncached prompt plus completion usage (50% of Efficiency).
</details>
Freshness
Regenerate this benchmark when the skill, evaluation dataset, target agent/model, evaluator version, environment, or scoring policy changes.
Requirements and compatibility
Written for: Claude Code, OpenAI Codex
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs Python
The author says: Requires docker, nvidia-container-toolkit, and a CUDA-capable NVIDIA GPU. Designed for Claude Code, Codex, and Nemotron.
Security
What our scanner noticed· Medium risk
- Large base64-encoded blobs
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- NVIDIA
- Publisher
- NVIDIA (Official)
- Source
- NVIDIA/skills · skills/bionemo-kermt-pretrain-scratch · commit fce3cca
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE-APACHE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by NVIDIA or NVIDIA.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download kermt-pretrain-scratch.zip