Model Resource Profiler for Openclaw

A technical tool for analyzing PyTorch profiler artifacts to optimize GPU memory and CPU execution efficiency.

daiwk
v0.1.1
Feb 27, 2026
1
894
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install model-resource-profiler

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install model-resource-profiler using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Model Resource Profiler?

The Model Resource Profiler is a specialized diagnostic framework designed for deep learning developers to profile and optimize model performance. It focuses on identifying GPU memory (VRAM) fragmentation and CPU execution hotspots by processing Torch CUDA memory snapshots and PyTorch profiler traces in standard JSON formats. By leveraging this Openclaw Skills integration, developers can transform raw trace data into actionable insights without the security risks associated with pickle deserialization. It serves as a bridge between complex profiler artifacts and concrete optimization strategies for both training and inference workloads.

This skill is built with safety as a priority, enforcing strict boundaries on artifact types to ensure the integrity of the analysis environment. Whether you are debugging out-of-memory errors or looking to reduce step time, the profiler provides a reproducible methodology for resource analysis. Using Openclaw Skills for performance auditing ensures that your model optimization process is data-driven, secure, and highly efficient.

Model Resource Profiler Use Cases

  • Identifying VRAM fragmentation and out-of-memory (OOM) triggers during large-scale model training.
  • Pinpointing CPU execution bottlenecks within the dataloader or optimizer phases to improve hardware utilization.
  • Optimizing batch sizes and sequence lengths based on empirical resource allocation data.
  • Auditing model parallelization strategies and communication overhead in distributed training environments.
  • Generating reproducible performance reports for cross-functional team reviews using Openclaw Skills tools.

How Model Resource Profiler Works

  1. The agent identifies available profiler artifacts (JSON or JSON.GZ) and validates the user's trust boundary to ensure safety.
  2. The user specifies the target phase (e.g., forward pass, backward pass, or dataloader) and provides the run context like model architecture and batch size.
  3. The skill executes a deterministic analyzer script to extract summary metrics from memory snapshots and CPU traces.
  4. Extracted metrics are interpreted using a fixed rubric to identify critical bottlenecks such as allocator churn or dominant operator families.
  5. The skill generates a structured report including a resource summary, a ranked action plan, and validation metrics for the proposed optimizations.

Model Resource Profiler Setup

To begin using this skill, ensure your PyTorch artifacts are exported in JSON format. You can run the analysis using the provided script:

python3 scripts/analyze_profile.py \
  --memory-json /path/to/memory_snapshot.json \
  --cpu-trace /path/to/trace.json.gz \
  --md-out /tmp/profile_report.md \
  --json-out /tmp/profile_report.json

If you currently use pickle for snapshots, convert them to JSON in your trusted environment using:

import json
import torch

snapshot = torch.cuda.memory._snapshot()
with open("memory_snapshot.json", "w", encoding="utf-8") as f:
    json.dump(snapshot, f)

Model Resource Profiler Data Schema & Taxonomy

The skill processes structured JSON artifacts and outputs comprehensive reports. Data is organized as follows:

Data Component Format Description
Memory Snapshot JSON/JSON.GZ Torch CUDA memory allocation and segment data.
CPU Trace JSON/JSON.GZ Chrome trace format containing traceEvents for CPU operations.
Analysis Report Markdown (.md) Human-readable diagnosis, bottlenecks, and action plans.
Metrics Export JSON Machine-readable data for performance tracking and regression testing.

Metadata captured during the process includes model type, precision (fp16/bf16), parallelism strategy, and batch configurations to ensure context-aware analysis within Openclaw Skills.

Model Resource Profiler Advanced Features

  • Multi-artifact correlation: Synchronizes memory snapshots with CPU traces to provide a holistic view of resource behavior.
  • Automated bottleneck ranking: Uses a fixed interpretation rubric to prioritize issues based on total duration and memory slack.
  • Hypothesis-driven diagnostics: Marks low-confidence conclusions and requests specific missing artifacts to refine the analysis.
  • Safety-first execution: Strictly avoids unsafe deserialization of binary formats, focusing exclusively on secure JSON-based workflows.
  • Integration ready: Designed to work within Openclaw Skills to automate performance auditing in continuous integration pipelines.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*