tensor-plan-optimizer

tensor-plan-optimizer is a skill for Codex from patrick-toulme/harnessgym. It costs 72 tokens per session (1,672 once invoked), scanned A, original, Apache-2.0.

A tool for tuning tensor-layout plans for GPU or accelerator benchmark tasks, where the goal is to reduce the measured number of execution cycles.

In plain words
What is it for?
Use it to validate plans, inspect performance traces, search nearby layout changes, benchmark candidates, compare history, and apply the best result.
Why use it?
It helps analyze why a plan is slow and compare safe changes against previous experiments instead of guessing.

Skill for Codex

Written for Codex: runs codex exec. Also seen: mentions Codex.

Good fit Use it to validate plans, inspect performance traces, search nearby layout changes, benchmark candidates, compare history, and apply the best result.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/patrick-toulme/harnessgym/tensor-plan-optimizer
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add patrick-toulme/harnessgym --skill tensor-plan-optimizer
Clone the repo
git clone --depth 1 https://github.com/patrick-toulme/harnessgym

Made for: Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tensor-plan-optimizer

README.md
[![agentmods](https://agentmods.dev/badge/skills/patrick-toulme/harnessgym/tensor-plan-optimizer.svg)](https://agentmods.dev/skills/patrick-toulme/harnessgym/tensor-plan-optimizer)
Your own site
<a href="https://agentmods.dev/skills/patrick-toulme/harnessgym/tensor-plan-optimizer"><img src="https://agentmods.dev/badge/skills/patrick-toulme/harnessgym/tensor-plan-optimizer.svg" alt="Measured on agentmods" height="20"></a>
Per session 72 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,672 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00072 $0.01672
Opus 5 $0.00036 $0.00836
Sonnet 5 $0.00014 $0.00334
Haiku 4.5 $0.00007 $0.00167

Measured 7d ago against content hash 1be220e29d9b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

tensor-plan-optimizer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

examples/tensor_layout_harness_artifacts/.harnessgym/skills/tensor-plan-optimizer/SKILL.md · 94 lines

How it starts

The opening of the file, as written. The whole thing — 94 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Tensor Plan Optimizer

Use the MCP suite first:

  • Manifest: .harnessgym/mcp/tensor-plan-server/harnessgym-mcp.json
  • Server: .harnessgym/mcp/tensor-plan-server/tensor_plan_server.py
  • Smoke test: python3 .harnessgym/mcp/tensor-plan-server/tensor_plan_server.py --self-test
  • Codex exec helper: python3 .harnessgym/runtime/mcp_call.py --server tensor-plan-server --tool run_objective --arguments '{"mode":"dev"}'

For Codex exec, use the workspace-local helper above if native MCP tools are not visible. Do not write a one-off JSON-RPC client or launch the server directly; the helper calls through HarnessGym telemetry so the run records real generated-tool usage in .harnessgym/mcp_calls.jsonl.

Workflow

  1. Call run_objective in dev mode to confirm the current score.
  2. Call trace_summary on the current plan to identify bank conflicts, DMA penalties, spill pressure, scratchpad pressure, and synergies.
  3. Call resume_search_history to find the best fixtures/history seeds before repeating any sweep.
  4. Call local_neighborhood_search with strategy=checkpoint around the current best fixture or plan. This covers single, pair, and bounded grid mutations and is the fastest way to reproduce the iteration-2 local-search win.
  5. Call bounded_exhaustive_search with profile="iteration3_dev_core" and, if time permits, profile="iteration3_layout_relaxed". These profiles encode the manual iteration-3 sweeps that found no better dev plan than the iteration-2 fixture while checking dev winners against final mode.
  6. Call search_plans with strategy=quick for broader randomized exploration. Use strategy=focused only when there is time for a broader deterministic sweep around the best discovered region.
  7. Call candidate_diff and benchmark_plan with modes=["dev","final"] for promising candidates. dev is the fast objective; final is the authoritative held-out comparison.
  8. Call apply_best_verified or apply_candidate with dry_run=true first. Only use dry_run=false after the candidate improves dev, passes final, and preserves correctness.
  9. Call export_candidate_fixture for a verified improvement that should seed the next attempt.
  10. Call compare_history before final reporting so the best explored candidate is not lost.

Read the full file on GitHub · 94 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 94 lines · 72 tokens per session scan A 1be220e29d9b

Subscribe to this mod's changes

tensor-plan-optimizer is a skill published in the GitHub repository patrick-toulme/harnessgym (41 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 72 tokens to every session and 1,672 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

dataset-evaluation

Validates dataset formatting and quality for SageMaker model fine-tuning (SFT, DPO, or RLVR). Use when the user says "is my dataset okay", "evaluate my data", "check my training data", "I have my own data", or before starting any fine-tuning job. Detects file format, checks schema compliance against the selected model…

awslabs/agent-plugins · 93 tokens

llm-evaluation

LLM evaluation and testing patterns including prompt testing, hallucination detection, benchmark creation, and quality metrics. Use when testing LLM applications, validating prompt quality, implementing systematic evaluation, or measuring LLM performance.

stefan-jansen/claude-code-toolkit · 47 tokens

data-quality-frameworks

Implement data quality validation with Great Expectations, dbt tests, and data contracts. Use when building data quality pipelines, implementing validation rules, or establishing data contracts.

wshobson/agents · 37 tokens

dbt-transformation-patterns

Master dbt (data build tool) for analytics engineering with model organization, testing, documentation, and incremental strategies. Use when building data transformations, creating data models, or implementing analytics engineering best practices.

wshobson/agents · 47 tokens

nemo-automodel-model-onboarding

Guide for onboarding new model architectures into NeMo AutoModel, including architecture discovery, implementation patterns, registration, and validation.

NVIDIA/skills · 33 tokens

nemo-automodel-recipe-development

Create and modify NeMo AutoModel training and evaluation recipes, including YAML structure, builders, and execution flow.

NVIDIA/skills · 31 tokens