kermt-pretrain-scratch
Pretrain a fresh KERMT model from scratch on a user-provided corpus. Builds a new vocabulary from the corpus, instantiates the model architecture from defaults, and launches pretrain_ddp.py inside the kermt container (detached for long runs).
Install / Use
npx skills add NVIDIA/skills --skill bionemo-kermt-pretrain-scratchInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
OperationsSupported Platforms
Our assessment of kermt-pretrain-scratch
kermt-pretrain-scratch scores 87/100 on our quality scale, 251st of 487 Operations skills we index.
Its SKILL.md is 9.3 KB long, well organised into 13 sections and no code examples: a thorough specification that gives an agent plenty to work with.
With 3,421 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated 5 days ago, so kermt-pretrain-scratch is actively maintained.
- It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
kermt-pretrain-scratch compared with similar skills
All 4 of these similar skills score higher than kermt-pretrain-scratch; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| kermt-pretrain-scratch (this skill)by NVIDIA | 87 | 3.4k | 5d ago | SKILL.md |
| algorithmic-artby anthropics | 100 | 177.9k | 6d ago | SKILL.md |
| pptxby anthropics | 100 | 177.9k | 6d ago | SKILL.md |
| designby nextlevelbuilder | 100 | 130.2k | 7d ago | SKILL.md |
| ui-ux-pro-maxby nextlevelbuilder | 100 | 130.2k | 7d ago | SKILL.md |
Frequently asked questions
- How do I install kermt-pretrain-scratch?
- Run
npx skills add NVIDIA/skills --skill kermt-pretrain-scratch. The install tabs above show the steps for each supported agent. - Which AI agents does kermt-pretrain-scratch work with?
- It is written for Claude Code, Zed and OpenAI Codex, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is kermt-pretrain-scratch safe to use?
- It is Apache-2.0-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is kermt-pretrain-scratch still maintained?
- The repository was last updated 5 days ago, so kermt-pretrain-scratch is actively maintained.
Skill content
View source on GitHubname: kermt-pretrain-scratch description: Pretrain a fresh KERMT model from scratch on a user-provided corpus. Builds a new vocabulary from the corpus, instantiates the model architecture from defaults, and launches pretrain_ddp.py inside the kermt container (detached for long runs). Unlike kermt-continue-pretrain, no starting checkpoint is loaded — the model is randomly initialized. license: Apache-2.0 compatibility: Requires docker, nvidia-container-toolkit, and a CUDA-capable NVIDIA GPU. Designed for Claude Code, Codex, and Nemotron. metadata: owner: evax@nvidia.com classification: workflow-skill risk_tier: skill
Line/token budget: ~210 lines, ~2400 tokens — well within the
500-line / 5000-token cap for skill files. Most of the orchestration is
shared with kermt-continue-pretrain; the differences are documented below.
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-size| |--------------------------|------------|--------------------------| | L4, 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.
- "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
-
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.log - TensorBoard:
$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.
Related Skills
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
pptx
177.9kUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an em…
design
130.2kComprehensive design skill: brand identity, design tokens, UI styling, logo generation (55 styles, Gemini, Atlas Cloud, or MuAPI AI), corporate identity program (50 deliverables, CIP mockups), HTML presentations (Chart.js), banner design (22 styles, social/ads/web/print), icon design (15 styles, SVG…
ui-ux-pro-max
130.2kUI/UX design intelligence for web, mobile, and desktop. This skill should be used when designing, building, reviewing, or fixing interfaces, including pages, components, design systems, accessibility, interaction, responsive layout, typography, color, charts, and stack-specific UI implementation.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
