optim-pipeline
Complete GPU optimization pipeline. Launches N agents, runs benchmarks, anti-triche verification, and generates report automatically. One command for everything.
Best use case
optim-pipeline is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Complete GPU optimization pipeline. Launches N agents, runs benchmarks, anti-triche verification, and generates report automatically. One command for everything.
Teams using optim-pipeline should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/optim-pipeline/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How optim-pipeline Compares
| Feature / Agent | optim-pipeline | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Complete GPU optimization pipeline. Launches N agents, runs benchmarks, anti-triche verification, and generates report automatically. One command for everything.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# GPU Optimization Pipeline - Full Automation V3
You are the **pipeline orchestrator**. You run the COMPLETE optimization workflow automatically.
## Parameters
Extract parameters from $ARGUMENTS (space-separated):
- **N** = First argument (default: 24)
- **CHUNK_SIZE** = Second argument (default: 4)
- **BUILD_JOBS** = Third argument (default: 4)
- **TIMEOUT** = Fourth argument (default: 1800)
- **LOG_DIR** = Fifth argument (default: `./optim_logs`)
Example: `/optim-pipeline 24 4 4 1800 ./logs`
## Complete Workflow
You will execute ALL phases automatically:
```bash
# Get parameters
PARAMS=($ARGUMENTS)
N_AGENTS=${PARAMS[0]:-24}
CHUNK_SIZE=${PARAMS[1]:-4}
BUILD_JOBS=${PARAMS[2]:-4}
TIMEOUT=${PARAMS[3]:-1800}
LOG_DIR=${PARAMS[4]:-"./optim_logs"}
# Additional pipeline parameters
REPEAT_COUNT=${PARAMS[5]:-10}
COOLDOWN=${PARAMS[6]:-2}
FILTER=${PARAMS[7]:-"3D_Large"}
echo "╔══════════════════════════════════════════════════════════╗"
echo "║ GPU OPTIMIZATION PIPELINE - FULL AUTOMATION ║"
echo "╚══════════════════════════════════════════════════════════╝"
echo "Agents: $N_AGENTS | Chunk: $CHUNK_SIZE | Jobs: $BUILD_JOBS"
echo "Benchmark: $REPEAT_COUNT reps, ${COOLDOWN}s cooldown"
echo "Filter: $FILTER"
echo "══════════════════════════════════════════════════════════"
echo ""
```
## Phase 1: Orchestrator
Launch optimization agents:
```bash
echo "[1/4] 🚀 Launching $N_AGENTS optimization agents..."
# Launch orchestrator skill
ORCH_OUTPUT=$(optim-orchestrator $N_AGENTS $CHUNK_SIZE $BUILD_JOBS $TIMEOUT "$LOG_DIR")
# Extract session ID from output
SESSION_ID=$(echo "$ORCH_OUTPUT" | grep -oP 'Session ID: \K[0-9_]+' || echo "")
if [ -z "$SESSION_ID" ]; then
echo "❌ Failed to get session ID from orchestrator"
echo "$ORCH_OUTPUT"
exit 1
fi
echo "✓ Session ID: $SESSION_ID"
echo ""
```
## Phase 2: Smart Monitoring
Monitor agents with IMPROVED logic:
```bash
echo "[2/4] ⏳ Monitoring agents (smart mode)..."
SESSION_LOG_DIR="$LOG_DIR/session_${SESSION_ID}"
START_TIME=$(date +%s)
MAX_WAIT=$((TIMEOUT + 300)) # Timeout + 5min grace period
while true; do
NOW=$(date +%s)
ELAPSED=$((NOW - START_TIME))
# Count completed agents
COMPLETED=0
STUCK=0
BUILD_FAILED=0
for i in $(seq -f "%02g" 1 $N_AGENTS); do
RESULT_FILE="$SESSION_LOG_DIR/agent_${i}_result.json"
if [ -f "$RESULT_FILE" ]; then
STATUS=$(cat "$RESULT_FILE" | jq -r '.status // "unknown"' 2>/dev/null)
COMPLETED=$((COMPLETED + 1))
if [ "$STATUS" = "build_failed" ]; then
BUILD_FAILED=$((BUILD_FAILED + 1))
fi
else
# Check if stuck (no log activity for 3 minutes)
LOG="$SESSION_LOG_DIR/agent_${i}.log"
if [ -f "$LOG" ]; then
LAST_ACTIVITY=$(stat -c %Y "$LOG")
LOG_AGE=$((NOW - LAST_ACTIVITY))
# Stuck if no activity for 3min AND at least one build failed nearby
if [ $LOG_AGE -gt 180 ] && [ $BUILD_FAILED -gt 0 ]; then
STUCK=$((STUCK + 1))
fi
fi
fi
done
# Progress bar (every 60s only)
if [ $((ELAPSED % 60)) -eq 0 ]; then
PROGRESS=$((COMPLETED * 100 / N_AGENTS))
echo "[$(date +%H:%M:%S)] Progress: $COMPLETED/$N_AGENTS ($PROGRESS%) - Stuck: $STUCK - Build failed: $BUILD_FAILED"
# Early abort if too many failures
if [ $BUILD_FAILED -gt $((N_AGENTS / 2)) ]; then
echo "⚠️ More than 50% builds failed, aborting..."
break
fi
fi
# Check completion
if [ $COMPLETED -ge $N_AGENTS ]; then
echo "✓ All agents completed!"
break
fi
# Timeout check
if [ $ELAPSED -gt $MAX_WAIT ]; then
echo "⚠️ Timeout after ${ELAPSED}s"
break
fi
sleep 10 # Check every 10s, print every 60s
done
echo ""
```
## Phase 3: Benchmarks
Run sequential GPU benchmarks:
```bash
echo "[3/4] 📊 Running GPU benchmarks..."
# Find worktrees with successful builds
SUCCESSFUL_AGENTS=()
for i in $(seq -f "%02g" 1 $N_AGENTS); do
WORKTREE="/home/sbstndbs/subsetix_kokkos_optimized_opt${i}"
if [ -d "$WORKTREE/build-experimental-cuda" ]; then
RESULT_FILE="$SESSION_LOG_DIR/agent_${i}_result.json"
if [ -f "$RESULT_FILE" ]; then
STATUS=$(cat "$RESULT_FILE" | jq -r '.status // "unknown"' 2>/dev/null)
if [ "$STATUS" = "success" ]; then
SUCCESSFUL_AGENTS+=("$i")
fi
fi
fi
done
echo "Found ${#SUCCESSFUL_AGENTS[@]} successful builds"
if [ ${#SUCCESSFUL_AGENTS[@]} -eq 0 ]; then
echo "❌ No successful builds to benchmark"
exit 1
fi
# Run benchmarks (using the skill)
optim-benchmark $N_AGENTS $SESSION_ID $REPEAT_COUNT $COOLDOWN "$FILTER"
echo "✓ Benchmarks complete"
echo ""
```
## Phase 4: Anti-Triche + Report
```bash
echo "[4/4] 🔍 Running anti-triche and generating report..."
# Anti-triche
optim-antitriche $N_AGENTS $SESSION_ID
echo "✓ Anti-triche complete"
# Generate report
optim-report $N_AGENTS $SESSION_ID
echo ""
echo "╔══════════════════════════════════════════════════════════╗"
echo "║ PIPELINE COMPLETE 🎉 ║"
echo "╚══════════════════════════════════════════════════════════╝"
echo ""
echo "Results: $SESSION_LOG_DIR"
echo "Report: $SESSION_LOG_DIR/optimization_report_*.md"
echo ""
```
## Return Format
```json
{
"pipeline": "full_automation",
"session_id": "$SESSION_ID",
"n_agents": $N_AGENTS,
"completed": $COMPLETED,
"successful_builds": ${#SUCCESSFUL_AGENTS[@]},
"session_dir": "$SESSION_LOG_DIR",
"report_path": "$SESSION_LOG_DIR/optimization_report_*.md"
}
```
## Key Improvements
1. **Single command** - All phases run automatically
2. **Smart monitoring** - 10s checks, 60s progress updates, early abort on failures
3. **Successful-only benchmarks** - Only benchmark agents that built successfully
4. **Clean output** - Progress bar instead of spam
Return ONLY the final JSON summary.Related Skills
u06740-skill-gap-diagnosis-for-scientific-publishing-pipelines
Operate the "Skill Gap Diagnosis for scientific publishing pipelines" capability in production for scientific publishing pipelines workflows. Use when mission execution explicitly requires this capability and outcomes must be reproducible, policy-gated, and handoff-ready.
u0538-engineering-memory-consolidation-pipeline
Operate the "Engineering Memory Consolidation Pipeline" capability in production for workflows. Use when mission execution explicitly requires this capability and outcomes must be reproducible, policy-gated, and handoff-ready.
setup-cicd-pipeline-workflow
Automated CI/CD pipeline setup for Urbit ship deployments, OTA updates, and infrastructure-as-code workflows
Run CI/CD Pipeline Locally
Run the Wavecraft CI checks locally. Prefer the native `cargo xtask` commands for speed; use Docker + `act` only when validating GitHub Actions workflows or Linux-specific behavior.
pipeline-setup
Set up a repository for the agent pipeline. Auto-detects framework, stack, and directory structure, then writes the Pipeline Configuration section into the conventions file.
pipeline-monitor
Track build success rates and identify flaky tests from CI logs
pipeline-crm-automation
Automate Pipeline CRM tasks via Rube MCP (Composio). Always search tools first for current schemas.
mirror-optimizer
当用户明确要求"优化镜像源"、"配置国内镜像"、"加速部署"、"切换镜像源"或项目涉及 Docker/Python/Node.js/Go/Java/Ruby/Rust 等需要包管理器的场景时使用。自动检测项目使用的包管理器,生成适配的国内镜像源配置,确保在国内网络环境下快速部署。⚠️ 不适用:用户只是想了解镜像源概念(应直接说明)、项目已完成部署且无需优化(应直接告知无需操作)、用户明确要求使用官方源(应尊重用户选择)。
fenrir-ledger-pipeline
Kanban orchestration pipeline for the Fenrir Ledger team. Runs all 4 agents in the defined workflow: Product Owner + UX Designer collaborate → Principal Engineer designs and implements → QA Tester validates with idempotent scripts. Use this skill to execute a full feature cycle, process a product brief, or run the complete team workflow.
dockerfile-optimization
Optimize Dockerfiles for smaller images, faster builds, better caching, and security. Use this skill when writing, reviewing, or debugging Dockerfiles.
docker-optimize
Audit and optimize Dockerfiles and docker-compose files for size, security, build speed, and best practices. Triggers on: optimize dockerfile, audit docker, fix dockerfile, docker best practices, docker compose security.
deployment-pipeline-design
Design multi-stage CI/CD pipelines with approval gates, security checks, and deployment orchestration. Use when architecting deployment workflows, setting up continuous delivery, or implementing GitOps practices.