Token导航 LogoToken导航

Agent Skill · 开发

torch-tensor-parallelism(火炬张量并行性)

torch-tensor-parallelism 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

torch-tensor-parallelism 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证为 MIT,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 13,470。

总安装 897周安装 37GitHub Stars 93下载 293核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:torch-tensor-parallelism(火炬张量并行性)
来源仓库:https://github.com/letta-ai/skills
仓库路径:skills/torch-tensor-parallelism
安装命令:
npx skills add https://github.com/letta-ai/skills --skill torch-tensor-parallelism
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/letta-ai/skills --skill torch-tensor-parallelism

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

torch-tensor-parallelism 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合整理项目协作相关内容。适用于围绕仓库状态、代码变更或协作事项进行信息归纳的场景。通过 npx skills add 命令从指定 GitHub 仓库安装并使用。

安装前需确认权限范围、维护状态及是否触发联网或文件操作。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/torch-tensor-parallelism

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/letta-ai/skills --skill torch-tensor-paralleli…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

torch-tensor-parallelism 怎么安装?

在终端执行 npx skills add https://github.com/letta-ai/skills --skill torch-tensor-parallelism。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

torch-tensor-parallelism 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

torch-tensor-parallelism 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

torch-tensor-parallelism 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

torch-tensor-parallelism 用的人多吗?

公开数据是累计安装 897 次,近一周安装 37 次,下载 293 次,GitHub 93 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

torch-tensor-parallelism 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
torch-tensor-parallelism

火炬张量并行性 · 本页

89793只读MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Tensor Parallelism Implementation Guide

This skill provides guidance for implementing tensor parallelism patterns in PyTorch, specifically for ColumnParallelLinear and RowParallelLinear layers that distribute computation across multiple devices.

Core Concepts

Tensor Parallelism Overview

Tensor parallelism splits individual layers across multiple devices to parallelize computation within a single forward/backward pass. The two primary patterns are:

  1. ColumnParallelLinear: Shards weights along the output dimension (columns). Each device computes a portion of the output features, then results are concatenated via all-gather.
  2. RowParallelLinear: Shards weights along the input dimension (rows). Each device computes partial outputs using its shard of the input, then results are summed via all-reduce.

Critical Implementation Requirement

When implementing tensor parallelism (especially in simulation or testing contexts), the forward pass must actually perform the collective operations, not just compute local shards:

  • ColumnParallelLinear: Must concatenate outputs from all ranks (all-gather semantics)
  • RowParallelLinear: Must sum outputs from all ranks (all-reduce semantics)

A common mistake is returning only the local shard and expecting an external framework to handle collective operations. Unless explicitly specified otherwise, the implementation should produce the final, complete output.

Implementation Approach

Step 1: Understand the Parallelism Pattern

Before implementing, clearly identify:

  1. Which dimension is being sharded (input features vs output features)
  2. What collective operation combines the results (all-gather vs all-reduce)
  3. Whether the implementation should simulate distributed execution or prepare for actual distributed execution
  4. How bias should be handled in the parallel context

Step 2: Weight Sharding

For weight matrix W of shape (out_features, in_features):

ColumnParallelLinear:

  • Shard W along dim=0 (output features)
  • Each rank gets W_shard of shape (out_features // world_size, in_features)
  • Output shape per rank: (batch, out_features // world_size)

RowParallelLinear:

  • Shard W along dim=1 (input features)
  • Each rank gets W_shard of shape (out_features, in_features // world_size)
  • Input to each rank should be corresponding shard of input
  • Output shape per rank: (batch, out_features) - partial sum

Step 3: Forward Pass Implementation

ColumnParallelLinear Forward:

1. Compute local output: y_local = x @ W_shard.T + bias_shard (if bias per shard)
2. All-gather to concatenate: y = concat([y_0, y_1, ..., y_n], dim=-1)
3. Return complete output of shape (batch, out_features)

RowParallelLinear Forward:

1. Get input shard: x_shard = x[..., start:end] for this rank
2. Compute partial output: y_partial = x_shard @ W_shard.T
3. All-reduce to sum: y = sum([y_0, y_1, ..., y_n])
4. Add bias (only once, not per-rank): y = y + bias
5. Return complete output of shape (batch, out_features)

Step 4: Bias Handling

ColumnParallelLinear:

  • Bias can be sharded along with output features
  • Each rank adds its bias shard to its output shard
  • After all-gather, the full bias has been applied

RowParallelLinear:

  • Bias must NOT be sharded or added per-rank (would cause N-fold bias)
  • Add bias only once after the all-reduce operation
  • Typically only rank 0 adds bias, OR add bias after the sum

Verification Strategies

Mathematical Verification

When local testing is unavailable, verify implementation correctness through mathematical analysis:

  1. Simple example: Use a 2x4 weight matrix with world_size=2
  2. Trace computation: Manually compute what each rank produces
  3. Verify combination: Confirm all-gather/all-reduce produces correct final output
  4. Compare to baseline: Verify parallel output matches non-parallel computation

Shape Verification Checklist

  • Input shape matches expected (batch, in_features)
  • Weight shard shape matches expected partitioning
  • Local output shape is correct for the parallelism type
  • Final output shape matches (batch, out_features) - NOT the sharded dimension

Test Cases to Consider

  1. world_size=1: Trivial case, should match non-parallel implementation exactly
  2. world_size=2,4,8: Common parallel configurations
  3. Non-divisible dimensions: What happens when out_features % world_size!= 0?
  4. Different batch sizes: Verify batch dimension is handled correctly
  5. With and without bias: Test both configurations

Common Pitfalls

Pitfall 1: Returning Local Shards Only

Symptom: Output tensor size is (out_features / world_size) instead of (out_features)

Cause: Implementation computes local shard but doesn't perform all-gather

Fix: Implement the collective operation to combine results from all ranks

Pitfall 2: Incorrect Bias Handling in RowParallelLinear

Symptom: Output values are N times larger than expected (where N is world_size)

Cause: Each rank adds the full bias, then values are summed

Fix: Add bias only once after all-reduce, not per-rank

Pitfall 3: Misinterpreting "Simulation" Requirements

Symptom: Implementation works for world_size=1 but fails for larger world sizes

Cause: Assuming external framework handles collective operations

Fix: Read requirements carefully - "as if using all_gather" means implement the operation

Pitfall 4: Truncated File Writes

Symptom: Implementation has syntax errors or missing code

Cause: File write operation was truncated

Fix: Always read back the complete file after writing to verify integrity

Pitfall 5: Wrong Dimension for Sharding

Symptom: Shape mismatch errors during matrix multiplication

Cause: Sharding along wrong dimension (rows vs columns confusion)

Fix: ColumnParallel shards output features (dim=0 of weight), RowParallel shards input features (dim=1 of weight)

Pre-Implementation Checklist

Before writing code, confirm understanding of:

  • Which collective operation is needed (all-gather vs all-reduce)
  • What the final output shape should be
  • Whether simulation should actually perform collective ops or defer them
  • How bias should be handled for this parallelism type
  • What happens for edge cases (world_size=1, non-divisible dimensions)

Post-Implementation Checklist

After writing code:

  • Read back the complete implementation file to verify no truncation
  • Verify output shapes match expected dimensions for all world sizes
  • Trace through a simple example manually to verify correctness
  • Test trivial case (world_size=1) matches non-parallel baseline
  • Test at least one non-trivial case (world_size=2 or 4)

平台分布

Claude Code

26.68%
按下载量换算78

Gemini CLI

23.05%
按下载量换算68

Codex

18.65%
按下载量换算55

Antigravity

13.04%
按下载量换算38

OpenCode

8.04%
按下载量换算24

windsurf

3.18%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills