Agent Skills › DexForce/EmbodiChain › implement-performance

implement-performance

GitHub

用于分析和实现高性能计算逻辑,涵盖算法复杂度、内存布局及同步优化。适用于新计算能力开发或对现有代码进行性能敏感的重构与改进。

.agents/skills/implement-performance/SKILL.md DexForce/EmbodiChain

Trigger Scenarios

识别出算法复杂度问题 涉及数据布局和内存使用优化 需要批处理或同步成本分析 实现新的计算能力 对现有代码进行性能敏感修改

Install

npx skills add DexForce/EmbodiChain --skill implement-performance -g -y
More Options

Non-standard path

npx skills add https://github.com/DexForce/EmbodiChain/tree/main/.agents/skills/implement-performance -g -y

Use without installing

npx skills use DexForce/EmbodiChain@implement-performance

指定 Agent (Claude Code)

npx skills add DexForce/EmbodiChain --skill implement-performance -a claude-code -g -y

安装 repo 全部 skill

npx skills add DexForce/EmbodiChain --all -g -y

预览 repo 内 skill

npx skills add DexForce/EmbodiChain --list

SKILL.md

Frontmatter
{
    "name": "implement-performance",
    "description": "Design and implement EmbodiChain computation when task analysis identifies algorithmic complexity, data layout, batching, memory use or synchronization costs as material. Use for new computational capabilities and performance-sensitive changes to existing code."
}

Implement performance-sensitive computation

Use a systems and HPC engineering perspective once task analysis identifies material computational costs. Scale the work to the affected execution path; ordinary configuration and documentation edits do not need performance analysis.

Establish the workload and cost model

Before choosing an implementation, briefly record the relevant workload, expected bottleneck and design tradeoff in the task update or PR:

  • Identify the caller, call frequency, typical and largest supported shapes, dtype/device, and target hardware. Distinguish latency, throughput and memory goals; account for single-item or small batches when callers use them.
  • For existing behavior, establish a baseline and use focused measurements or profiling to locate the dominant cost. For new behavior, estimate time/space complexity and intermediate storage first, then validate the estimate.
  • Trace the execution path from input preparation to result consumption. Consider compute, memory traffic, allocations, transfers, dispatch and waits. State assumptions when workload or hardware evidence is unavailable; keep performance conclusions limited to what was measured.

Choose the implementation

Prefer the simplest approach that meets the workload and correctness contracts. Consider algorithmic improvements before backend-specific tuning. Choose CPU, Torch, Warp or another existing backend from measured or estimated costs, including dispatch and transfers for the actual batch sizes.

  • Define batch axes, strides and ownership at boundaries. Evaluate contiguous access and broadcast views; account for copies introduced by indexing, reshaping or making inputs contiguous. Keep dtype/device conversion at owned boundaries and avoid repeated host/device round trips.
  • Bound intermediate storage as well as arithmetic. Vectorization can create quadratic pairwise or candidate tensors; use bounded chunks, reductions or direct selection when full materialization is unnecessary. Preserve ordering, masks and selection semantics across chunk boundaries.
  • Inspect loops for repeated allocation, conversion and invariant work. Reuse buffers or cache results when useful, with explicit capacity, invalidation and lifetime. Returned results must retain their documented ownership across later calls; protect reuse across callers, threads and streams.
  • Check device-to-host reads such as .item(), .cpu(), .numpy(), tensor truth tests and data-dependent indexing for transfers or synchronization. Keep device work on the intended stream; establish dependencies and storage lifetimes explicitly when interoperating with Warp or other backends.
  • Account for CPU thread pools and native library threads before adding parallel workers. Bound queues and in-flight work; avoid oversubscription. Introduce fusion, compilation, graph capture or custom kernels when expected gains justify startup cost, shape constraints and maintenance.

Shared numerical algorithms and private Warp kernels follow the ownership in AGENTS.md. Runtime adapters own simulation state, configuration and resource lifecycles. For solver buffer changes, read the IK overview and its linked buffer lifecycle before changing reuse or stream behavior.

Verify behavior and performance

Use add-test for focused production-contract tests. Choose relevant checks for numerical tolerance, failure masks, empty/singleton and partial batches, noncontiguous inputs, dtype/device, determinism and gradients where supported. Buffer or concurrency changes need checks that old results remain valid and intended stream/thread use is safe. Do not change precision, convergence, candidate ordering or success criteria merely to claim a speedup.

Use benchmark for measurement methodology. Compare the baseline and proposed implementation on equivalent inputs and quality settings; include typical sizes and memory stress cases within the supported budget. Separate device computation from transfers and end-to-end execution. Evaluate startup/steady-state or tail latency when the caller depends on them.

Report the chosen design, tested workload/hardware, correctness evidence, latency or throughput and memory tradeoffs, including regressions. Hardware that was unavailable remains unvalidated. Stop adding complexity when the workload's needs are met or measurements do not support further optimization.

Version History

  • 6611467 Current 2026-10-19 21:37

Same Skill Collection

.agents/skills/add-atomic-action/SKILL.md
.agents/skills/add-embodiment-component/SKILL.md
.agents/skills/add-functor/SKILL.md
.agents/skills/add-robot/SKILL.md
.agents/skills/add-semantic-call/SKILL.md
.agents/skills/add-solver/SKILL.md
.agents/skills/add-task-env/SKILL.md
.agents/skills/add-task-program/SKILL.md
.agents/skills/add-test/SKILL.md
.agents/skills/benchmark/SKILL.md
.agents/skills/pr/SKILL.md
.agents/skills/pre-commit-check/SKILL.md
.agents/skills/project-dev-context/SKILL.md
.agents/skills/release/SKILL.md
.agents/skills/review-pr/SKILL.md
.agents/skills/update-api-docs/SKILL.md
.claude/skills/add-atomic-action/SKILL.md
.claude/skills/add-embodiment-component/SKILL.md
.claude/skills/add-functor/SKILL.md
.claude/skills/add-robot/SKILL.md
.claude/skills/add-semantic-call/SKILL.md
.claude/skills/add-solver/SKILL.md
.claude/skills/add-task-env/SKILL.md
.claude/skills/add-task-program/SKILL.md
.claude/skills/add-test/SKILL.md
.claude/skills/benchmark/SKILL.md
.claude/skills/pr/SKILL.md
.claude/skills/pre-commit-check/SKILL.md
.claude/skills/project-dev-context/SKILL.md
.claude/skills/release/SKILL.md
.claude/skills/review-pr/SKILL.md
.claude/skills/update-api-docs/SKILL.md
.claude/skills/implement-performance/SKILL.md

Metadata

Files
0
Version
6611467
Hash
1a77e7c8
Indexed
2026-10-19 21:37

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-23 01:44
浙ICP备14020137号-1