[
{
"category": "9.2 Pointwise Ops(108)",
"subcategory": "二元 / 三元 Pointwise 实现族",
"torch_api": "torch.mul",
"cu_file": "BinaryMulKernel.cu",
"usage_scenario": "用于门控激活、缩放 attention score、dropout mask 和逐元素权重调制。"
},
{
"category": "9.4 Comparison Ops(30)",
"subcategory": "比较判定实现族",
"torch_api": "torch.eq",
"cu_file": "CompareEQKernel.cu",
"usage_scenario": "构造 padding mask、eos 判断、token 匹配和准确率统计。"
},
{
"category": "5.2 Random Sampling(11)",
"subcategory": "随机采样与分布实现族",
"torch_api": "torch.randn",
"cu_file": "DistributionNormal.cu",
"usage_scenario": "用于参数初始化、dropout 随机噪声、扩散类模型或训练扰动。"
},
{
"category": "9.6 Other Operations(56)",
"subcategory": "前缀扫描与累计实现族",
"torch_api": "torch.cumsum",
"cu_file": "CumsumKernel.cu",
"usage_scenario": "构造位置编号、变长序列 offset、attention mask 或 packed batch 边界。"
},
{
"category": "9.3 Reduction Ops(30)",
"subcategory": "归约实现族",
"torch_api": "torch.mean",
"cu_file": "ReduceMomentKernel.cu",
"usage_scenario": "计算 loss 均值、统计归一化所需均值或汇总 batch/sequence 指标。"
},
{
"category": "9.5 Spectral Ops(7)",
"subcategory": "频谱实现族",
"torch_api": "torch.stft",
"cu_file": "SpectralOps.cu",
"usage_scenario": "音频大模型或语音前端中将波形转换为时频特征。"
},
{
"category": "9.6 Other Operations(56)",
"subcategory": "搜索 / 分桶 / 统计实现族",
"torch_api": "torch.searchsorted",
"cu_file": "Bucketization.cu",
"usage_scenario": "top-p 采样、分桶路由、变长序列边界查找等索引定位场景。"
},
{
"category": "9.2 Pointwise Ops(108)",
"subcategory": "二元 / 三元 Pointwise 实现族",
"torch_api": "torch.add",
"cu_file": "PointwiseOpsKernel.cu",
"usage_scenario": "实现残差连接、bias 加法、attention mask 加法和优化器更新。"
},
{
"category": "2.1 Creation Ops(33)",
"subcategory": "工厂 / 填充 / range 实现族",
"torch_api": "torch.arange",
"cu_file": "RangeFactories.cu",
"usage_scenario": "生成位置索引、attention mask、RoPE 位置编码等序列相关张量。"
},
{
"category": "9.8 Foreach Operations(56)",
"subcategory": "Foreach 实现族",
"torch_api": "torch._foreach_sqrt",
"cu_file": "ForeachUnaryOp.cu",
"usage_scenario": "优化器对多组参数执行批量逐元素操作,例如 Adam 二阶矩开方。"
},
{
"category": "9.2 Pointwise Ops(108)",
"subcategory": "一元 Pointwise 实现族",
"torch_api": "torch.rsqrt",
"cu_file": "UnaryOpsKernel.cu",
"usage_scenario": "LayerNorm/RMSNorm 中计算方差或均方根的倒数平方根。"
},
{
"category": "3.1 Indexing, Slicing, Joining, Mutating Ops(51)",
"subcategory": "Scatter / Gather / Advanced Indexing 实现族",
"torch_api": "torch.gather",
"cu_file": "ScatterGatherKernel.cu",
"usage_scenario": "按索引收集 token、专家路由结果或 beam search 候选。"
},
{
"category": "3.1 Indexing, Slicing, Joining, Mutating Ops(51)",
"subcategory": "Shape / 重排 / 拷贝实现族",
"torch_api": "torch.transpose",
"cu_file": "Shape.cu",
"usage_scenario": "切换矩阵乘输入布局,或在多头 attention 中交换 head 与序列维度。"
},
{
"category": "3.1 Indexing, Slicing, Joining, Mutating Ops(51)",
"subcategory": "Shape / 重排 / 拷贝实现族",
"torch_api": "torch.cat",
"cu_file": "Shape.cu",
"usage_scenario": "拼接 KV cache、新生成 token、模型并行分片或中间特征。"
},
{
"category": "3.1 Indexing, Slicing, Joining, Mutating Ops(51)",
"subcategory": "Shape / 重排 / 拷贝实现族",
"torch_api": "torch.reshape",
"cu_file": "TensorShape.cu",
"usage_scenario": "在 attention、MLP 和并行切分中调整 batch、head、sequence 维度。"
},
{
"category": "3.1 Indexing, Slicing, Joining, Mutating Ops(51)",
"subcategory": "Scatter / Gather / Advanced Indexing 实现族",
"torch_api": "torch.index_select",
"cu_file": "Indexing.cu",
"usage_scenario": "从 embedding 表、KV cache 或 batch 维度中按索引选择数据。"
},
{
"category": "5.2 Random Sampling(11)",
"subcategory": "随机采样与分布实现族",
"torch_api": "torch.multinomial",
"cu_file": "MultinomialKernel.cu",
"usage_scenario": "推理阶段按 token 概率分布采样,常见于 top-k/top-p 解码。"
},
{
"category": "9.2 Pointwise Ops(108)",
"subcategory": "一元 Pointwise 实现族",
"torch_api": "torch.softmax",
"cu_file": "SoftMax.cu",
"usage_scenario": "attention 权重归一化,以及输出 logits 转 token 概率分布。"
},
{
"category": "9.4 Comparison Ops(30)",
"subcategory": "排序与选择实现族",
"torch_api": "torch.topk",
"cu_file": "TensorTopK.cu",
"usage_scenario": "推理采样中筛选最高概率 token,或做 beam search 候选裁剪。"
},
{
"category": "9.7 BLAS and LAPACK Operations(40)",
"subcategory": "线性代数 / BLAS / Solver 实现族",
"torch_api": "torch.bmm",
"cu_file": "GroupMM.cu",
"usage_scenario": "批量矩阵乘,常用于 QK^T attention score、AV 聚合和批量投影。"
}
]