Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

huawei-cloud-cloudrobo-train-metrics

БесплатноЗапускает вложенные скриптыНе проверен

Integrate the ocms (Octopus Metrics Summary) library into any PyTorch training script to report training metrics (loss, learning rate, timing, eval scores…

huaweicloudskillот huaweicloudskill159 установок в других каталогах

Об этом скилле

ocms Training Metric Integration

Overview

This skill integrates the ocms library into PyTorch training scripts so training metrics can be reported to the Huawei Octopus platform. It provides a framework-agnostic recorder module plus integration patterns for common training frameworks.

Workflow at a glance:

  1. Check whether the ocms package is available (optional install, see "Step 0" — the integration works without it)
  2. Discover where the training script logs metrics
  3. Copy scripts/ocms_recorder.py into the project
  4. Integrate per the training framework (see below)
  5. Verify with python3 scripts/verify_ocms.py

Prerequisites

  1. A PyTorch training script to integrate with (custom loop, HF Trainer, Lightning, Accelerate, MMEngine, or a shared base class).
  2. Python 3.8+: run all commands with the training environment activated (e.g. conda activate <env>), so python3 is that environment's interpreter. The ocms package is optional: when it is missing, OcmsRecorder degrades gracefully without affecting training.
  3. Training output directory: metrics fall back to <output_dir>/ocms_metrics outside the Octopus platform (on the platform, the METRICS env var is preferred).

All commands below run from this skill's directory. Project-specific paths are passed through shell variables that the agent sets from the user's answers (see "Parameter Confirmation"); no command contains a placeholder that must be edited by hand.

Workflow

Step 0: Check ocms (install only where available)

python3 scripts/verify_ocms.py

The script reports whether ocms is installed and runs a self-test of the recorder in a temporary directory. Both outcomes are valid:

Result Meaning Next step
ocms: installed + OK: metrics.json and ... chart CSVs produced metric reporting is enabled continue with Step 1
ocms: not installed + OK: graceful degradation verified the recorder disables itself; training is unaffected continue with Step 1; install ocms only where it is available

ocms is a proprietary Octopus platform package: it is not on PyPI and is distributed only through a time-limited signed link in the Octopus course README. Environments that cannot obtain it (for example evaluation environments without that link) stay on the graceful-degradation path, which is the expected result there, not a failure. To install it where it is available, get the currently valid signed link from the official octopus-courses README (time-limited; re-fetch if expired), download the wheel to the current directory, then run:

python3 -m pip install ./ocms-*.whl

After installing on the Octopus platform, re-run the check as python3 scripts/verify_ocms.py --require-ocms, which reports a missing package as an error instead of a degradation. Use that flag only where ocms is expected to be installed.

Step 1: Discover Metric-Logging Points

Search the training script for where metrics are built and logged. Common code patterns include:

# Code patterns to SEARCH FOR in the training script (not commands to run):
wandb.log(metrics, step=...)
logger.info(f"Step ..., Loss: {metrics}")
tensorboard_writer.add_scalar(...)
print(f"loss={loss.item()}")
metrics = {"loss": loss.item(), ...}

The function or method containing these calls is the integration point. Typical function names: _log_metrics, log_metrics, on_log, after_train_iter.

Also identify the available metric items — inspect the metrics dict keys:

  • Loss: loss, train_loss, action_dit_loss, vlm_loss, etc.
  • Learning rate: learning_rate, learning_rate/<group_name>, etc.
  • Epoch: epoch
  • Timing: timing/data, timing/model
  • Eval: mse_score, accuracy, mIoU, etc.
  • Gradient: grad_norm

Step 2: Copy the Recorder Module

Copy this skill's scripts/ocms_recorder.py into the target project's migrate_to_cloudrobo/ directory. It is a standalone, framework-agnostic module with no dependencies beyond ocms and the Python standard library.

# Run from the skill directory. PROJECT_DIR is the training project root,
# set by the agent from the user's answer (see "Parameter Confirmation").
mkdir -p "$PROJECT_DIR/migrate_to_cloudrobo"
cp scripts/ocms_recorder.py "$PROJECT_DIR/migrate_to_cloudrobo/ocms_recorder.py"

The module exposes the following Python API. These are names used inside the training code, not shell commands:

from ocms_recorder import OcmsRecorder

recorder = OcmsRecorder.from_output_dir(output_dir)  # prefers $METRICS, else <output_dir>/ocms_metrics
# or: OcmsRecorder(log_dir=..., chart_groups=..., enabled=True)
recorder.log(step=global_step, metrics=metrics)       # log one metric snapshot (rank-0 only)
recorder.finish()
Полный SKILL.md на ClawHub

Установить huawei-cloud-cloudrobo-train-metrics в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл huawei-cloud-cloudrobo-train-metrics?

Integrate the ocms (Octopus Metrics Summary) library into any PyTorch training script to report training metrics (loss, learning rate, timing, eval scores, grad norm, etc.) to the Huawei Octopus platform for visualization. Use this skill when the user mentions ocms, Octopus metrics, training metric reporting/upload/visualization, or wants to add metric logging to a training script. Supports custom training loops, HuggingFace Trainer, PyTorch Lightning, Accelerate, MMEngine, and shared base classes. Also triggers when the user asks to report/upload/log training metrics and the ocms package is installed in the conda env.

Как установить скилл huawei-cloud-cloudrobo-train-metrics?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл huawei-cloud-cloudrobo-train-metrics запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить huawei-cloud-cloudrobo-train-metrics с