Merged
docs: 修复注释与代码不一致(concat compact 阈值与 transpose 分核说明) #6493
docs: 修复注释与代码不一致(concat compact 阈值与 transpose 分核说明) #6493
Merged
TangPCAdd on 24 days ago
Total: 2 files changed+4-5
@@ -478,7 +478,7 @@ inline static void GenTilingKey(ConcatTilingParam& param)
478 int64_t isInputShapeSame = (shapeSame && !param.isGather && !param.isRowConcat) ? 1 : 2;478 int64_t isInputShapeSame = (shapeSame && !param.isGather && !param.isRowConcat) ? 1 : 2;
479 int64_t isFirstDim = DIGIT_TWO;479 int64_t isFirstDim = DIGIT_TWO;
480 480 
481- // 判断是否可用 compact: 所有 tensor 的 dim1 < UINT32_MAX481+ // 判断是否可用 compact: 所有 tensor 的 dim1 < INT32_MAX
482 bool canCompact = true;482 bool canCompact = true;
483 for (const auto& dim1 : param.tensorListDim1) {483 for (const auto& dim1 : param.tensorListDim1) {
484 if (static_cast<uint64_t>(dim1) >= COMPACT_THRESHOLD) {484 if (static_cast<uint64_t>(dim1) >= COMPACT_THRESHOLD) {
@@ -1121,10 +1121,9 @@ int64_t TransposeNddmaTiling::CalcBlockSplitInfoForNoCutForMultiCore(int64_t i,
1121 * SIMT 模式不经过 UB,每个核直接 GM→GM。分核目标是让每核处理的数据1121 * SIMT 模式不经过 UB,每个核直接 GM→GM。分核目标是让每核处理的数据
1122 * 量对齐 128 字节(SMALL_SHAPE_SPLIT_BYTES_ALIGN_SIZE),避免跨核访问1122 * 量对齐 128 字节(SMALL_SHAPE_SPLIT_BYTES_ALIGN_SIZE),避免跨核访问
1123 * 边界不对齐:1123 * 边界不对齐:
1124- * - 总元素 < coreNum:按元素数开核(每核 1 个元素)1124+ * - 总元素不足 128B 对齐量或不足 coreNum:只使用 1 核
1125- * - 否则:先取 ceil(向上对齐 128B)与 floor(向下对齐 128B)两个候选,1125+ * - 否则:按 128B 向上对齐后的块长 ceilAlignFactor 开核,
1126- * 若 floor×核数仍能容纳全部数据则直接开满核,否则用 ceil 对齐后的核数1126+ * 核数 = CeilDiv(totalElements, ceilAlignFactor)
1127- * (ceilAlignFactor 比 floor 大 → 实际核数略少但每核数据对齐)
1128 */1127 */
1129void TransposeNddmaTiling::CalcBlockSplitInfoForSmallShape()1128void TransposeNddmaTiling::CalcBlockSplitInfoForSmallShape()
1130{1129{