已合并
1.fix warning log 2.fix SetScheduleMode #862
guijianwei创建于 1月21日
1.fix warning log 2.fix SetScheduleMode #862
已合并
共 2 个文件变更+2-1
| @@ -105,7 +105,6 @@ extern "C" __global__ __aicore__ void gelu_quant( | |||
| 105 | GM_ADDR x, GM_ADDR input_scale, GM_ADDR input_offset, GM_ADDR y, GM_ADDR out_scale, GM_ADDR workspace, | 105 | GM_ADDR x, GM_ADDR input_scale, GM_ADDR input_offset, GM_ADDR y, GM_ADDR out_scale, GM_ADDR workspace, |
| 106 | GM_ADDR tiling_data) | 106 | GM_ADDR tiling_data) |
| 107 | { | 107 | { |
| 108 | - SetSysWorkspace(workspace); | ||
| 109 | GM_ADDR userWS = GetUserWorkspace(workspace); | 108 | GM_ADDR userWS = GetUserWorkspace(workspace); |
| 110 | GET_TILING_DATA(tilingData, tiling_data); | 109 | GET_TILING_DATA(tilingData, tiling_data); |
| 111 | 110 | ||
| @@ -22,6 +22,7 @@ constexpr uint32_t BLOCK_SIZE = 32; | |||
| 22 | constexpr uint32_t L2_CACHE_LINE_SIZE = 512; // pack unit in cache 512B | 22 | constexpr uint32_t L2_CACHE_LINE_SIZE = 512; // pack unit in cache 512B |
| 23 | 23 | ||
| 24 | constexpr uint32_t SINGLE_UB_SIZE = 25; | 24 | constexpr uint32_t SINGLE_UB_SIZE = 25; |
| 25 | +constexpr uint32_t BATCH_MODE = 1; | ||
| 25 | 26 | ||
| 26 | static std::map<const ge::DataType, const uint32_t> x_dTypeLen = { { ge::DT_FLOAT16, 2 }, | 27 | static std::map<const ge::DataType, const uint32_t> x_dTypeLen = { { ge::DT_FLOAT16, 2 }, |
| 27 | { ge::DT_BF16, 2 }, | 28 | { ge::DT_BF16, 2 }, |
| @@ -94,6 +95,7 @@ ge::graphStatus GetTillingData(gert::TilingContext *context, SwiGluQuantCompileI | |||
| 94 | static ge::graphStatus Tiling4SwiGluQuant(gert::TilingContext *context) | 95 | static ge::graphStatus Tiling4SwiGluQuant(gert::TilingContext *context) |
| 95 | { | 96 | { |
| 96 | OP_LOGD(context, "Tiling4SwiGluQuant start."); | 97 | OP_LOGD(context, "Tiling4SwiGluQuant start."); |
| 98 | + context->SetScheduleMode(BATCH_MODE); | ||
| 97 | SwiGluQuantCompileInfo compileInfo; | 99 | SwiGluQuantCompileInfo compileInfo; |
| 98 | SwiGluQuantTilingParam tilingParam; | 100 | SwiGluQuantTilingParam tilingParam; |
| 99 | SwiGluQuantTilingData tilingData; | 101 | SwiGluQuantTilingData tilingData; |
代码可读性与维护性: 常量 BATCH_MODE 的值 1 是一个魔术数字(Magic Number)。虽然它在第98行被用作 context->SetScheduleMode(BATCH_MODE) 的参数,但数字 1 本身没有明确的上下文含义。它可能代表一种特定的调度模式,但仅凭数字 1 无法让阅读者理解其具体含义。
问题类型: 代码可读性与维护性 文件路径:
quant/swi_glu_quant/op_host/swi_glu_quant_tiling.cpp行号: 25 问题代码:constexpr uint32_t BATCH_MODE = 1;修改建议:
此评论由代码审查工具自动生成