npx skills add ...
npx skills add nvidia/skills --skill kermt-infer
Run predictions with a finetuned KERMT checkpoint on a SMILES-only CSV. The skill validates that the input ckpt has task FFN heads (refuses pretrain ckpts with a redirect to kermt-finetune), validates the CSV, prepares the data (clean + rdkit_2d features), then launches main.py predict inside the kermt container (blocking, minutes-scale).
npx skills add nvidia/skills --skill kermt-infer
Run predictions with a finetuned KERMT checkpoint on a SMILES-only CSV. The skill is the workflow orchestrator: validate ckpt, validate CSV, prepare data, launch the runner blocking, return the predictions CSV.
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/.
batch_size 32.Required:
--ckpt <path> — finetuned checkpoint (must have task FFN heads). The
validator refuses pretrain ckpts with a redirect to kermt-finetune.--csv <path> — SMILES-only CSV. First column is smiles; other columns
are ignored.Optional:
--batch-size N — override the configured default (32).--seed N — random seed for inference (deterministic featurization paths).--gpus 0 — single GPU id (default 0). Multi-GPU rejected.--from-prepare <dir> — skip the prepare step and reuse an existing
prepare_data.json in <dir>.Let $KERMT_REPO be the path to your kermt repo checkout, and assume
kermt-setup has built kermt:latest.
Pre-flight: ensure container + system probe.
Refuse to proceed on ok: false.
Compute run directory.
Validate the checkpoint.
Parse the JSON. Abort on ok: false. The validator rejects pretrain ckpts
(has_task_ffn: false) with a redirect to kermt-finetune.
Validate the data.
Abort on ok: false.
Prepare the data.
Outputs land at $RUN_DIR/data/prepare_data.json with clean_csv +
clean_npz paths (rdkit_2d_normalized features).
Launch the runner (blocking).
Returns the predictions CSV path on success.
Report to the user. Output a short summary:
$RUN_DIR/out/predictions.csv (smiles + per-target columns)$RUN_DIR/run.json (cmd_replay + image digest + applied args)$RUN_DIR/logs/inference.log<out>/ckpt_link/ subdir so main.py predict --checkpoint_dir
picks it up; the source file stays untouched.run.json but does not pass arch flags into
main.py predict — predict reads them from the loaded ckpt's saved_args.args_applied field of run.json records
every flag's value + source (user / default-config). Surface a short
summary of any default-filled flag.inference requires a finetuned ckpt with task FFN heads → ckpt is a
pretrain ckpt; use kermt-finetune first.prepare_data manifest reports ok=False → check the manifest errors for
the failed step (typically clean_smiles or save_features).could not convert string to float: '<value>' from save_features or main.py
predict → input CSV has a non-numeric passthrough column (e.g. a 'split'
label). The prep step now strips the CSV to SMILES-only at inference; if
this error still surfaces, the CSV is being read by a runner that bypassed
prepare_data. Re-run via the skill, not main.py directly.--gpus '0,1' is single-GPU only → pass a single id.The run.json cmd_replay field is a single-line command that re-runs the
inference with the same inputs. To replay inside the kermt container:
If ok_to_replay: false (dirty kermt repo worktree at launch time), pin
the commit via repo.commit and git checkout it first.