Skip to content

Add wandb-tracking agent skill for run comparison and view management#77

Merged
haok1402 merged 2 commits into
mlc-ai:mainfrom
haok1402:0718-wandb-skills
Jul 18, 2026
Merged

Add wandb-tracking agent skill for run comparison and view management#77
haok1402 merged 2 commits into
mlc-ai:mainfrom
haok1402:0718-wandb-skills

Conversation

@haok1402

Copy link
Copy Markdown
Collaborator

Why

Training metrics live in wandb. This skill gives agents a first-class way to read them instead of hand-rolling API calls each time.

  • Sweeping runs. Listing and reading runs in a project becomes a one-liner, not a fresh script every time.
  • Comparing runs. Before/after a change (say a correctness fix), fetch both runs and compare their loss curves directly.
  • PR review (the main one). When a contributor attaches a wandb view to a PR, Claude can read that view and validate the claims against the actual metrics.

What

New skill at .agents/skills/wandb-tracking/, resource-first:

  • runs.py: list runs and metric keys, compare a metric across runs (per-step and final delta with a noise-floor check), logs to pull a run's console output.
  • views.py: list / show / set / delete the ?nw= saved views.

SKILL.md is the contract for using it; references/views.md covers the view internals for editing the scripts.

@haok1402

Copy link
Copy Markdown
Collaborator Author

@claude review

@claude

claude Bot commented Jul 18, 2026

Copy link
Copy Markdown

Performance Review

No performance impact. This PR is purely additive agent tooling under .agents/skills/wandb-tracking/ — a SKILL.md, a reference doc, and two standalone helper scripts (runs.py, views.py) that agents invoke manually to query the wandb API. Nothing here is imported by the framework or executes during a training step: no DualPipeV stage, collective, kernel, device sync, or compiled region is touched, so there is no step-time or peak-memory surface to regress. No evidence (timing/memory) is needed for a change that never runs in the training loop.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the wandb-tracking skill, which includes documentation and scripts (runs.py and views.py) to list, compare, and manage Weights & Biases experiment data and project views. The review feedback focuses on improving the robustness of these scripts, specifically by handling missing or invalid run identifiers gracefully, stripping whitespace from comma-separated CLI inputs, using context managers and proper encoding for file operations, and adding defensive checks against empty GraphQL responses or malformed view specifications.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread .agents/skills/wandb-tracking/scripts/views.py
Comment thread .agents/skills/wandb-tracking/scripts/runs.py
Comment thread .agents/skills/wandb-tracking/scripts/runs.py
Comment thread .agents/skills/wandb-tracking/scripts/runs.py
Comment thread .agents/skills/wandb-tracking/scripts/views.py
Comment thread .agents/skills/wandb-tracking/scripts/views.py
@claude

claude Bot commented Jul 18, 2026

Copy link
Copy Markdown

Compactness Review

No compactness issues. The two scripts are direct argparse-dispatched commands with no wrappers/factories/registries, no ImportError or GPU guards, and no speculative flexibility — every helper (id↔name resolution, series, noise_floor, shown_hidden) and every flag (--drop-first, --from-view, --update, --file) is load-bearing and documented against real use in SKILL.md.

Comment thread .agents/skills/wandb-tracking/scripts/runs.py Outdated
Comment thread .agents/skills/wandb-tracking/scripts/views.py Outdated
@claude

claude Bot commented Jul 18, 2026

Copy link
Copy Markdown

Correctness Review

Skill-only PR (docs + two Python helper scripts); no training-framework code, so no gradient/parallelism/kernel surface. The scripts are otherwise sound — run/name resolution, the root==1 → tree=hidden selection math, and the upsert/delete flows all trace correctly. Two issues in the analysis paths:

  • runs.py compare verdict is noise-sensitive (runs.py:106): the INSIDE/ABOVE parity call tests the single last-step final delta against the mean jitter ref_noise, so it flips to "ABOVE" a large fraction of the time even at true parity. Judge on settling (already computed) instead. This is the one that matters, since validating parity claims is the skill's headline use case.
  • views.py list crashes on empty runSets (views.py:155): shown_hidden indexes runSets[0] but the guard only catches KeyError/JSONDecodeError; an IndexError aborts the whole listing. One-word fix.

No evidence (sample output against a real project) is committed, which is acceptable for a tooling skill, but a quick compare/list/set round-trip against an actual wandb project would confirm the GraphQL specs and selection semantics end-to-end.

@claude

claude Bot commented Jul 18, 2026

Copy link
Copy Markdown

Consistency Review

No consistency issues found. This PR adds a net-new wandb-tracking skill, so nothing elsewhere in the repo describes a renamed/moved/changed symbol — there are no stale references to flag.

Verified the new docs against the new code and the wider codebase:

  • The 8 metric keys listed in SKILL.md (train/cross-entropy-loss, train/gradient-norm, train/load-balance-loss, train/learning-rate, train/step, infra/step-time, infra/tokens-per-second, infra/peak-gpu-memory) all match what pithtrain/tasks/pretrain_lm.py logs to wandb.
  • compare prose (delta = run - ref, per-step range, final + settling = mean of last 5, INSIDE/ABOVE noise) matches scripts/runs.py; --drop-first semantics agree between SKILL, docstring, and code.
  • The three GraphQL queries in references/views.md (Views / upsertView / deleteView) are byte-for-byte the ones in scripts/views.py, and the shown = all_run_ids - tree selection semantics match shown_hidden.
  • Usage strings match argparse for both scripts; pow2-vs-full-mantissa matches the codebase E8M0(pow2)/fp32 scale-format distinction.

@haok1402
haok1402 merged commit 6cd3c48 into mlc-ai:main Jul 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants