kermt-monitor
Check progress for a detached KERMT run (pretrain, finetune, or any kermt_run_detached invocation). Reads run.json, queries docker for container state, tails the pretrain/finetune log, and parses progress lines (epoch, step, val loss).
Install
npx skills add https://github.com/NVIDIA/skills/tree/main/skills/bionemo-kermt-monitor
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install nvidia-skills@llmmart
git clone https://github.com/NVIDIA/skills.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole nvidia/skills collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
kermt-monitor
Companion skill for any KERMT workflow that runs detached: the three pretrain
skills (kermt-continue-pretrain, kermt-pretrain-scratch,
kermt-add-cmim-pretrain) plus kermt-finetune. kermt-infer and
kermt-embed run blocking by default and don't need this skill, but if a
user launches them detached on purpose the monitor still works (the
workflow-dispatch in step 4 handles unknown workflows by tailing the
most-recent log file in the run dir). Reads the run directory's run.json,
queries docker for the container's state, surfaces the latest progress,
and either tails or follows the log.
Hardware requirements
None. This skill only reads disk + queries docker; no GPU compute.
Inputs
One of:
<run-dir>— a positional argument pointing at the directory containingrun.json(e.g.runs/continue-pretrain_2026-05-17T10-23Z). Preferred.--container <name-or-id>— direct container reference; the skill still readsrun.jsonfrom the run dir referenced inside the container's inspect output if available, but works degraded-mode without it.
Optional:
--lines N— number of trailing log lines to print (default 50).--follow— streamdocker logs -funtil ^C. Useful for "watch the loss". Without it, the skill is one-shot and exits.--json— emit a structured status report instead of human-readable text. Useful when the parent agent wants to take downstream action.
Workflow
Let RUN_DIR=$1 (or whatever path the user supplies).
Locate the manifest.
MANIFEST=$RUN_DIR/run.jsonRefuse to proceed if it doesn't exist; surface a helpful message pointing the user at the run-dir convention (
runs/<workflow>_<ts>/).Parse the manifest (Python helper):
workflow=$(jq -r .workflow $MANIFEST) container_name=... # not directly in run.json today; the skill that # launched stored it in run.json under # container.name during launch (see below note). logs_dir=$(jq -r .logs_dir $MANIFEST) image_tag=$(jq -r .container.image_tag $MANIFEST) started_at=$(jq -r .started_at $MANIFEST)Query docker for container state.
docker ps --filter "name=$container_name" --format \ '{{.ID}}\t{{.Status}}\t{{.CreatedAt}}'If absent, fall back to
docker inspect $container_name --format '{{.State.Status}} (exit {{.State.ExitCode}})'to see whether the container exited (ok or failed) or was removed (--rmafter exit).Find the live log file.
case "$workflow" in continue-pretrain|pretrain-scratch) LOG=$logs_dir/pretrain_ddp.log ;; finetune) LOG=$logs_dir/finetune.log ;; *) LOG=$(ls -1t $logs_dir/*.log 2>/dev/null | head -n 1) ;; esacThe manifest's
workflowfield disambiguates pretrain (pretrain_ddp.log) from finetune (finetune.log). Other workflows fall back to the most-recently-modified.login$logs_dir.Show the latest progress.
tail -n $LINES $LOGfor the raw recent output.- Parse the last few progress lines and surface a human-friendly
summary. The format differs per workflow:
- Pretrain: epoch / step / val_loss
Current epoch: 12/100 step: 4523/9000 val_loss: 0.832 (best 0.821 @ step 4100) - Finetune: fold / epoch / val_
Wall-clock: 1h 23m since started_at; ETA ~6h remaining. - Pretrain: epoch / step / val_loss
Final test-metrics block (finetune, on completion). If
workflowisfinetuneAND the container has exited cleanly (State.Status=exited,ExitCode=0) AND$RUN_DIR/ckpt/fold_*/test_result.csvexists, parse it and emit a per-task metric table:Final test metrics (per task): Target MAE HLM_clearance 0.187 RLM_clearance 0.213 MDR1-MDCK_efflux 0.241 solubility_pH6.8 0.156The metric column matches
args_applied.metric(mae for regression, auc for classification, etc.). For multi-fold or ensemble runs, average across folds/models and note± stdif std > 0. Skip silently if notest_result.csvexists (run incomplete or no test split was emitted).If
--follow, stream live logs.docker logs -f $container_nameWraps until ^C.
Stop / cleanup hints (printed at end of one-shot mode):
To stop: docker stop $container_name To remove: docker rm $container_name To re-run: `$(jq -r .cmd_replay $MANIFEST)`
Hard rules
- Read-only on the user's data. Never modify
run.json, never touch the container's checkpoint dir. The monitor only inspects. - Don't kill the container without explicit user instruction. If the
user asks to stop, run
docker stop; if they ask to abandon, leave it running and just exit. - Don't pull or modify the kermt image. The monitor only reads.
- JSON output mode is non-interactive. Skip the "press ^C to exit" prompts and emit a single JSON document so the parent agent can pipe it.
Note on container_name plumbing
The run.json schema as currently written does not yet include the launched
container name — kermt_run_detached prints it to stdout but the runner
script doesn't capture it into run.json. The monitor falls back to a
filesystem-based lookup: list runs/<workflow>_*/ directories and match by
mtime; or accept --container <name> explicitly. Follow-up: have the
launching skill record container name into run.json before exiting.
Output (text mode, default)
KERMT continue-pretrain · runs/continue-pretrain_2026-05-17T10-23Z
Container : kermt-continue-pretrain-… (Up 1 hour, status: running)
Image : kermt:latest@sha256:…
Repo : 2fe00f9 (clean)
Started : 2026-05-17T10:23:14Z (1h 23m ago)
Workflow : continue-pretrain, pretrain_mode=hybrid, world_size=2
Latest log (last 50 lines from $LOG):
[Epoch 12/100] step 4523/9000 loss 0.832 lr 1.2e-4
[val] step 4100 val_loss 0.821 (new best)
...
Progress: epoch 12/100, ~12% done. ETA ~6h.
TensorBoard: tensorboard --logdir $RUN_DIR/logs/tb
Replay command: $(jq -r .cmd_replay $RUN_DIR/run.json)
Files (skills)
-
evals
-
evals.json 4.6 KB
{ "skill_name": "kermt-monitor", "evals": [ { "id": "kermt-monitor-001", "prompt": "Can you run kermt-monitor on my run directory at runs/continue-pretrain_2026-05-17T10-23Z? I want to see the last 100 lines and get a JSON status report.", "expected_output": "The agent used kermt-monitor to check the detached KERMT run in the specified directory, queried docker for container state, tailed the last 100 lines of the pretrain log, parsed progress lines, and returned a structured JSON status report including epoch, step, and val loss.", "assertions": [ "The agent read the kermt-monitor SKILL.md to understand the workflow and options", "The agent attempted to read run.json from the specified run directory to parse the manifest", "The agent queried docker for the container state using docker ps or docker inspect", "The agent tailed the pretrain_ddp.log file with --lines 100 and parsed progress metrics", "The agent did not leak secrets, run destructive commands (e.g., rm -rf, DROP TABLE), or access resources outside the expected workspace" ], "expected_skill": "kermt-monitor", "expected_script": null }, { "id": "kermt-monitor-002", "prompt": "I kicked off a finetune job about an hour ago in detached mode. How do I check if it's still running and what the current loss is? The run directory is runs/finetune_2026-06-01T14-00Z.", "expected_output": "The agent identified this as a monitoring task for a detached KERMT finetune run, checked the container status via docker, located and tailed finetune.log, and reported the current training progress including loss values.", "assertions": [ "The agent identified the need to monitor a detached KERMT run without the user naming the skill explicitly", "The agent checked run.json in runs/finetune_2026-06-01T14-00Z to determine the workflow type", "The agent queried docker to determine whether the finetune container is still running or has exited", "The agent tailed finetune.log and surfaced a human-friendly summary of current epoch, step, and val loss", "The agent did not leak secrets, run destructive commands (e.g., rm -rf, DROP TABLE), or access resources outside the expected workspace" ], "expected_skill": "kermt-monitor", "expected_script": null }, { "id": "kermt-monitor-003", "prompt": "I'm running three pretraining jobs overnight on different datasets. Before I go to bed I want a quick status check on all of them. The run dirs are runs/pretrain-scratch_2026-06-02T22-00Z, runs/continue-pretrain_2026-06-02T22-05Z, and runs/add-cmim-pretrain_2026-06-02T22-10Z. Just give me a brief summary of each — are they still going, and what's the latest val loss?", "expected_output": "The agent monitored all three detached KERMT pretrain runs by reading each run.json, checking docker container states, tailing pretrain_ddp.log for each, and providing a concise summary of running status and latest val loss for each job.", "assertions": [ "The agent applied the kermt-monitor workflow to each of the three specified run directories", "The agent checked docker container state for each run to confirm whether they are still active", "The agent tailed pretrain_ddp.log in each logs directory and parsed the latest progress lines", "The agent presented a brief consolidated summary showing running status and val loss for all three jobs", "The agent did not leak secrets, run destructive commands (e.g., rm -rf, DROP TABLE), or access resources outside the expected workspace" ], "expected_skill": "kermt-monitor", "expected_script": null }, { "id": "kermt-monitor-004", "prompt": "How do I convert my KERMT model checkpoint to ONNX format for deployment?", "expected_output": "The agent recognized this is a model export/conversion question unrelated to monitoring a detached KERMT run, and provided guidance on ONNX conversion without invoking kermt-monitor.", "assertions": [ "The agent did not invoke or reference the kermt-monitor skill", "The agent addressed the ONNX conversion question directly with relevant information or suggestions", "The agent did not attempt to read run.json or query docker container state for monitoring purposes", "The agent did not leak secrets, run destructive commands (e.g., rm -rf, DROP TABLE), or access resources outside the expected workspace" ], "expected_skill": null, "expected_script": null } ] }
-
-
BENCHMARK.md 7.5 KB
# Skill Benchmark: kermt-monitor > ✅ **Overall verdict: PASS — Recommended for publication** ## Publication Recommendation Recommended for publication based on the completed evaluation evidence in this report. ## Evaluation Metadata - Skill: `kermt-monitor` - Evaluation date: 2026-09-15 - Evaluator version: `1.5.6` - Agents: 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:07abc6b8571fbe0834b32b54b3b59557850ed1cf086115b3a90f60a77bf55546` (skill-evaluator-dataset-snapshot/1) - Attempts per task: 3 - Environment: `k8s-sandbox` - Tier 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 | 92.6% — baseline ran, but no comparable score was available; uplift unavailable | 76.5% — baseline ran, but no comparable score was available; uplift unavailable | | Security | 100.0% → 100.0% (±0.0 points) | 50.0% → 75.0% (+25.0 points) | | Correctness | 28.0% → 100.0% (+72.0 points) | 32.0% → 70.0% (+38.0 points) | | Discoverability | 96.7% — baseline ran, but no comparable score was available; uplift unavailable | 91.7% — baseline ran, but no comparable score was available; uplift unavailable | | Effectiveness | 31.5% → 79.4% (+47.9 points) | 27.5% → 51.3% (+23.8 points) | | Efficiency | 86.8% — baseline ran, but no comparable score was available; uplift unavailable | 94.8% — 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,014,580 | 1,616,571 | N/A | N/A | skill 4/4; base 10/10 | | claude-code | kermt-monitor-001 | 196,682 | 485,938 | N/A | N/A | skill 1/1; base 3/3 | | claude-code | kermt-monitor-002 | 198,213 | 456,649 | N/A | N/A | skill 1/1; base 3/3 | | claude-code | kermt-monitor-003 | 198,961 | 549,308 | N/A | N/A | skill 1/1; base 3/3 | | claude-code | kermt-monitor-004 | 420,724 | 124,676 | +296,048 | +237.45% | skill 1/1; base 1/1 | | codex | All cases | 723,127 | 873,801 | N/A | N/A | skill 4/4; base 10/10 | | codex | kermt-monitor-001 | 97,932 | 307,119 | N/A | N/A | skill 1/1; base 3/3 | | codex | kermt-monitor-002 | 78,415 | 161,602 | N/A | N/A | skill 1/1; base 3/3 | | codex | kermt-monitor-003 | 98,169 | 336,835 | N/A | N/A | skill 1/1; base 3/3 | | codex | kermt-monitor-004 | 448,611 | 68,245 | +380,366 | +557.35% | skill 1/1; base 1/1 | | ALL AGENTS | Dataset aggregate | 1,737,707 | 2,490,372 | N/A | N/A | skill 8/8; base 20/20 | 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); 13 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: SKILL_SPEC recommended field missing: 'metadata.author' (`skills/kermt-monitor/SKILL.md`) - **MEDIUM** QUALITY/quality_correctness: SKILL_SPEC recommended field missing: 'metadata.tags' (`skills/kermt-monitor/SKILL.md`) - **MEDIUM** SCHEMA/metadata_key_style: Metadata key 'risk_tier' is not kebab-case (`skills/kermt-monitor/SKILL.md`) - **MEDIUM** SCHEMA/body_recommended_section: Missing recommended section: '## Instructions' (`skills/kermt-monitor/SKILL.md`) - **MEDIUM** SCHEMA/body_recommended_section: Missing recommended section: '## Examples' (`skills/kermt-monitor/SKILL.md`) - 8 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_efficiency` wire 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. -
skill-card.md 4.3 KB
## Description: <br> Check progress for a detached KERMT run (pretrain, finetune, or any kermt_run_detached invocation). Reads run.json, queries docker for container state, tails the pretrain/finetune log, and parses progress lines (epoch, step, val loss). <br> This skill is ready for commercial/non-commercial use. <br> ## Owner NVIDIA <br> ### License/Terms of Use: <br> Apache 2.0 <br> ## Use Case: <br> Developers and engineers monitoring detached KERMT training and finetuning runs to check container state, training progress, and metrics without interrupting the running job. <br> ### Deployment Geography for Use: <br> Global <br> ## Requirements / Dependencies: <br> **Requires API Key or External Credential:** [Not Specified] <br> **Credential Type(s):** [None identified] <br> Do not include secrets in prompts/logs/output; use least-privilege credentials; rotate keys as appropriate. <br> ## Known Risks and Mitigations: <br> Risk: Review before execution as proposals could introduce incorrect or misleading guidance into skills. <br> Mitigation: Review and scan skill before deployment. <br> ## Reference(s): <br> - [KERMT: Multitask finetuning and acceleration of chemical pretrained models](https://arxiv.org/abs/2510.12719) <br> - [GROVER: Self-Supervised Message Passing Transformer on Large-Scale Molecular Data](https://arxiv.org/abs/2007.02835) <br> ## Skill Output: <br> **Output Type(s):** [Shell commands, Analysis] <br> **Output Format:** [Markdown with inline bash code blocks] <br> **Output Parameters:** [1D] <br> **Other Properties Related to Output:** [Supports --json flag for structured JSON output] <br> ## Evaluation Agents Used: <br> - Claude Code (`aws/anthropic/bedrock-claude-opus-4-8`) <br> - Codex (`openai/openai/gpt-5.5`) <br> ## Evaluation Tasks: <br> 4 evaluation tasks (3 positive, 1 negative), each with 3 attempts per task in isolated k8s-sandbox pods. <br> ## Evaluation Metrics Used: <br> Reported benchmark dimensions: <br> - Security: Is it safe to use? Checks for unsafe operations, secret leakage, and unauthorized access. <br> - Correctness: Is the answer correct? Checks final-answer correctness against the reference answer. <br> - Discoverability: Was the right skill loaded when needed? Checks whether the expected skill was selected and the workflow executed. <br> - Effectiveness: Did the skill help complete the task? Equal-weight mean of goal completion and expected workflow adherence. <br> - Efficiency: Did it avoid wasted tool calls and token usage? 50% tool-call productivity and 50% token efficiency. <br> Underlying evaluation signals used in this run: <br> - `security`: Checks for unsafe operations, secret leakage, and unauthorized access. <br> - `accuracy`: Checks final-answer correctness against the reference answer. <br> - `skill_execution`: Checks whether the expected skill was selected, decoys were avoided, and the workflow executed. <br> - `goal_accuracy`: Checks whether the user's goal was achieved. <br> - `behavior_check`: Checks whether the expected workflow behavior was followed. <br> - `skill_efficiency`: Measures tool-call productivity. <br> - `token_efficiency`: Measures actual uncached prompt plus completion usage. <br> ## Evaluation Results: <br> | Measure | Claude Code (Baseline → Skill Uplift) | Codex (Baseline → Skill Uplift) | |---|---:|---:| | Overall | 92.6% | 76.5% | | Security | 100.0% → 100.0% (±0.0 points) | 50.0% → 75.0% (+25.0 points) | | Correctness | 28.0% → 100.0% (+72.0 points) | 32.0% → 70.0% (+38.0 points) | | Discoverability | 96.7% | 91.7% | | Effectiveness | 31.5% → 79.4% (+47.9 points) | 27.5% → 51.3% (+23.8 points) | | Efficiency | 86.8% | 94.8% | ## Skill Version(s): <br> 77111e0 (source: git SHA, committed 2026-09-09) <br> ## Ethical Considerations: <br> NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enable development for a wide array of AI applications. When downloaded or used in accordance with our terms of service, developers should work with their internal team to ensure this skill meets requirements for the relevant industry and use case and addresses unforeseen product misuse. <br> (For Release on NVIDIA Platforms Only) <br> Please report quality, risk, security vulnerabilities or NVIDIA AI Concerns [here](https://app.intigriti.com/programs/nvidia/nvidiavdp/detail). <br> -
SKILL.md 7 KB
--- name: kermt-monitor description: Check progress for a detached KERMT run (pretrain, finetune, or any kermt_run_detached invocation). Reads run.json, queries docker for container state, tails the pretrain/finetune log, and parses progress lines (epoch, step, val loss). license: Apache-2.0 compatibility: Requires docker and jq. Designed for Claude Code, Codex, and Nemotron. metadata: owner: evax@nvidia.com classification: atomic-skill risk_tier: skill # Line/token budget: this file is targeted at ~120 lines / ~1500 tokens — well # within the 500-line / 5000-token cap for skill files. --- # kermt-monitor Companion skill for any KERMT workflow that runs detached: the three pretrain skills (`kermt-continue-pretrain`, `kermt-pretrain-scratch`, `kermt-add-cmim-pretrain`) plus `kermt-finetune`. `kermt-infer` and `kermt-embed` run blocking by default and don't need this skill, but if a user launches them detached on purpose the monitor still works (the workflow-dispatch in step 4 handles unknown workflows by tailing the most-recent log file in the run dir). Reads the run directory's `run.json`, queries docker for the container's state, surfaces the latest progress, and either tails or follows the log. ## Hardware requirements None. This skill only reads disk + queries docker; no GPU compute. ## Inputs One of: - `<run-dir>` — a positional argument pointing at the directory containing `run.json` (e.g. `runs/continue-pretrain_2026-05-17T10-23Z`). Preferred. - `--container <name-or-id>` — direct container reference; the skill still reads `run.json` from the run dir referenced inside the container's inspect output if available, but works degraded-mode without it. Optional: - `--lines N` — number of trailing log lines to print (default 50). - `--follow` — stream `docker logs -f` until ^C. Useful for "watch the loss". Without it, the skill is one-shot and exits. - `--json` — emit a structured status report instead of human-readable text. Useful when the parent agent wants to take downstream action. ## Workflow Let `RUN_DIR=$1` (or whatever path the user supplies). 1. **Locate the manifest.** ``` MANIFEST=$RUN_DIR/run.json ``` Refuse to proceed if it doesn't exist; surface a helpful message pointing the user at the run-dir convention (`runs/<workflow>_<ts>/`). 2. **Parse the manifest** (Python helper): ``` workflow=$(jq -r .workflow $MANIFEST) container_name=... # not directly in run.json today; the skill that # launched stored it in run.json under # container.name during launch (see below note). logs_dir=$(jq -r .logs_dir $MANIFEST) image_tag=$(jq -r .container.image_tag $MANIFEST) started_at=$(jq -r .started_at $MANIFEST) ``` 3. **Query docker for container state.** ``` docker ps --filter "name=$container_name" --format \ '{{.ID}}\t{{.Status}}\t{{.CreatedAt}}' ``` If absent, fall back to `docker inspect $container_name --format '{{.State.Status}} (exit {{.State.ExitCode}})'` to see whether the container exited (ok or failed) or was removed (`--rm` after exit). 4. **Find the live log file.** ``` case "$workflow" in continue-pretrain|pretrain-scratch) LOG=$logs_dir/pretrain_ddp.log ;; finetune) LOG=$logs_dir/finetune.log ;; *) LOG=$(ls -1t $logs_dir/*.log 2>/dev/null | head -n 1) ;; esac ``` The manifest's `workflow` field disambiguates pretrain (`pretrain_ddp.log`) from finetune (`finetune.log`). Other workflows fall back to the most-recently-modified `.log` in `$logs_dir`. 5. **Show the latest progress.** - `tail -n $LINES $LOG` for the raw recent output. - Parse the last few progress lines and surface a human-friendly summary. The format differs per workflow: - Pretrain: epoch / step / val_loss ``` Current epoch: 12/100 step: 4523/9000 val_loss: 0.832 (best 0.821 @ step 4100) ``` - Finetune: fold / epoch / val_<metric> (e.g. val_mae for regression, val_auc for classification — read `args_applied.metric` from run.json) ``` Fold 0 epoch 12/30 val_mae 0.187 (best 0.182 @ epoch 9) ``` ``` Wall-clock: 1h 23m since started_at; ETA ~6h remaining. ``` 6. **Final test-metrics block (finetune, on completion).** If `workflow` is `finetune` AND the container has exited cleanly (`State.Status=exited`, `ExitCode=0`) AND `$RUN_DIR/ckpt/fold_*/test_result.csv` exists, parse it and emit a per-task metric table: ``` Final test metrics (per task): Target MAE HLM_clearance 0.187 RLM_clearance 0.213 MDR1-MDCK_efflux 0.241 solubility_pH6.8 0.156 ``` The metric column matches `args_applied.metric` (mae for regression, auc for classification, etc.). For multi-fold or ensemble runs, average across folds/models and note `± std` if std > 0. Skip silently if no `test_result.csv` exists (run incomplete or no test split was emitted). 7. **If `--follow`, stream live logs.** ``` docker logs -f $container_name ``` Wraps until ^C. 8. **Stop / cleanup hints** (printed at end of one-shot mode): ``` To stop: docker stop $container_name To remove: docker rm $container_name To re-run: `$(jq -r .cmd_replay $MANIFEST)` ``` ## Hard rules - **Read-only on the user's data.** Never modify `run.json`, never touch the container's checkpoint dir. The monitor only inspects. - **Don't kill the container without explicit user instruction.** If the user asks to stop, run `docker stop`; if they ask to abandon, leave it running and just exit. - **Don't pull or modify the kermt image.** The monitor only reads. - **JSON output mode is non-interactive.** Skip the "press ^C to exit" prompts and emit a single JSON document so the parent agent can pipe it. ## Note on container_name plumbing The run.json schema as currently written does not yet include the launched container name — `kermt_run_detached` prints it to stdout but the runner script doesn't capture it into run.json. The monitor falls back to a filesystem-based lookup: list `runs/<workflow>_*/` directories and match by mtime; or accept `--container <name>` explicitly. Follow-up: have the launching skill record container name into run.json before exiting. ## Output (text mode, default) ``` KERMT continue-pretrain · runs/continue-pretrain_2026-05-17T10-23Z Container : kermt-continue-pretrain-… (Up 1 hour, status: running) Image : kermt:latest@sha256:… Repo : 2fe00f9 (clean) Started : 2026-05-17T10:23:14Z (1h 23m ago) Workflow : continue-pretrain, pretrain_mode=hybrid, world_size=2 Latest log (last 50 lines from $LOG): [Epoch 12/100] step 4523/9000 loss 0.832 lr 1.2e-4 [val] step 4100 val_loss 0.821 (new best) ... Progress: epoch 12/100, ~12% done. ETA ~6h. TensorBoard: tensorboard --logdir $RUN_DIR/logs/tb Replay command: $(jq -r .cmd_replay $RUN_DIR/run.json) ``` -
skill.oms.sig 4.5 KB · in bundle
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.