diff --git a/.claude/skills/deployment/SKILL.md b/.claude/skills/deployment/SKILL.md index 45545397aa..39105721ae 100644 --- a/.claude/skills/deployment/SKILL.md +++ b/.claude/skills/deployment/SKILL.md @@ -193,7 +193,7 @@ If a cluster config exists (`~/.config/modelopt/clusters.yaml` or `.claude/clust 3. **Deploy based on remote environment:** - - **SLURM** — see `skills/common/slurm-setup.md` for job script templates (container setup, account/partition discovery). The server command inside the container is the same as Step 4 (e.g., `python -m vllm.entrypoints.openai.api_server --model --quantization modelopt`). Use `remote_submit_job` and `remote_poll_job` to manage the job. Get the node hostname from `squeue -j $JOBID -o %N`. + - **SLURM** — see `skills/common/slurm-setup.md` for job script templates (container setup, account/partition discovery). The server command inside the container is the same as Step 4 (e.g., `python -m vllm.entrypoints.openai.api_server --model --quantization modelopt`). After submitting, register the job and set up monitoring per the **monitor skill**. Get the node hostname from `squeue -j $JOBID -o %N`. - **Bare metal / Docker** — use `remote_run` to start the server directly: diff --git a/.claude/skills/evaluation/SKILL.md b/.claude/skills/evaluation/SKILL.md index f8eab5561b..0351c8bbd7 100644 --- a/.claude/skills/evaluation/SKILL.md +++ b/.claude/skills/evaluation/SKILL.md @@ -225,64 +225,24 @@ After the dry-run, check the output from `nel` for any problems with the config. **Monitoring Progress** -After job submission, you can monitor progress using: +After job submission, register the job and set up monitoring per the **monitor skill**. -1. **Check job status:** +**NEL-specific diagnostics** (for debugging failures): - ```bash - nel status - nel info - ``` - -2. **Stream logs** (Local execution only): - - ```bash - nel logs - ``` - - Note: `nel logs` is not supported for SLURM execution. - -3. **Inspect logs via SSH** (SLURM workaround): - - When `nel logs` is unavailable (SLURM), use SSH to inspect logs directly: - - First, get log locations: - - ```bash - nel info --logs - ``` - - Then, use SSH to view logs: - - **Check server deployment logs:** - - ```bash - ssh @ "tail -100 --logs`>/server--*.log" - ``` - - Shows vLLM server startup, model loading, and deployment errors (e.g., missing wget/curl). - - **Check evaluation client logs:** - - ```bash - ssh @ "tail -100 --logs`>/client-.log" - ``` - - Shows evaluation progress, task execution, and results. - - **Check SLURM scheduler logs:** - - ```bash - ssh @ "tail -100 --logs`>/slurm-.log" - ``` - - Shows job scheduling, health checks, and overall execution flow. - - **Search for errors:** - - ```bash - ssh @ "grep -i 'error\|warning\|failed' --logs`>/*.log" - ``` +```bash +# Quick status check +nel status +nel info + +# Get log paths +nel info --logs + +# Inspect logs via SSH +ssh @ "tail -100 /server--*.log" # deployment errors +ssh @ "tail -100 /client-.log" # evaluation errors +ssh @ "tail -100 /slurm-.log" # scheduling/walltime +ssh @ "grep -i 'error\|failed' /*.log" # search all logs +``` --- diff --git a/.claude/skills/monitor/SKILL.md b/.claude/skills/monitor/SKILL.md new file mode 100644 index 0000000000..1e79f5582d --- /dev/null +++ b/.claude/skills/monitor/SKILL.md @@ -0,0 +1,102 @@ +--- +name: monitor +description: Monitor submitted jobs (PTQ, evaluation, deployment) on SLURM clusters. Use when the user asks "check job status", "is my job done", "monitor my evaluation", "what's the status of the PTQ", "check on job 12345", or after any skill submits a long-running job. Also triggers on "nel status", "squeue", or any request to check progress of a previously submitted job. +--- + +# Job Monitor + +Monitor jobs submitted to SLURM clusters — PTQ quantization, NEL evaluation, model deployment, or raw SLURM jobs. + +## When to use + +1. **Auto-monitor** — another skill (PTQ, evaluation, deployment) just submitted a job. Register the job and set up monitoring immediately. +2. **User-initiated** — user asks about a job status, possibly in a new conversation. Check the registry, identify the job, and report. + +--- + +## Job Registry + +All active jobs are tracked in `.claude/active_jobs.json`. This file is the single source of truth for what's being monitored. + +```json +[ + { + "type": "nel", + "id": "", + "host": "", + "user": "", + "submitted": "YYYY-MM-DD HH:MM", + "description": "", + "last_status": "" + } +] +``` + +`type` is one of: `nel`, `slurm`, `launcher`. + +--- + +## On Job Submission + +Every time a job is submitted (by any skill or manually): + +1. **Add an entry** to `.claude/active_jobs.json`. Create the file if it doesn't exist. +2. **Set up a durable recurring cron** (if one isn't already running) that polls all registered jobs every 15 minutes. The cron prompt should: read the registry, check each job, report state changes to the user, remove completed jobs, and delete itself when the registry is empty. + +Always do both steps. Don't try to predict job duration. + +--- + +## On Cron Fire / Status Check + +Whether triggered by the cron or by the user asking "check status": + +1. **Read the registry** from `.claude/active_jobs.json` +2. **Check each job** using the appropriate method (see below) +3. **Report only state changes** — compare against `last_status` in registry +4. **Update `last_status`** in the registry +5. **Remove completed jobs** — any job in a terminal state (COMPLETED, FAILED, CANCELLED, KILLED) +6. **If registry is empty** — delete the recurring cron + +--- + +## How to Check Each Job Type + +### NEL jobs (`type: nel`) + +- **Check:** `nel status ` +- **On completion:** `nel info ` to fetch results +- **On failure:** `nel info --logs` then inspect server/client/SLURM logs via SSH + +### Launcher jobs (`type: launcher`) + +- **Check:** Tail the launcher's background output file for key events +- **Key events:** experiment ID, SLURM job ID, container import, calibration progress, export path, final status +- **On failure:** Look for `Traceback`, `Error`, or `FAILED` in the output + +### Raw SLURM jobs (`type: slurm`) + +- **Check:** `ssh "squeue -j -h -o '%T %M %R'"` — if empty, job left the queue +- **On completion:** `ssh "sacct -j --format=State,ExitCode,Elapsed -n"` +- **On failure:** Check the job's output log file + +--- + +## Identifying Jobs (user-initiated, no ID given) + +When the user asks about a job without specifying an ID, check in order: + +1. `.claude/active_jobs.json` — most reliable, has context +2. `nel ls runs --since 1d` — recent NEL runs +3. `ssh "squeue -u "` — active SLURM jobs +4. `ls -lt tools/launcher/experiments/cicd/ | head -10` — recent launcher experiments + +--- + +## Reporting Guidelines + +- **Report state changes proactively** — PENDING → RUNNING, or job completes +- **Aggregate multiple jobs** — "2 of 4 completed (MMLU-Pro: 42.3%, GSM8K: 67.1%), 1 running, 1 pending" +- **Summarize, don't echo** — interpret events ("Calibration complete, exporting checkpoint") not raw logs +- **On failure, diagnose immediately** — check logs and report root cause without waiting for user to ask +- **Minimize noise** — don't report "still running" unless the user is actively asking diff --git a/.claude/skills/ptq/SKILL.md b/.claude/skills/ptq/SKILL.md index 932f62ec2c..2c0bc0871f 100644 --- a/.claude/skills/ptq/SKILL.md +++ b/.claude/skills/ptq/SKILL.md @@ -100,9 +100,7 @@ For SLURM, see `skills/common/slurm-setup.md` and `references/slurm-setup-ptq.md ### Monitoring -- **Launcher**: blocks and tails logs automatically -- **SLURM (manual)**: poll with `squeue -u $USER` + `sleep` (not cron or background tasks) -- **Local**: watch stdout +After job submission, register the job and set up monitoring per the **monitor skill**. ## Step 5 — Verify output