已合并
refactor(matmul): unify Tensor API kernels and tune QBMM tiling #9970
ddssz创建于 9月7日
refactor(matmul): unify Tensor API kernels and tune QBMM tiling #9970
已合并
ddssz创建于 9月7日
共 41 个文件变更+1339-980
@@ -26,41 +26,6 @@ if ((UT_TEST_ALL OR OP_KERNEL_UT) AND NOT UT_DONE)
26 MULTI_KERNEL_TARGET26 MULTI_KERNEL_TARGET
27 )27 )
28 28 
29- set(QBMIIA_UT_CMCT_BLOCK_HEADER "${CMAKE_BINARY_DIR}/tbe/ascendc/common/cmct/block/block_mmad_a8w8_fixpipe_quant.h")
30- set(QBMIIA_UT_CMCT_BLOCK_SRC "${PROJECT_SOURCE_DIR}/matmul/common/cmct/block/block_mmad_a8w8_fixpipe_quant.h")
31- set(QBMIIA_UT_CMCT_MX_BLOCK_HEADER "${CMAKE_BINARY_DIR}/tbe/ascendc/common/cmct/block/block_mmad_mx.h")
32- set(QBMIIA_UT_CMCT_MX_BLOCK_SRC "${PROJECT_SOURCE_DIR}/matmul/common/cmct/block/block_mmad_mx.h")
33- 
34- if(TARGET ascendc_kernel_ut_src_copy_quant_batch_matmul_inplace_add)
35- add_custom_command(
36- OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/qbmmia_cmct_block_patched.stamp"
37- VERBATIM
38- COMMAND ${CMAKE_COMMAND} -E copy "${QBMIIA_UT_CMCT_BLOCK_SRC}" "${QBMIIA_UT_CMCT_BLOCK_HEADER}"
39- COMMAND bash -c "sed -i 's|AscendC::LocalTensor<L0CType> c1Local_{AscendC::TPosition::CO1, 0, AscendC::TOTAL_L0C_SIZE};|AscendC::LocalTensor<L0CType> c1Local_{AscendC::TPosition::CO1, 0, 65536U / sizeof(L0CType)};|' \"$1\"" -- "${QBMIIA_UT_CMCT_BLOCK_HEADER}"
40- COMMAND bash -c "sed -i 's|AscendC::LocalTensor<BiasType> biasBt_{AscendC::TPosition::C2, 0, BT_SIZE};|AscendC::LocalTensor<BiasType> biasBt_{AscendC::TPosition::C2, 0, 1024U};|' \"$1\"" -- "${QBMIIA_UT_CMCT_BLOCK_HEADER}"
41- COMMAND ${CMAKE_COMMAND} -E copy "${QBMIIA_UT_CMCT_MX_BLOCK_SRC}" "${QBMIIA_UT_CMCT_MX_BLOCK_HEADER}"
42- COMMAND bash -c "sed -i 's|AscendC::LocalTensor<float> c1Local_{AscendC::TPosition::CO1, 0, AscendC::TOTAL_L0C_SIZE};|AscendC::LocalTensor<float> c1Local_{AscendC::TPosition::CO1, 0, AscendC::TOTAL_L0C_SIZE / sizeof(float)};|' \"$1\"" -- "${QBMIIA_UT_CMCT_MX_BLOCK_HEADER}"
43- COMMAND bash -c "sed -i 's|AscendC::LocalTensor<float> biasBt_{AscendC::TPosition::C2, 0, BT_SIZE};|AscendC::LocalTensor<float> biasBt_{AscendC::TPosition::C2, 0, 1024U};|' \"$1\"" -- "${QBMIIA_UT_CMCT_MX_BLOCK_HEADER}"
44- COMMAND ${CMAKE_COMMAND} -E touch "${CMAKE_CURRENT_BINARY_DIR}/qbmmia_cmct_block_patched.stamp"
45- DEPENDS ascendc_kernel_ut_src_copy_quant_batch_matmul_inplace_add
46- "${QBMIIA_UT_CMCT_BLOCK_SRC}"
47- "${QBMIIA_UT_CMCT_MX_BLOCK_SRC}"
48- COMMENT "Patch CMCT block header for QuantBatchMatmulInplaceAdd kernel UT"
49- )
50- add_custom_target(qbmmia_cmct_block_ut_patch DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/qbmmia_cmct_block_patched.stamp")
51- endif()
52- 
53- foreach(_qbmmia_ut_target
54- opkernel_test_quant_batch_matmul_inplace_add
55- opkernel_test_quant_batch_matmul_inplace_add_apt_hif8
56- opkernel_test_quant_batch_matmul_inplace_add_apt_mx)
57- if(TARGET ${_qbmmia_ut_target})
58- if(TARGET qbmmia_cmct_block_ut_patch)
59- add_dependencies(${_qbmmia_ut_target} qbmmia_cmct_block_ut_patch)
60- endif()
61- endif()
62- endforeach()
63- 
64 add_custom_target(qbmmia_ut_clean_gcda29 add_custom_target(qbmmia_ut_clean_gcda
65 COMMAND ${CMAKE_COMMAND} -E rm -f30 COMMAND ${CMAKE_COMMAND} -E rm -f
66 "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/opkernel_test_quant_batch_matmul_inplace_add.dir/arch35/test_quant_batch_matmul_inplace_add.cpp.gcda"31 "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/opkernel_test_quant_batch_matmul_inplace_add.dir/arch35/test_quant_batch_matmul_inplace_add.cpp.gcda"
@@ -27,24 +27,28 @@ const std::vector<int32_t> supportedNpuArch = {static_cast<int32_t>(NpuArch::DAV
27namespace optiling {27namespace optiling {
28 28 
29QuantBatchMatmulInplaceAddCubeBasicAPITiling::QuantBatchMatmulInplaceAddCubeBasicAPITiling(gert::TilingContext* context)29QuantBatchMatmulInplaceAddCubeBasicAPITiling::QuantBatchMatmulInplaceAddCubeBasicAPITiling(gert::TilingContext* context)
30- : QuantBatchMatmulInplaceAddHelper<AdaptiveSlidingWindowCubeBasicAPITiling>(context), tilingData_(tilingDataSelf_)30+ : QuantBatchMatmulInplaceAddHelper<AdaptiveSlidingWindowCubeBasicAPITiling>(context)
31{31{
32 Reset();32 Reset();
33}33}
34 34 
35-void QuantBatchMatmulInplaceAddCubeBasicAPITiling::Reset() { ResetInplaceTilingData(tilingData_); }35+void QuantBatchMatmulInplaceAddCubeBasicAPITiling::Reset()
36+{
37+ ResetInplaceTilingData(withoutBatchTilingData_);
38+ tilingDataSize_ = sizeof(QMMIA::QbmmiaWithoutBatchTilingData);
39+}
36 40 
37bool QuantBatchMatmulInplaceAddCubeBasicAPITiling::IsCapable()41bool QuantBatchMatmulInplaceAddCubeBasicAPITiling::IsCapable()
38{42{
39 return IsHiFloat8TTQuant() && AdaptiveSlidingWindowCubeBasicAPITiling::IsCapable();43 return IsHiFloat8TTQuant() && AdaptiveSlidingWindowCubeBasicAPITiling::IsCapable();
40}44}
41 45 
42-const void* QuantBatchMatmulInplaceAddCubeBasicAPITiling::GetTilingData() const { return &tilingData_; }46+const void* QuantBatchMatmulInplaceAddCubeBasicAPITiling::GetTilingData() const { return &withoutBatchTilingData_; }
43 47 
44void QuantBatchMatmulInplaceAddCubeBasicAPITiling::SetTilingData()48void QuantBatchMatmulInplaceAddCubeBasicAPITiling::SetTilingData()
45{49{
46 AdaptiveSlidingWindowCubeBasicAPITiling::SetTilingData();50 AdaptiveSlidingWindowCubeBasicAPITiling::SetTilingData();
47- CopyV3BasicApiTilingData(AdaptiveSlidingWindowCubeBasicAPITiling::tilingData_, tilingData_);51+ UpdateTilingData();
48}52}
49 53 
50ge::graphStatus QuantBatchMatmulInplaceAddCubeBasicAPITiling::DoLibApiTiling()54ge::graphStatus QuantBatchMatmulInplaceAddCubeBasicAPITiling::DoLibApiTiling()
@@ -53,13 +57,21 @@ ge::graphStatus QuantBatchMatmulInplaceAddCubeBasicAPITiling::DoLibApiTiling()
53 if (ret != ge::GRAPH_SUCCESS) {57 if (ret != ge::GRAPH_SUCCESS) {
54 return ret;58 return ret;
55 }59 }
56- CopyV3BasicApiTilingData(AdaptiveSlidingWindowCubeBasicAPITiling::tilingData_, tilingData_);60+ UpdateTilingData();
57 return ge::GRAPH_SUCCESS;61 return ge::GRAPH_SUCCESS;
58}62}
59 63 
60uint64_t QuantBatchMatmulInplaceAddCubeBasicAPITiling::GetKernelType() const64uint64_t QuantBatchMatmulInplaceAddCubeBasicAPITiling::GetKernelType() const
61{65{
62- return isAFullLoad_ ? TPL_NO_VEC_EPILOGUE_CUSTOM_GMTOAL1_WITH_MMAPI : TPL_NO_VEC_EPILOGUE_WITH_MMAPI;66+ return isAFullLoad_ ? TPL_NO_VEC_EPILOGUE_CUSTOM_GMTOAL1_WITH_MMAPI_WITHOUT_BATCH :
67+ TPL_NO_VEC_EPILOGUE_WITH_MMAPI_WITHOUT_BATCH;
68+}
69+ 
70+void QuantBatchMatmulInplaceAddCubeBasicAPITiling::UpdateTilingData()
71+{
72+ CopyV3WithoutBatchTilingData(AdaptiveSlidingWindowCubeBasicAPITiling::withoutBatchTilingData_,
73+ withoutBatchTilingData_);
74+ tilingDataSize_ = sizeof(QMMIA::QbmmiaWithoutBatchTilingData);
63}75}
64 76 
65uint64_t QuantBatchMatmulInplaceAddCubeBasicAPITiling::GetTilingKey() const77uint64_t QuantBatchMatmulInplaceAddCubeBasicAPITiling::GetTilingKey() const
@@ -36,9 +36,9 @@ protected:
36 36 
37private:37private:
38 void Reset();38 void Reset();
39+ void UpdateTilingData();
39 40 
40- QMMIA::QuantBatchMatmulInplaceAddTilingData tilingDataSelf_;41+ QMMIA::QbmmiaWithoutBatchTilingData withoutBatchTilingData_;
41- QMMIA::QuantBatchMatmulInplaceAddTilingData& tilingData_;
42};42};
43 43 
44} // namespace optiling44} // namespace optiling
@@ -39,6 +39,7 @@ public:
39protected:39protected:
40 using BaseT::BaseT;40 using BaseT::BaseT;
41 41 
42+ bool IsTensorApiEnabled() const override { return true; }
Y
Yyangyang01621 天前

本次修改的多个原始版权年份为 2025 的文件未更新为 2025-2026,请按仓库版权头规范统一检查。

likedislike
42 ge::graphStatus GetShapeAttrsInfo() override;43 ge::graphStatus GetShapeAttrsInfo() override;
43 bool AnalyzeAttrs() override;44 bool AnalyzeAttrs() override;
44 bool AnalyzeDtype() override;45 bool AnalyzeDtype() override;
@@ -58,7 +59,9 @@ protected:
58 template <typename TilingData>59 template <typename TilingData>
59 void ResetInplaceTilingData(TilingData& tilingData);60 void ResetInplaceTilingData(TilingData& tilingData);
60 void CopyV3BasicApiTilingData(const DequantBmm::QuantBatchMatmulV3BasicAPITilingData& src,61 void CopyV3BasicApiTilingData(const DequantBmm::QuantBatchMatmulV3BasicAPITilingData& src,
61- QMMIA::QuantBatchMatmulInplaceAddTilingData& dst);62+ QMMIA::QbmmiaTilingData& dst);
63+ void CopyV3WithoutBatchTilingData(const DequantBmm::QuantBatchMatmulV3TensorAPIWithoutBatchTilingData& src,
64+ QMMIA::QbmmiaWithoutBatchTilingData& dst);
62};65};
63 66 
64template <typename BaseT>67template <typename BaseT>
@@ -70,7 +73,7 @@ const char* QuantBatchMatmulInplaceAddHelper<BaseT>::GetDefaultOpName() const
70template <typename BaseT>73template <typename BaseT>
71ge::graphStatus QuantBatchMatmulInplaceAddHelper<BaseT>::GetShapeAttrsInfo()74ge::graphStatus QuantBatchMatmulInplaceAddHelper<BaseT>::GetShapeAttrsInfo()
72{75{
73- this->tilingDataSize_ = sizeof(QMMIA::QuantBatchMatmulInplaceAddTilingData);76+ this->tilingDataSize_ = sizeof(QMMIA::QbmmiaTilingData);
74 return QuantBatchMatmulV3TilingBase::GetShapeAttrsInfo();77 return QuantBatchMatmulV3TilingBase::GetShapeAttrsInfo();
75}78}
76 79 
@@ -414,15 +417,26 @@ void QuantBatchMatmulInplaceAddHelper<BaseT>::ResetInplaceTilingData(TilingData&
414 417 
415template <typename BaseT>418template <typename BaseT>
416void QuantBatchMatmulInplaceAddHelper<BaseT>::CopyV3BasicApiTilingData(419void QuantBatchMatmulInplaceAddHelper<BaseT>::CopyV3BasicApiTilingData(
417- const DequantBmm::QuantBatchMatmulV3BasicAPITilingData& src, QMMIA::QuantBatchMatmulInplaceAddTilingData& dst)420+ const DequantBmm::QuantBatchMatmulV3BasicAPITilingData& src, QMMIA::QbmmiaTilingData& dst)
418{421{
419 static_assert(422 static_assert(
420- sizeof(DequantBmm::QuantBatchMatmulV3BasicAPITilingData) == sizeof(QMMIA::QuantBatchMatmulInplaceAddTilingData),423+ sizeof(DequantBmm::QuantBatchMatmulV3BasicAPITilingData) == sizeof(QMMIA::QbmmiaTilingData),
421 "QuantBatchMatmulInplaceAdd basic-api tiling data must stay layout-compatible with QuantBatchMatmulV3.");424 "QuantBatchMatmulInplaceAdd basic-api tiling data must stay layout-compatible with QuantBatchMatmulV3.");
422 OP_TILING_CHECK(memcpy_s(&dst, sizeof(dst), &src, sizeof(src)) != EOK,425 OP_TILING_CHECK(memcpy_s(&dst, sizeof(dst), &src, sizeof(src)) != EOK,
423 CUBE_INNER_ERR_REPORT(this->inputParams_.opName, "Fail to copy basic-api tiling data"), return);426 CUBE_INNER_ERR_REPORT(this->inputParams_.opName, "Fail to copy basic-api tiling data"), return);
424}427}
425 428 
429+template <typename BaseT>
430+void QuantBatchMatmulInplaceAddHelper<BaseT>::CopyV3WithoutBatchTilingData(
431+ const DequantBmm::QuantBatchMatmulV3TensorAPIWithoutBatchTilingData& src, QMMIA::QbmmiaWithoutBatchTilingData& dst)
432+{
433+ static_assert(sizeof(DequantBmm::QuantBatchMatmulV3TensorAPIWithoutBatchTilingData) == sizeof(dst),
434+ "QuantBatchMatmulInplaceAdd without-batch tiling data must stay layout-compatible with "
435+ "QuantBatchMatmulV3.");
436+ OP_TILING_CHECK(memcpy_s(&dst, sizeof(dst), &src, sizeof(src)) != EOK,
437+ CUBE_INNER_ERR_REPORT(this->inputParams_.opName, "Fail to copy without-batch tiling data"), return);
438+}
439+ 
426} // namespace optiling440} // namespace optiling
427 441 
428#endif442#endif
@@ -34,19 +34,13 @@ QuantBatchMatmulInplaceAddMXBasicAPITiling::QuantBatchMatmulInplaceAddMXBasicAPI
34 34 
35void QuantBatchMatmulInplaceAddMXBasicAPITiling::Reset()35void QuantBatchMatmulInplaceAddMXBasicAPITiling::Reset()
36{36{
37- ResetInplaceTilingData(basicTilingData_);37+ ResetInplaceTilingData(withoutBatchTilingData_);
38- withoutBatchTilingData_ = QMMIA::QuantBatchMatmulInplaceAddTensorAPIWithoutBatchTilingData();38+ tilingDataSize_ = sizeof(QMMIA::QbmmiaWithoutBatchTilingData);
39- useWithoutBatchTilingData_ = false;
40- tilingDataSize_ = sizeof(QMMIA::QuantBatchMatmulInplaceAddTilingData);
41}39}
42 40 
43bool QuantBatchMatmulInplaceAddMXBasicAPITiling::IsCapable() { return IsMxQuant() && inputParams_.batchC == 1UL; }41bool QuantBatchMatmulInplaceAddMXBasicAPITiling::IsCapable() { return IsMxQuant() && inputParams_.batchC == 1UL; }
44 42 
45-const void* QuantBatchMatmulInplaceAddMXBasicAPITiling::GetTilingData() const43+const void* QuantBatchMatmulInplaceAddMXBasicAPITiling::GetTilingData() const { return &withoutBatchTilingData_; }
46-{
47- return useWithoutBatchTilingData_ ? static_cast<const void*>(&withoutBatchTilingData_) :
48- static_cast<const void*>(&basicTilingData_);
49-}
50 44 
51void QuantBatchMatmulInplaceAddMXBasicAPITiling::SetTilingData()45void QuantBatchMatmulInplaceAddMXBasicAPITiling::SetTilingData()
52{46{
@@ -66,11 +60,8 @@ ge::graphStatus QuantBatchMatmulInplaceAddMXBasicAPITiling::DoLibApiTiling()
66 60 
67uint64_t QuantBatchMatmulInplaceAddMXBasicAPITiling::GetKernelType() const61uint64_t QuantBatchMatmulInplaceAddMXBasicAPITiling::GetKernelType() const
68{62{
69- if (IsTensorapiCapable()) {63+ return isAFullLoad_ ? TPL_NO_VEC_EPILOGUE_CUSTOM_GMTOAL1_WITH_MMAPI_WITHOUT_BATCH :
70- return isAFullLoad_ ? TPL_NO_VEC_EPILOGUE_CUSTOM_GMTOAL1_WITH_MMAPI_WITHOUT_BATCH :64+ TPL_NO_VEC_EPILOGUE_WITH_MMAPI_WITHOUT_BATCH;
71- TPL_NO_VEC_EPILOGUE_WITH_MMAPI_WITHOUT_BATCH;
72- }
73- return isAFullLoad_ ? TPL_NO_VEC_EPILOGUE_CUSTOM_GMTOAL1_WITH_MMAPI : TPL_NO_VEC_EPILOGUE_WITH_MMAPI;
74}65}
75 66 
76uint64_t QuantBatchMatmulInplaceAddMXBasicAPITiling::GetTilingKey() const67uint64_t QuantBatchMatmulInplaceAddMXBasicAPITiling::GetTilingKey() const
@@ -84,45 +75,9 @@ REGISTER_TILING_TEMPLATE_WITH_ARCH(QuantBatchMatmulInplaceAdd, QuantBatchMatmulI
84 75 
85void QuantBatchMatmulInplaceAddMXBasicAPITiling::UpdateTilingData()76void QuantBatchMatmulInplaceAddMXBasicAPITiling::UpdateTilingData()
86{77{
87- useWithoutBatchTilingData_ = IsTensorapiCapable();78+ CopyV3WithoutBatchTilingData(AdaptiveSlidingWindowMXBasicAPITiling::withoutBatchTilingData_,
88- if (useWithoutBatchTilingData_) {79+ withoutBatchTilingData_);
89- SetWithoutBatchTilingData();80+ tilingDataSize_ = sizeof(QMMIA::QbmmiaWithoutBatchTilingData);
90- tilingDataSize_ = sizeof(QMMIA::QuantBatchMatmulInplaceAddTensorAPIWithoutBatchTilingData);
91- return;
92- }
93- CopyV3BasicApiTilingData(AdaptiveSlidingWindowMXBasicAPITiling::tilingData_, basicTilingData_);
94- tilingDataSize_ = sizeof(QMMIA::QuantBatchMatmulInplaceAddTilingData);
95-}
96- 
97-void QuantBatchMatmulInplaceAddMXBasicAPITiling::SetWithoutBatchTilingData()
98-{
99- const auto& v3TilingData = AdaptiveSlidingWindowMXBasicAPITiling::tilingData_;
100- const auto& matmulTiling = v3TilingData.matmulTiling;
101- withoutBatchTilingData_.m = static_cast<uint32_t>(inputParams_.mSize);
102- withoutBatchTilingData_.n = static_cast<uint32_t>(inputParams_.nSize);
103- withoutBatchTilingData_.k = static_cast<uint32_t>(inputParams_.kSize);
104- withoutBatchTilingData_.scaleKL1 = matmulTiling.scaleKL1;
105- withoutBatchTilingData_.baseM = static_cast<uint16_t>(basicTiling_.baseM);
106- withoutBatchTilingData_.baseN = static_cast<uint16_t>(basicTiling_.baseN);
107- withoutBatchTilingData_.baseK = static_cast<uint16_t>(basicTiling_.baseK);
108- withoutBatchTilingData_.kAL1 = matmulTiling.kAL1;
109- withoutBatchTilingData_.kBL1 = matmulTiling.kBL1;
110- withoutBatchTilingData_.groupSizeM = static_cast<uint16_t>(inputParams_.groupSizeM);
111- withoutBatchTilingData_.groupSizeN = static_cast<uint16_t>(inputParams_.groupSizeN);
112- withoutBatchTilingData_.groupSizeK = static_cast<uint16_t>(inputParams_.groupSizeK);
113- withoutBatchTilingData_.mTailTile = static_cast<uint16_t>(adaptiveWin_.mTailTile);
114- withoutBatchTilingData_.nTailTile = static_cast<uint16_t>(adaptiveWin_.nTailTile);
115- withoutBatchTilingData_.mBaseTailSplitCnt = static_cast<uint16_t>(adaptiveWin_.mBaseTailSplitCnt);
116- withoutBatchTilingData_.nBaseTailSplitCnt = static_cast<uint16_t>(adaptiveWin_.nBaseTailSplitCnt);
117- withoutBatchTilingData_.mTailMain = static_cast<uint16_t>(adaptiveWin_.mTailMain);
118- withoutBatchTilingData_.nTailMain = static_cast<uint16_t>(adaptiveWin_.nTailMain);
119- withoutBatchTilingData_.x1QuantMode = static_cast<uint8_t>(v3TilingData.params.x1QuantMode);
120- withoutBatchTilingData_.x2QuantMode = static_cast<uint8_t>(v3TilingData.params.x2QuantMode);
121- withoutBatchTilingData_.isBias = matmulTiling.isBias;
122- withoutBatchTilingData_.biasDtype = static_cast<uint8_t>(inputParams_.biasDtype);
123- withoutBatchTilingData_.nBufferNum = matmulTiling.nBufferNum;
124- withoutBatchTilingData_.dbL0C = matmulTiling.dbL0C;
125- withoutBatchTilingData_.weightMustHitL2 = matmulTiling.weightMustHitL2;
126}81}
127 82 
128} // namespace optiling83} // namespace optiling
@@ -37,11 +37,8 @@ protected:
37private:37private:
38 void Reset();38 void Reset();
39 void UpdateTilingData();39 void UpdateTilingData();
40- void SetWithoutBatchTilingData();
41 40 
42- QMMIA::QuantBatchMatmulInplaceAddTilingData basicTilingData_;41+ QMMIA::QbmmiaWithoutBatchTilingData withoutBatchTilingData_;
43- QMMIA::QuantBatchMatmulInplaceAddTensorAPIWithoutBatchTilingData withoutBatchTilingData_;
44- bool useWithoutBatchTilingData_ = false;
45};42};
46 43 
47} // namespace optiling44} // namespace optiling
@@ -1,89 +0,0 @@
1-/**
2- * Copyright (c) 2026 Huawei Technologies Co., Ltd.
3- * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4- * CANN Open Software License Agreement Version 2.0 (the "License").
5- * Please refer to the License for details. You may not use this file except in compliance with the License.
6- * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
7- * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8- * See LICENSE in the root of the software repository for the full text of the License.
9- */
10- 
11-/* !
12- * \file qbmmia_cube_basic_api_cmct.h
13- * \brief HiFloat8 T-T kernel for QuantBatchMatmulInplaceAdd.
14- * Uses BlockMmadA8W8FixpipeQuant for cube-based MMAD with FixPipe dequant.
15- */
16-#pragma once
17-#include "cmct/block/block_mmad_a8w8_fixpipe_quant.h"
18-#include "cmct/block/block_scheduler_policy.h"
19-#include "cmct/block/block_scheduler_utils.h"
20-#include "cmct/epilogue/block_epilogue_empty.h"
21-#include "cmct/kernel/kernel_qbmm_cube.h"
22-using namespace Cmct;
23-using namespace Cmct::Gemm;
24- 
25-template <class A_TYPE, class B_TYPE, class SCALE_TYPE, class C_TYPE, class BIAS_TYPE, class aLayout, class bLayout,
26- class cLayout, uint64_t FULL_LOAD_MODE = 0>
27-__aicore__ inline void QbmmiaCubeBasicApiKernel(GM_ADDR aGM, GM_ADDR bGM, GM_ADDR scale, GM_ADDR perTokenScale,
28- GM_ADDR cGM, const void* tilingData)
29-{
30- using L1TileShape = AscendC::Shape<_0, _0, _0>;
31- using L0TileShape = AscendC::Shape<_0, _0, _0>;
32- 
33- using AType = A_TYPE;
34- using BType = B_TYPE;
35- using BiasType = BIAS_TYPE;
36- using X2ScaleType = SCALE_TYPE;
37- using OutType = C_TYPE;
38- 
39- using BlockEpilogue = Block::BlockEpilogueEmpty;
40- using ProblemShape = MatmulShape;
41- using BlockScheduler = Cmct::Gemm::QuantBatchMatmulV3Scheduler<FULL_LOAD_MODE>;
42- 
43- using DispatchPolicy = MatmulWithScale<AscendC::Shape<_0, _0, _0, _0>, FULL_LOAD_MODE>;
44- using BlockMmad = Block::BlockMmadA8W8FixpipeQuant<DispatchPolicy, L1TileShape, L0TileShape, AType, aLayout, BType,
45- bLayout, OutType, cLayout, BiasType, cLayout, X2ScaleType>;
46- 
47- using MatmulKernel = Cmct::Gemm::Kernel::QuantMmBatchCube<ProblemShape, BlockMmad, BlockEpilogue, BlockScheduler,
48- true>;
49- using Params = typename MatmulKernel::Params;
50- 
51- const QMMIA::QuantBatchMatmulInplaceAddTilingData* quantBmmInplaceAddTilingData_;
52- quantBmmInplaceAddTilingData_ = static_cast<const QMMIA::QuantBatchMatmulInplaceAddTilingData*>(tilingData);
53- const QMMIA::BasicAPICubeTiling& matmulTiling = quantBmmInplaceAddTilingData_->matmulTiling;
54- const QMMIA::SlidingWindowParams& slidingWindowParams = quantBmmInplaceAddTilingData_->adaptiveSlidingWin;
55- 
56- using QBMMTiling = typename MatmulKernel::QBMMTiling;
57- QBMMTiling qbmmParams{quantBmmInplaceAddTilingData_->params.batchA1,
58- quantBmmInplaceAddTilingData_->params.batchA2,
59- quantBmmInplaceAddTilingData_->params.batchA3,
60- quantBmmInplaceAddTilingData_->params.batchA4,
61- quantBmmInplaceAddTilingData_->params.batchB1,
62- quantBmmInplaceAddTilingData_->params.batchB2,
63- quantBmmInplaceAddTilingData_->params.batchB3,
64- quantBmmInplaceAddTilingData_->params.batchB4,
65- quantBmmInplaceAddTilingData_->params.batchC1,
66- quantBmmInplaceAddTilingData_->params.batchC2,
67- quantBmmInplaceAddTilingData_->params.batchC3,
68- quantBmmInplaceAddTilingData_->params.batchC4,
69- quantBmmInplaceAddTilingData_->params.biasThreeDim,
70- quantBmmInplaceAddTilingData_->params.x1QuantMode,
71- quantBmmInplaceAddTilingData_->params.x2QuantMode,
72- matmulTiling.kAL1,
73- matmulTiling.kBL1,
74- matmulTiling.nBufferNum,
75- matmulTiling.baseM,
76- matmulTiling.baseN,
77- matmulTiling.baseK,
78- static_cast<uint32_t>(matmulTiling.isBias),
79- static_cast<uint32_t>(matmulTiling.dbL0C)};
80- Params params = {
81- {matmulTiling.m, matmulTiling.n, matmulTiling.k, quantBmmInplaceAddTilingData_->params.batchC},
82- {aGM, bGM, cGM, nullptr, perTokenScale, scale},
83- {matmulTiling.baseM, matmulTiling.baseN, slidingWindowParams.mTailTile, slidingWindowParams.nTailTile,
84- slidingWindowParams.mBaseTailSplitCnt, slidingWindowParams.nBaseTailSplitCnt, slidingWindowParams.mTailMain,
85- slidingWindowParams.nTailMain},
86- qbmmParams};
87- MatmulKernel qbmm;
88- qbmm(params);
89-}
Rmatmul/quant_batch_matmul_inplace_add/op_kernel/arch35/qbmmia_mx_tensor_api_blaze.h→matmul/quant_batch_matmul_inplace_add/op_kernel/arch35/qbmmia_cube_without_batch_tensor_api_blaze.h+26-28
@@ -9,52 +9,50 @@
9 */9 */
10 10 
11/* !11/* !
12- * \file qbmmia_mx_tensor_api_blaze.h12+ * \file qbmmia_cube_without_batch_tensor_api_blaze.h
13- * \brief13+ * \brief Tensor API entry for single-batch HiFloat8 quantized matmul inplace-add.
14 */14 */
15#pragma once15#pragma once
16+ 
16#include "quant_batch_matmul_inplace_add_tiling_data.h"17#include "quant_batch_matmul_inplace_add_tiling_data.h"
17-#include "blaze/gemm/block/block_scheduler_qbmm.h"
18#include "blaze/epilogue/block/block_epilogue_empty.h"18#include "blaze/epilogue/block/block_epilogue_empty.h"
19-#include "blaze/gemm/block/block_mmad_qbmm_mx.h"19+#include "blaze/gemm/block/block_mmad_a8w8_fixpipe_quant.h"
20-#include "blaze/gemm/kernel/kernel_qbmm_mx.h"20+#include "blaze/gemm/block/block_scheduler_qbmm.h"
21+#include "blaze/gemm/kernel/kernel_universal.h"
22+#include "blaze/gemm/kernel/kernel_qbmm_cube_without_batch.h"
21 23 
22template <class A_TYPE, class B_TYPE, class C_TYPE, class aLayout, class bLayout, class cLayout,24template <class A_TYPE, class B_TYPE, class C_TYPE, class aLayout, class bLayout, class cLayout,
23 uint64_t FULL_LOAD_MODE = 0>25 uint64_t FULL_LOAD_MODE = 0>
24-__aicore__ inline void QbmmiaMxTensorApiKernel(GM_ADDR aGM, GM_ADDR bGM, GM_ADDR scale, GM_ADDR perTokenScale,26+__aicore__ inline void QbmmiaCubeWithoutBatchTensorApiKernel(GM_ADDR aGM, GM_ADDR bGM, GM_ADDR scale,
25- GM_ADDR cGM, const void* tilingData)27+ GM_ADDR perTokenScale, GM_ADDR cGM, const void* tilingData)
26{28{
27 using AType = A_TYPE;29 using AType = A_TYPE;
28 using BType = B_TYPE;30 using BType = B_TYPE;
31+ using X2ScaleType = float;
29 using BiasType = float;32 using BiasType = float;
30 using OutType = C_TYPE;33 using OutType = C_TYPE;
31- 
32 using BlockEpilogue = Blaze::Epilogue::Block::BlockEpilogueEmpty;34 using BlockEpilogue = Blaze::Epilogue::Block::BlockEpilogueEmpty;
33 using ProblemShape = asc::te::shape<int64_t, int64_t, int64_t, int64_t>;35 using ProblemShape = asc::te::shape<int64_t, int64_t, int64_t, int64_t>;
34 using BlockScheduler = Blaze::Gemm::Block::BlockSchedulerQuantBatchMatmulV3<ProblemShape, FULL_LOAD_MODE, aLayout,36 using BlockScheduler = Blaze::Gemm::Block::BlockSchedulerQuantBatchMatmulV3<ProblemShape, FULL_LOAD_MODE, aLayout,
35 bLayout, AType>;37 bLayout, AType>;
36- 38+ using DispatchPolicy = Blaze::Gemm::MatmulWithScaleFixpipeQuant<
37- using DispatchPolicy = Blaze::Gemm::MatmulWithScaleMx<FULL_LOAD_MODE, true>;39+ FULL_LOAD_MODE, true, Blaze::Gemm::KernelMmadWithScaleFixpipeQuantWithoutBatch>;
38- using BlockMmad = Blaze::Gemm::Block::BlockMmad<DispatchPolicy, AType, aLayout, BType, bLayout, OutType, cLayout,40+ using BlockMmad = Blaze::Gemm::Block::BlockMmad<DispatchPolicy, AType, aLayout,
41+ AscendC::Std::tuple<BType, X2ScaleType>, bLayout, OutType, cLayout,
39 BiasType, cLayout>;42 BiasType, cLayout>;
40- 
41 using MatmulKernel = Blaze::Gemm::Kernel::GemmUniversal<ProblemShape, BlockMmad, BlockEpilogue, BlockScheduler>;43 using MatmulKernel = Blaze::Gemm::Kernel::GemmUniversal<ProblemShape, BlockMmad, BlockEpilogue, BlockScheduler>;
42 using Params = typename MatmulKernel::Params;44 using Params = typename MatmulKernel::Params;
43- const QMMIA::QuantBatchMatmulInplaceAddTilingData&
44- qbmmiaTilingData = *static_cast<const QMMIA::QuantBatchMatmulInplaceAddTilingData*>(tilingData);
45- const QMMIA::QuantBatchMatmulV3BasicAPIDataParams& dataParams = qbmmiaTilingData.params;
46- const QMMIA::BasicAPICubeTiling& matmulTiling = qbmmiaTilingData.matmulTiling;
47- const QMMIA::SlidingWindowParams& slidingWindowParams = qbmmiaTilingData.adaptiveSlidingWin;
48 45 
49- MatmulKernel{}(46+ const auto& qbmmiaTilingData = *static_cast<const QMMIA::QbmmiaWithoutBatchTilingData*>(tilingData);
50- Params{{matmulTiling.m, matmulTiling.n, matmulTiling.k, dataParams.batchC},47+ using QBMMTiling = typename MatmulKernel::QBMMTiling;
51- {aGM, bGM, cGM, nullptr, perTokenScale, scale},48+ const QBMMTiling qbmmParams{qbmmiaTilingData.x1QuantMode, qbmmiaTilingData.x2QuantMode, qbmmiaTilingData.kAL1,
52- {matmulTiling.kBL1, matmulTiling.scaleKL1, matmulTiling.nBufferNum},49+ qbmmiaTilingData.kBL1, qbmmiaTilingData.nBufferNum, qbmmiaTilingData.baseM,
53- {matmulTiling.baseM, matmulTiling.baseN, slidingWindowParams.mTailTile, slidingWindowParams.nTailTile,50+ qbmmiaTilingData.baseN, qbmmiaTilingData.baseK, qbmmiaTilingData.isBias,
54- slidingWindowParams.mBaseTailSplitCnt, slidingWindowParams.nBaseTailSplitCnt,51+ qbmmiaTilingData.dbL0C, qbmmiaTilingData.weightMustHitL2};
55- slidingWindowParams.mTailMain, slidingWindowParams.nTailMain},52+ MatmulKernel{}(Params{{qbmmiaTilingData.m, qbmmiaTilingData.n, qbmmiaTilingData.k, 1L},
56- {dataParams.batchA1, dataParams.batchA2, dataParams.batchA3, dataParams.batchA4, dataParams.batchB1,53+ {aGM, bGM, cGM, nullptr, perTokenScale, scale},
57- dataParams.batchB2, dataParams.batchB3, dataParams.batchB4, dataParams.batchC1, dataParams.batchC2,54+ {qbmmiaTilingData.baseM, qbmmiaTilingData.baseN, qbmmiaTilingData.mTailTile,
58- dataParams.batchC3, dataParams.batchC4, dataParams.biasThreeDim, matmulTiling.baseM, matmulTiling.baseN,55+ qbmmiaTilingData.nTailTile, qbmmiaTilingData.mBaseTailSplitCnt,
59- matmulTiling.baseK, matmulTiling.isBias, matmulTiling.dbL0C, matmulTiling.weightMustHitL2}});56+ qbmmiaTilingData.nBaseTailSplitCnt, qbmmiaTilingData.mTailMain, qbmmiaTilingData.nTailMain},
57+ qbmmParams});
60}58}
@@ -1,89 +0,0 @@
1-/**
2- * Copyright (c) 2026 Huawei Technologies Co., Ltd.
3- * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4- * CANN Open Software License Agreement Version 2.0 (the "License").
5- * Please refer to the License for details. You may not use this file except in compliance with the License.
6- * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
7- * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8- * See LICENSE in the root of the software repository for the full text of the License.
9- */
10- 
11-/* !
12- * \file qbmmia_mx_basic_api_cmct.h
13- * \brief
14- */
15-#pragma once
16-#include "cmct/block/block_mmad_mx.h"
17-#include "cmct/block/block_scheduler_policy.h"
18-#include "cmct/block/block_scheduler_utils.h"
19-#include "cmct/epilogue/block_epilogue_empty.h"
20-#include "cmct/kernel/kernel_qbmm_mx.h"
21-using namespace Cmct;
22-using namespace Cmct::Gemm;
23-template <class A_TYPE, class B_TYPE, class C_TYPE, class aLayout, class bLayout, class cLayout,
24- uint64_t FULL_LOAD_MODE = 0>
25-__aicore__ inline void QbmmiaMxBasicApiKernel(GM_ADDR aGM, GM_ADDR bGM, GM_ADDR scale, GM_ADDR perTokenScale,
26- GM_ADDR cGM, const void* tilingData)
27-{
28- // 定义L1和L0的TileShape
29- using L1TileShape = AscendC::Shape<_0, _0, _0>;
30- using L0TileShape = AscendC::Shape<_0, _0, _0>;
31- 
32- // 定义矩阵的类型和布局
33- using AType = A_TYPE;
34- using BType = B_TYPE;
35- using BiasType = float;
36- using OutType = C_TYPE;
37- 
38- // 定义BlockEpilogue类型
39- using BlockEpilogue = Block::BlockEpilogueEmpty;
40- 
41- // 定义shape的形状,tuple保存 m n k batch
42- using ProblemShape = MatmulShape;
43- 
44- // 定义scheduler类型 来自block_scheduler_policy.h
45- using BlockScheduler = Cmct::Gemm::QuantBatchMatmulV3Scheduler<FULL_LOAD_MODE>;
46- 
47- // 定义MMAD类型
48- using DispatchPolicy = MatmulWithScale<AscendC::Shape<_0, _0, _0, _0>, FULL_LOAD_MODE>;
49- using BlockMmad = Block::BlockMmadMx<DispatchPolicy, L1TileShape, L0TileShape, AType, aLayout, BType, bLayout,
50- OutType, cLayout, BiasType, cLayout, void>;
51- 
52- // 定义Kernel类型
53- using MatmulKernel = Cmct::Gemm::Kernel::QuantMmBatchMX<ProblemShape, BlockMmad, BlockEpilogue, BlockScheduler,
54- true>;
55- using Params = typename MatmulKernel::Params;
56- const QMMIA::QuantBatchMatmulInplaceAddTilingData* quantBmmInplaceAddTilingData_;
57- quantBmmInplaceAddTilingData_ = static_cast<const QMMIA::QuantBatchMatmulInplaceAddTilingData*>(tilingData);
58- QMMIA::BasicAPICubeTiling matmulTiling = quantBmmInplaceAddTilingData_->matmulTiling;
59- QMMIA::SlidingWindowParams slidingWindowParams = quantBmmInplaceAddTilingData_->adaptiveSlidingWin;
60- using QBMMTiling = typename MatmulKernel::QBMMTiling;
61- QBMMTiling qbmmParams{quantBmmInplaceAddTilingData_->params.batchA1,
62- quantBmmInplaceAddTilingData_->params.batchA2,
63- quantBmmInplaceAddTilingData_->params.batchA3,
64- quantBmmInplaceAddTilingData_->params.batchA4,
65- quantBmmInplaceAddTilingData_->params.batchB1,
66- quantBmmInplaceAddTilingData_->params.batchB2,
67- quantBmmInplaceAddTilingData_->params.batchB3,
68- quantBmmInplaceAddTilingData_->params.batchB4,
69- quantBmmInplaceAddTilingData_->params.batchC1,
70- quantBmmInplaceAddTilingData_->params.batchC2,
71- quantBmmInplaceAddTilingData_->params.batchC3,
72- quantBmmInplaceAddTilingData_->params.batchC4,
73- quantBmmInplaceAddTilingData_->params.biasThreeDim,
74- matmulTiling.baseM,
75- matmulTiling.baseN,
76- matmulTiling.baseK,
77- static_cast<uint32_t>(matmulTiling.isBias),
78- static_cast<uint32_t>(matmulTiling.dbL0C)};
79- Params params = {
80- {matmulTiling.m, matmulTiling.n, matmulTiling.k, quantBmmInplaceAddTilingData_->params.batchC},
81- {aGM, bGM, cGM, nullptr, perTokenScale, scale}, // gm addr
82- {matmulTiling.kBL1, matmulTiling.scaleKL1, matmulTiling.nBufferNum},
83- {matmulTiling.baseM, matmulTiling.baseN, slidingWindowParams.mTailTile, slidingWindowParams.nTailTile,
84- slidingWindowParams.mBaseTailSplitCnt, slidingWindowParams.nBaseTailSplitCnt, slidingWindowParams.mTailMain,
85- slidingWindowParams.nTailMain},
86- qbmmParams};
87- MatmulKernel qbmm;
88- qbmm(params);
89-}
@@ -41,9 +41,8 @@ __aicore__ inline void QbmmiaMxWithoutBatchTensorApiKernel(GM_ADDR aGM, GM_ADDR
41 41 
42 using MatmulKernel = Blaze::Gemm::Kernel::GemmUniversal<ProblemShape, BlockMmad, BlockEpilogue, BlockScheduler>;42 using MatmulKernel = Blaze::Gemm::Kernel::GemmUniversal<ProblemShape, BlockMmad, BlockEpilogue, BlockScheduler>;
43 using Params = typename MatmulKernel::Params;43 using Params = typename MatmulKernel::Params;
44- const QMMIA::QuantBatchMatmulInplaceAddTensorAPIWithoutBatchTilingData&44+ const QMMIA::QbmmiaWithoutBatchTilingData&
45- qbmmiaTilingData = *static_cast<const QMMIA::QuantBatchMatmulInplaceAddTensorAPIWithoutBatchTilingData*>(45+ qbmmiaTilingData = *static_cast<const QMMIA::QbmmiaWithoutBatchTilingData*>(tilingData);
46- tilingData);
47 46 
48 MatmulKernel{}(Params{{qbmmiaTilingData.m, qbmmiaTilingData.n, qbmmiaTilingData.k, 1L},47 MatmulKernel{}(Params{{qbmmiaTilingData.m, qbmmiaTilingData.n, qbmmiaTilingData.k, 1L},
49 {aGM, bGM, cGM, nullptr, perTokenScale, scale},48 {aGM, bGM, cGM, nullptr, perTokenScale, scale},
@@ -12,12 +12,6 @@
12 * \file quant_batch_matmul_inplace_add.cpp12 * \file quant_batch_matmul_inplace_add.cpp
13 * \brief13 * \brief
14 */14 */
15-#if defined(ASC_DEVKIT_MAJOR) && defined(ASC_DEVKIT_MINOR) && ASC_DEVKIT_MAJOR >= 9 && ASC_DEVKIT_MINOR > 0
16-#define IS_BLAZE true
17-#else
18-#define IS_BLAZE false
19-#endif
20- 
21#if ASC_DEVKIT_MAJOR >= 915#if ASC_DEVKIT_MAJOR >= 9
22#include "kernel_basic_intf.h"16#include "kernel_basic_intf.h"
23#else17#else
@@ -41,23 +35,17 @@
41#define QBMMIA_IS_HIF8 false35#define QBMMIA_IS_HIF8 false
42#endif36#endif
43 37 
44-#include "lib/matmul_intf.h"38+#include "tensor_api/tensor.h"
45#if QBMMIA_IS_HIF839#if QBMMIA_IS_HIF8
46-#include "qbmmia_cube_basic_api_cmct.h"40+#include "qbmmia_cube_without_batch_tensor_api_blaze.h"
47#endif41#endif
48#if QBMMIA_IS_MX42#if QBMMIA_IS_MX
49-#if IS_BLAZE
50-#include "qbmmia_mx_tensor_api_blaze.h"
51#include "qbmmia_mx_without_batch_tensor_api_blaze.h"43#include "qbmmia_mx_without_batch_tensor_api_blaze.h"
52-#else
53-#include "qbmmia_mx_basic_api_cmct.h"
54-#endif
55#endif44#endif
56 45 
57using namespace AscendC;46using namespace AscendC;
58-using namespace matmul;
59 47 
60-#if IS_BLAZE && QBMMIA_IS_MX48+#if QBMMIA_IS_MX
61#define QBMMIA_MX_WITHOUT_BATCH_DISPATCH(aLayout, bLayout, fullLoadMode) \49#define QBMMIA_MX_WITHOUT_BATCH_DISPATCH(aLayout, bLayout, fullLoadMode) \
62 QbmmiaMxWithoutBatchTensorApiKernel<DTYPE_X1, DTYPE_X2, DTYPE_Y, aLayout, bLayout, asc::te::nd_ext_layout_ptn, \50 QbmmiaMxWithoutBatchTensorApiKernel<DTYPE_X1, DTYPE_X2, DTYPE_Y, aLayout, bLayout, asc::te::nd_ext_layout_ptn, \
63 fullLoadMode>(x1, x2, x2_scale, x1_scale, y, &tilingData)51 fullLoadMode>(x1, x2, x2_scale, x1_scale, y, &tilingData)
@@ -76,49 +64,15 @@ using namespace matmul;
76 } while (0)64 } while (0)
77#endif65#endif
78 66 
79-#if IS_BLAZE && QBMMIA_IS_MX
80-#define QBMMIA_MX_BLAZE_DISPATCH(aLayout, bLayout, fullLoadMode) \
81- QbmmiaMxTensorApiKernel<DTYPE_X1, DTYPE_X2, DTYPE_Y, aLayout, bLayout, asc::te::nd_ext_layout_ptn, fullLoadMode>( \
82- x1, x2, x2_scale, x1_scale, y, &tilingData)
83- 
84-#define QBMMIA_MX_BLAZE_LAYOUT_DISPATCH(fullLoadMode) \
85- do { \
86- if constexpr (TPL_ATRANS == 0 && TPL_BTRANS == 0) { \
87- QBMMIA_MX_BLAZE_DISPATCH(asc::te::nd_ext_layout_ptn, asc::te::nd_ext_layout_ptn, fullLoadMode); \
88- } else if constexpr (TPL_ATRANS == 0 && TPL_BTRANS == 1) { \
89- QBMMIA_MX_BLAZE_DISPATCH(asc::te::nd_ext_layout_ptn, asc::te::dn_ext_layout_ptn, fullLoadMode); \
90- } else if constexpr (TPL_ATRANS == 1 && TPL_BTRANS == 0) { \
91- QBMMIA_MX_BLAZE_DISPATCH(asc::te::dn_ext_layout_ptn, asc::te::nd_ext_layout_ptn, fullLoadMode); \
92- } else if constexpr (TPL_ATRANS == 1 && TPL_BTRANS == 1) { \
93- QBMMIA_MX_BLAZE_DISPATCH(asc::te::dn_ext_layout_ptn, asc::te::dn_ext_layout_ptn, fullLoadMode); \
94- } \
95- } while (0)
96-#endif
97- 
98-#if QBMMIA_IS_MX && !IS_BLAZE
99-#define QBMMIA_MX_DISPATCH(aLayout, bLayout, fullLoadMode) \
100- QbmmiaMxBasicApiKernel<DTYPE_X1, DTYPE_X2, DTYPE_Y, aLayout, bLayout, Cmct::Gemm::layout::RowMajorAlign, \
101- fullLoadMode>(x1, x2, x2_scale, x1_scale, y, &tilingData)
102- 
103-#define QBMMIA_MX_CMCT_LAYOUT_DISPATCH(fullLoadMode) \
104- do { \
105- if constexpr (TPL_ATRANS == 0 && TPL_BTRANS == 0) { \
106- QBMMIA_MX_DISPATCH(Cmct::Gemm::layout::RowMajor, Cmct::Gemm::layout::RowMajor, fullLoadMode); \
107- } else if constexpr (TPL_ATRANS == 0 && TPL_BTRANS == 1) { \
108- QBMMIA_MX_DISPATCH(Cmct::Gemm::layout::RowMajor, Cmct::Gemm::layout::ColumnMajor, fullLoadMode); \
109- } else if constexpr (TPL_ATRANS == 1 && TPL_BTRANS == 0) { \
110- QBMMIA_MX_DISPATCH(Cmct::Gemm::layout::ColumnMajor, Cmct::Gemm::layout::RowMajor, fullLoadMode); \
111- } else if constexpr (TPL_ATRANS == 1 && TPL_BTRANS == 1) { \
112- QBMMIA_MX_DISPATCH(Cmct::Gemm::layout::ColumnMajor, Cmct::Gemm::layout::ColumnMajor, fullLoadMode); \
113- } \
114- } while (0)
115-#endif
116- 
117#if QBMMIA_IS_HIF867#if QBMMIA_IS_HIF8
118-#define QBMMIA_CUBE_DISPATCH(aLayout, bLayout, fullLoadMode) \68+#define QBMMIA_CUBE_WITHOUT_BATCH_LAYOUT_DISPATCH(fullLoadMode) \
119- QbmmiaCubeBasicApiKernel<DTYPE_X1, DTYPE_X2, float, DTYPE_Y, float, aLayout, bLayout, \69+ do { \
120- Cmct::Gemm::layout::RowMajorAlign, fullLoadMode>(x1, x2, x2_scale, x1_scale, y, \70+ if constexpr (TPL_ATRANS == 1 && TPL_BTRANS == 0) { \
121- &tilingData)71+ QbmmiaCubeWithoutBatchTensorApiKernel<DTYPE_X1, DTYPE_X2, DTYPE_Y, asc::te::dn_ext_layout_ptn, \
72+ asc::te::nd_ext_layout_ptn, asc::te::nd_ext_layout_ptn, \
73+ fullLoadMode>(x1, x2, x2_scale, x1_scale, y, &tilingData); \
74+ } \
75+ } while (0)
122#endif76#endif
123 77 
124template <int TPL_ATRANS, int TPL_BTRANS, int TPL_KERNEL_TYPE>78template <int TPL_ATRANS, int TPL_BTRANS, int TPL_KERNEL_TYPE>
@@ -126,45 +80,22 @@ __global__ __aicore__ void quant_batch_matmul_inplace_add(GM_ADDR x1, GM_ADDR x2
126 GM_ADDR x1_scale, GM_ADDR y, GM_ADDR workspace,80 GM_ADDR x1_scale, GM_ADDR y, GM_ADDR workspace,
127 GM_ADDR tiling)81 GM_ADDR tiling)
128{82{
129- TPipe tPipe;
130 REGISTER_NONE_TILING;83 REGISTER_NONE_TILING;
131-#if QBMMIA_IS_MX && IS_BLAZE84+#if QBMMIA_IS_MX || QBMMIA_IS_HIF8
132 if constexpr (TPL_KERNEL_TYPE == TPL_NO_VEC_EPILOGUE_WITH_MMAPI_WITHOUT_BATCH) {85 if constexpr (TPL_KERNEL_TYPE == TPL_NO_VEC_EPILOGUE_WITH_MMAPI_WITHOUT_BATCH) {
133- GET_TILING_DATA_WITH_STRUCT(QMMIA::QuantBatchMatmulInplaceAddTensorAPIWithoutBatchTilingData, tilingData,86+ GET_TILING_DATA_WITH_STRUCT(QMMIA::QbmmiaWithoutBatchTilingData, tilingData, tiling);
134- tiling);87+#if QBMMIA_IS_MX
135 QBMMIA_MX_WITHOUT_BATCH_LAYOUT_DISPATCH(0);88 QBMMIA_MX_WITHOUT_BATCH_LAYOUT_DISPATCH(0);
136- } else if constexpr (TPL_KERNEL_TYPE == TPL_NO_VEC_EPILOGUE_CUSTOM_GMTOAL1_WITH_MMAPI_WITHOUT_BATCH) {89+#else
137- GET_TILING_DATA_WITH_STRUCT(QMMIA::QuantBatchMatmulInplaceAddTensorAPIWithoutBatchTilingData, tilingData,90+ QBMMIA_CUBE_WITHOUT_BATCH_LAYOUT_DISPATCH(0);
138- tiling);91+#endif
139- QBMMIA_MX_WITHOUT_BATCH_LAYOUT_DISPATCH(Blaze::Gemm::A_FULL_LOAD_MODE);92+ } else if constexpr (TPL_KERNEL_TYPE == TPL_NO_VEC_EPILOGUE_CUSTOM_GMTOAL1_WITH_MMAPI_WITHOUT_BATCH) {
140- } else if constexpr (TPL_KERNEL_TYPE == TPL_NO_VEC_EPILOGUE_WITH_MMAPI) {93+ GET_TILING_DATA_WITH_STRUCT(QMMIA::QbmmiaWithoutBatchTilingData, tilingData, tiling);
141- GET_TILING_DATA_WITH_STRUCT(QMMIA::QuantBatchMatmulInplaceAddTilingData, tilingData, tiling);94+#if QBMMIA_IS_MX
142- QBMMIA_MX_BLAZE_LAYOUT_DISPATCH(0);95+ QBMMIA_MX_WITHOUT_BATCH_LAYOUT_DISPATCH(Blaze::Gemm::A_FULL_LOAD_MODE);
143- } else if constexpr (TPL_KERNEL_TYPE == TPL_NO_VEC_EPILOGUE_CUSTOM_GMTOAL1_WITH_MMAPI) {96+#else
144- GET_TILING_DATA_WITH_STRUCT(QMMIA::QuantBatchMatmulInplaceAddTilingData, tilingData, tiling);97+ QBMMIA_CUBE_WITHOUT_BATCH_LAYOUT_DISPATCH(Blaze::Gemm::A_FULL_LOAD_MODE);
145- QBMMIA_MX_BLAZE_LAYOUT_DISPATCH(Blaze::Gemm::A_FULL_LOAD_MODE);
146- }
147-#elif QBMMIA_IS_MX
148- if constexpr (TPL_KERNEL_TYPE == TPL_NO_VEC_EPILOGUE_WITH_MMAPI) {
149- GET_TILING_DATA_WITH_STRUCT(QMMIA::QuantBatchMatmulInplaceAddTilingData, tilingData, tiling);
150- QBMMIA_MX_CMCT_LAYOUT_DISPATCH(0);
151- } else if constexpr (TPL_KERNEL_TYPE == TPL_NO_VEC_EPILOGUE_CUSTOM_GMTOAL1_WITH_MMAPI) {
152- GET_TILING_DATA_WITH_STRUCT(QMMIA::QuantBatchMatmulInplaceAddTilingData, tilingData, tiling);
153- QBMMIA_MX_CMCT_LAYOUT_DISPATCH(Cmct::Gemm::A_FULL_LOAD_MODE);
154- }
155#endif98#endif
156-#if QBMMIA_IS_HIF8
157- if constexpr (TPL_KERNEL_TYPE == TPL_NO_VEC_EPILOGUE_WITH_MMAPI) {
158- GET_TILING_DATA_WITH_STRUCT(QMMIA::QuantBatchMatmulInplaceAddTilingData, tilingData, tiling);
159- if constexpr (TPL_ATRANS == 1 && TPL_BTRANS == 0) {
160- QBMMIA_CUBE_DISPATCH(Cmct::Gemm::layout::ColumnMajor, Cmct::Gemm::layout::RowMajor, 0);
161- }
162- } else if constexpr (TPL_KERNEL_TYPE == TPL_NO_VEC_EPILOGUE_CUSTOM_GMTOAL1_WITH_MMAPI) {
163- GET_TILING_DATA_WITH_STRUCT(QMMIA::QuantBatchMatmulInplaceAddTilingData, tilingData, tiling);
164- if constexpr (TPL_ATRANS == 1 && TPL_BTRANS == 0) {
165- QBMMIA_CUBE_DISPATCH(Cmct::Gemm::layout::ColumnMajor, Cmct::Gemm::layout::RowMajor,
166- Cmct::Gemm::A_FULL_LOAD_MODE);
167- }
168 }99 }
169#endif100#endif
170}101}
@@ -76,7 +76,7 @@ struct SlidingWindowParams {
76#pragma pack(pop)76#pragma pack(pop)
77 77 
78#pragma pack(push, 8)78#pragma pack(push, 8)
79-struct QuantBatchMatmulInplaceAddTilingData {79+struct QbmmiaTilingData {
80 QuantBatchMatmulV3BasicAPIDataParams params;80 QuantBatchMatmulV3BasicAPIDataParams params;
81 BasicAPICubeTiling matmulTiling;81 BasicAPICubeTiling matmulTiling;
82 SlidingWindowParams adaptiveSlidingWin;82 SlidingWindowParams adaptiveSlidingWin;
@@ -84,7 +84,7 @@ struct QuantBatchMatmulInplaceAddTilingData {
84#pragma pack(pop)84#pragma pack(pop)
85 85 
86#pragma pack(push, 8)86#pragma pack(push, 8)
87-struct QuantBatchMatmulInplaceAddTensorAPIWithoutBatchTilingData {87+struct alignas(8) QbmmiaWithoutBatchTilingData {
88 uint32_t m = 0;88 uint32_t m = 0;
89 uint32_t n = 0;89 uint32_t n = 0;
90 uint32_t k = 0;90 uint32_t k = 0;
@@ -110,9 +110,6 @@ struct QuantBatchMatmulInplaceAddTensorAPIWithoutBatchTilingData {
110 uint8_t nBufferNum = 0;110 uint8_t nBufferNum = 0;
111 uint8_t dbL0C = 0;111 uint8_t dbL0C = 0;
112 uint8_t weightMustHitL2 = 1U;112 uint8_t weightMustHitL2 = 1U;
113- uint8_t reserved0 = 0;
114- uint32_t reserved1 = 0;
115- uint32_t reserved2 = 0;
116};113};
117#pragma pack(pop)114#pragma pack(pop)
118} // namespace QMMIA115} // namespace QMMIA
@@ -18,8 +18,7 @@
18 18 
19namespace QuantBatchMatmulInplaceAddArch35TilingKey {19namespace QuantBatchMatmulInplaceAddArch35TilingKey {
20 20 
21-#if defined(ASC_DEVKIT_MAJOR) && defined(ASC_DEVKIT_MINOR) && ASC_DEVKIT_MAJOR >= 9 && ASC_DEVKIT_MINOR > 0 && \21+#if defined(ORIG_DTYPE_X1) && defined(ORIG_DTYPE_X2) && defined(ORIG_DTYPE_X2_SCALE) && defined(DT_FLOAT8_E4M3FN) && \
22- defined(ORIG_DTYPE_X1) && defined(ORIG_DTYPE_X2) && defined(ORIG_DTYPE_X2_SCALE) && defined(DT_FLOAT8_E4M3FN) && \
23 defined(DT_FLOAT8_E5M2) && defined(DT_FLOAT8_E8M0)22 defined(DT_FLOAT8_E5M2) && defined(DT_FLOAT8_E8M0)
24#define SUPPORT_MX_WITHOUT_BATCH_TILING_KEY \23#define SUPPORT_MX_WITHOUT_BATCH_TILING_KEY \
25 ((ORIG_DTYPE_X1 == DT_FLOAT8_E4M3FN || ORIG_DTYPE_X1 == DT_FLOAT8_E5M2) && \24 ((ORIG_DTYPE_X1 == DT_FLOAT8_E4M3FN || ORIG_DTYPE_X1 == DT_FLOAT8_E5M2) && \
@@ -28,31 +27,28 @@ namespace QuantBatchMatmulInplaceAddArch35TilingKey {
28#define SUPPORT_MX_WITHOUT_BATCH_TILING_KEY false27#define SUPPORT_MX_WITHOUT_BATCH_TILING_KEY false
29#endif28#endif
30 29 
31-// Kernel Type - Basic API path30+#if defined(ORIG_DTYPE_X1) && defined(ORIG_DTYPE_X2) && defined(DT_HIFLOAT8)
32-#define TPL_NO_VEC_EPILOGUE_WITH_MMAPI 031+#define SUPPORT_CUBE_WITHOUT_BATCH_TILING_KEY (ORIG_DTYPE_X1 == DT_HIFLOAT8 && ORIG_DTYPE_X2 == DT_HIFLOAT8)
33-#define TPL_NO_VEC_EPILOGUE_CUSTOM_GMTOAL1_WITH_MMAPI 132+#else
34-#define TPL_NO_VEC_EPILOGUE_WITH_MMAPI_WITHOUT_BATCH 233+#define SUPPORT_CUBE_WITHOUT_BATCH_TILING_KEY false
35-#define TPL_NO_VEC_EPILOGUE_CUSTOM_GMTOAL1_WITH_MMAPI_WITHOUT_BATCH 3
36- 
37-ASCENDC_TPL_ARGS_DECL(
38- QuantBatchMatmulInplaceAdd, ASCENDC_TPL_UINT_DECL(ATRANS, ASCENDC_TPL_2_BW, ASCENDC_TPL_UI_LIST, 0, 1),
39- ASCENDC_TPL_UINT_DECL(BTRANS, ASCENDC_TPL_2_BW, ASCENDC_TPL_UI_LIST, 0, 1),
40- ASCENDC_TPL_UINT_DECL(KERNELTYPE, ASCENDC_TPL_4_BW, ASCENDC_TPL_UI_LIST, TPL_NO_VEC_EPILOGUE_WITH_MMAPI,
41- TPL_NO_VEC_EPILOGUE_CUSTOM_GMTOAL1_WITH_MMAPI, TPL_NO_VEC_EPILOGUE_WITH_MMAPI_WITHOUT_BATCH,
42- TPL_NO_VEC_EPILOGUE_CUSTOM_GMTOAL1_WITH_MMAPI_WITHOUT_BATCH));
43- 
44-ASCENDC_TPL_SEL(
45-#if ((!defined(__CCE_AICORE__)) || (SUPPORT_MX_WITHOUT_BATCH_TILING_KEY))
46- ASCENDC_TPL_ARGS_SEL(ASCENDC_TPL_KERNEL_TYPE_SEL(ASCENDC_TPL_AIC_ONLY),
47- ASCENDC_TPL_UINT_SEL(ATRANS, ASCENDC_TPL_UI_LIST, 0, 1),
48- ASCENDC_TPL_UINT_SEL(BTRANS, ASCENDC_TPL_UI_LIST, 0, 1),
49- ASCENDC_TPL_UINT_SEL(KERNELTYPE, ASCENDC_TPL_UI_LIST,
50- TPL_NO_VEC_EPILOGUE_WITH_MMAPI_WITHOUT_BATCH,
51- TPL_NO_VEC_EPILOGUE_CUSTOM_GMTOAL1_WITH_MMAPI_WITHOUT_BATCH)),
52#endif34#endif
53- ASCENDC_TPL_ARGS_SEL(ASCENDC_TPL_KERNEL_TYPE_SEL(ASCENDC_TPL_AIC_ONLY),35+ 
54- ASCENDC_TPL_UINT_SEL(ATRANS, ASCENDC_TPL_UI_LIST, 0, 1),36+#define SUPPORT_WITHOUT_BATCH_TILING_KEY (SUPPORT_MX_WITHOUT_BATCH_TILING_KEY || SUPPORT_CUBE_WITHOUT_BATCH_TILING_KEY)
55- ASCENDC_TPL_UINT_SEL(BTRANS, ASCENDC_TPL_UI_LIST, 0, 1),37+ 
56- ASCENDC_TPL_UINT_SEL(KERNELTYPE, ASCENDC_TPL_UI_LIST, TPL_NO_VEC_EPILOGUE_WITH_MMAPI,38+// Kernel Type - Tensor API without-batch path.
57- TPL_NO_VEC_EPILOGUE_CUSTOM_GMTOAL1_WITH_MMAPI)));39+#define TPL_NO_VEC_EPILOGUE_WITH_MMAPI_WITHOUT_BATCH 0
40+#define TPL_NO_VEC_EPILOGUE_CUSTOM_GMTOAL1_WITH_MMAPI_WITHOUT_BATCH 1
41+ 
42+ASCENDC_TPL_ARGS_DECL(QuantBatchMatmulInplaceAdd,
43+ ASCENDC_TPL_UINT_DECL(ATRANS, ASCENDC_TPL_2_BW, ASCENDC_TPL_UI_LIST, 0, 1),
44+ ASCENDC_TPL_UINT_DECL(BTRANS, ASCENDC_TPL_2_BW, ASCENDC_TPL_UI_LIST, 0, 1),
45+ ASCENDC_TPL_UINT_DECL(KERNELTYPE, ASCENDC_TPL_4_BW, ASCENDC_TPL_UI_LIST,
46+ TPL_NO_VEC_EPILOGUE_WITH_MMAPI_WITHOUT_BATCH,
47+ TPL_NO_VEC_EPILOGUE_CUSTOM_GMTOAL1_WITH_MMAPI_WITHOUT_BATCH));
48+ 
49+ASCENDC_TPL_SEL(ASCENDC_TPL_ARGS_SEL(
50+ ASCENDC_TPL_KERNEL_TYPE_SEL(ASCENDC_TPL_AIC_ONLY), ASCENDC_TPL_UINT_SEL(ATRANS, ASCENDC_TPL_UI_LIST, 0, 1),
51+ ASCENDC_TPL_UINT_SEL(BTRANS, ASCENDC_TPL_UI_LIST, 0, 1),
52+ ASCENDC_TPL_UINT_SEL(KERNELTYPE, ASCENDC_TPL_UI_LIST, TPL_NO_VEC_EPILOGUE_WITH_MMAPI_WITHOUT_BATCH,
53+ TPL_NO_VEC_EPILOGUE_CUSTOM_GMTOAL1_WITH_MMAPI_WITHOUT_BATCH)));
58} // namespace QuantBatchMatmulInplaceAddArch35TilingKey54} // namespace QuantBatchMatmulInplaceAddArch35TilingKey
@@ -33,7 +33,6 @@
33#include "../../../op_host/op_tiling/quant_batch_matmul_inplace_add_tiling.h"33#include "../../../op_host/op_tiling/quant_batch_matmul_inplace_add_tiling.h"
34#include "../../../op_kernel/arch35/quant_batch_matmul_inplace_add_tiling_key.h"34#include "../../../op_kernel/arch35/quant_batch_matmul_inplace_add_tiling_key.h"
35#include "../../../../common/op_host/math_util_nn.h"35#include "../../../../common/op_host/math_util_nn.h"
36-#include "../../../../quant_batch_matmul_v3/op_host/op_tiling/arch35/quant_batch_matmul_v3_tiling_util.h"
37#include "../../../../quant_batch_matmul_v3/op_host/op_tiling/quant_batch_matmul_v3_compile_info.h"36#include "../../../../quant_batch_matmul_v3/op_host/op_tiling/quant_batch_matmul_v3_compile_info.h"
38#include "../../../../../tests/ut/common/ut_string_utils.h"37#include "../../../../../tests/ut/common/ut_string_utils.h"
39 38 
@@ -71,17 +70,6 @@ struct QuantBatchMatmulInplaceAddTilingTestParam {
71 uint64_t expectTilingKey;70 uint64_t expectTilingKey;
72};71};
73 72 
74-bool IsMxFp8Param(const QuantBatchMatmulInplaceAddTilingTestParam& param)
75-{
76- return param.groupSize > 0 && (param.x1Dtype == ge::DT_FLOAT8_E4M3FN || param.x1Dtype == ge::DT_FLOAT8_E5M2) &&
77- (param.x2Dtype == ge::DT_FLOAT8_E4M3FN || param.x2Dtype == ge::DT_FLOAT8_E5M2);
78-}
79- 
80-bool ShouldSkipMxCheckWithoutTensorApi(const QuantBatchMatmulInplaceAddTilingTestParam& param)
81-{
82- return param.socVersion == "Ascend950" && IsMxFp8Param(param) && !optiling::IsTensorapiCapable();
83-}
84- 
85struct QuantBatchMatmulInplaceAddTilingCsvLoadResult {73struct QuantBatchMatmulInplaceAddTilingCsvLoadResult {
86 vector<QuantBatchMatmulInplaceAddTilingTestParam> params;74 vector<QuantBatchMatmulInplaceAddTilingTestParam> params;
87 vector<string> errors;75 vector<string> errors;
@@ -340,15 +328,14 @@ static void TestOneParamCase(const QuantBatchMatmulInplaceAddTilingTestParam& pa
340 ge::graphStatus ret = tilingFunc(tilingContext);328 ge::graphStatus ret = tilingFunc(tilingContext);
341 ASSERT_EQ(ret, param.expectTilingResult);329 ASSERT_EQ(ret, param.expectTilingResult);
342 if (ret == ge::GRAPH_SUCCESS) {330 if (ret == ge::GRAPH_SUCCESS) {
343- if (ShouldSkipMxCheckWithoutTensorApi(param)) {
344- return;
345- }
346 ASSERT_EQ(tilingContext->GetTilingKey(), param.expectTilingKey);331 ASSERT_EQ(tilingContext->GetTilingKey(), param.expectTilingKey);
347 ASSERT_EQ(tilingContext->GetBlockDim(), param.expectBlockDim);332 ASSERT_EQ(tilingContext->GetBlockDim(), param.expectBlockDim);
348- size_t expectTilingDataSize = IsMxFp8Param(param) ?333+ ASSERT_EQ(tilingContext->GetRawTilingData()->GetDataSize(), sizeof(QMMIA::QbmmiaWithoutBatchTilingData));
349- sizeof(QMMIA::QuantBatchMatmulInplaceAddTensorAPIWithoutBatchTilingData) :334+ const auto* tilingData = reinterpret_cast<const QMMIA::QbmmiaWithoutBatchTilingData*>(
350- sizeof(QMMIA::QuantBatchMatmulInplaceAddTilingData);335+ tilingContext->GetRawTilingData()->GetData());
351- ASSERT_EQ(tilingContext->GetRawTilingData()->GetDataSize(), expectTilingDataSize);336+ ASSERT_EQ(tilingData->m, static_cast<uint32_t>(param.m));
337+ ASSERT_EQ(tilingData->n, static_cast<uint32_t>(param.n));
338+ ASSERT_EQ(tilingData->k, static_cast<uint32_t>(param.k));
352 }339 }
353}340}
354 341 
@@ -1,6 +1,6 @@
1caseGroup,caseName,socVersion,m,k,n,transA,transB,groupSize,x1Format,x2Format,x1Dtype,x2Dtype,hasX1Scale,x1ScaleDtype,hasX2Scale,x2ScaleDtype,yDtype,aicNum,aivNum,expectBlockDim,expectTilingResult,expectTilingKey1caseGroup,caseName,socVersion,m,k,n,transA,transB,groupSize,x1Format,x2Format,x1Dtype,x2Dtype,hasX1Scale,x1ScaleDtype,hasX2Scale,x2ScaleDtype,yDtype,aicNum,aivNum,expectBlockDim,expectTilingResult,expectTilingKey
2-general,mx_test1,Ascend950,128,512,128,true,false,32,ND,ND,FP8-E4M3,FP8-E5M2,true,FP8-E8M0,true,FP8-E8M0,FP32,32,64,16,GRAPH_SUCCESS,332+general,mx_test1,Ascend950,128,512,128,true,false,32,ND,ND,FP8-E4M3,FP8-E5M2,true,FP8-E8M0,true,FP8-E8M0,FP32,32,64,16,GRAPH_SUCCESS,1
3-general,mx_2,Ascend950,1024,512,1024,true,false,32,ND,ND,FP8-E5M2,FP8-E5M2,true,FP8-E8M0,true,FP8-E8M0,FP32,32,64,32,GRAPH_SUCCESS,333+general,mx_2,Ascend950,1024,512,1024,true,false,32,ND,ND,FP8-E5M2,FP8-E5M2,true,FP8-E8M0,true,FP8-E8M0,FP32,32,64,32,GRAPH_SUCCESS,1
4-general,mx_3,Ascend950,128,512,128,true,false,32,ND,ND,FP8-E5M2,FP8-E5M2,true,FP8-E8M0,true,FP8-E8M0,FP32,32,64,16,GRAPH_SUCCESS,334+general,mx_3,Ascend950,128,512,128,true,false,32,ND,ND,FP8-E5M2,FP8-E5M2,true,FP8-E8M0,true,FP8-E8M0,FP32,32,64,16,GRAPH_SUCCESS,1
5-general,mx_4,Ascend950,1024,512,1024,true,false,32,ND,ND,FP8-E4M3,FP8-E4M3,true,FP8-E8M0,true,FP8-E8M0,FP32,32,64,32,GRAPH_SUCCESS,335+general,mx_4,Ascend950,1024,512,1024,true,false,32,ND,ND,FP8-E4M3,FP8-E4M3,true,FP8-E8M0,true,FP8-E8M0,FP32,32,64,32,GRAPH_SUCCESS,1
6general,hif8_tt,Ascend950,128,512,128,true,false,0,ND,ND,HIFLOAT8,HIFLOAT8,true,FP32,true,FP32,FP32,32,64,16,GRAPH_SUCCESS,16general,hif8_tt,Ascend950,128,512,128,true,false,0,ND,ND,HIFLOAT8,HIFLOAT8,true,FP32,true,FP32,FP32,32,64,16,GRAPH_SUCCESS,1
@@ -45,8 +45,8 @@ TEST_F(QuantBatchMatmulInplaceAddKernelTest, Hif8BasicApiKernelCompile)
45#ifdef __CCE_KT_TEST__45#ifdef __CCE_KT_TEST__
46 using KernelFunc = void (*)(GM_ADDR x1, GM_ADDR x2, GM_ADDR x2Scale, GM_ADDR yIn, GM_ADDR x1Scale, GM_ADDR y,46 using KernelFunc = void (*)(GM_ADDR x1, GM_ADDR x2, GM_ADDR x2Scale, GM_ADDR yIn, GM_ADDR x1Scale, GM_ADDR y,
47 GM_ADDR workspace, GM_ADDR tiling);47 GM_ADDR workspace, GM_ADDR tiling);
48- KernelFunc kernelFunc = quant_batch_matmul_inplace_add<1, 0, TPL_NO_VEC_EPILOGUE_WITH_MMAPI>;48+ KernelFunc kernelFunc = quant_batch_matmul_inplace_add<1, 0, TPL_NO_VEC_EPILOGUE_WITH_MMAPI_WITHOUT_BATCH>;
49 ASSERT_NE(kernelFunc, nullptr);49 ASSERT_NE(kernelFunc, nullptr);
50- ASSERT_GT(sizeof(QMMIA::QuantBatchMatmulInplaceAddTilingData), 0UL);50+ ASSERT_GT(sizeof(QMMIA::QbmmiaWithoutBatchTilingData), 0UL);
51#endif51#endif
52}52}
@@ -38,10 +38,7 @@ protected:
38TEST_P(QBMIIA_950_hif8, generalTest)38TEST_P(QBMIIA_950_hif8, generalTest)
39{39{
40 QuantBatchMatmulInplaceAddTestParam param = GetParam();40 QuantBatchMatmulInplaceAddTestParam param = GetParam();
41- auto it = s_funcMapApt.find(param.tilingKey);41+ QuantBatchMatmulInplaceAddTestUtils::TestOneParamCase950(param, s_funcMapApt);
42- ASSERT_NE(it, s_funcMapApt.end());
43- ASSERT_NE(it->second, nullptr);
44- ASSERT_GT(sizeof(QMMIA::QuantBatchMatmulInplaceAddTilingData), 0UL);
45}42}
46 43 
47INSTANTIATE_TEST_CASE_P(QBMIIA950, QBMIIA_950_hif8,44INSTANTIATE_TEST_CASE_P(QBMIIA950, QBMIIA_950_hif8,
@@ -18,17 +18,17 @@
18#include "arch35/quant_batch_matmul_inplace_add_tiling_data.h"18#include "arch35/quant_batch_matmul_inplace_add_tiling_data.h"
19 19 
20template <typename T>20template <typename T>
21-inline void InitQuantBatchMatmulInplaceAddTilingData(uint8_t* tiling, T* constData)21+inline void InitQbmmiaTilingData(uint8_t* tiling, T* constData)
22{22{
23 memcpy(constData, tiling, sizeof(T));23 memcpy(constData, tiling, sizeof(T));
24}24}
25 25 
26-#define GET_TILING_DATA(tiling_data, tiling_arg) \26+#define GET_TILING_DATA(tiling_data, tiling_arg) \
27- QMMIA::QuantBatchMatmulInplaceAddTilingData tiling_data; \27+ QMMIA::QbmmiaTilingData tiling_data; \
28- InitQuantBatchMatmulInplaceAddTilingData(tiling_arg, &tiling_data)28+ InitQbmmiaTilingData(tiling_arg, &tiling_data)
29 29 
30#define GET_TILING_DATA_WITH_STRUCT(tiling_struct, tiling_data, tiling_arg) \30#define GET_TILING_DATA_WITH_STRUCT(tiling_struct, tiling_data, tiling_arg) \
31 tiling_struct tiling_data; \31 tiling_struct tiling_data; \
32- InitQuantBatchMatmulInplaceAddTilingData(tiling_arg, &tiling_data)32+ InitQbmmiaTilingData(tiling_arg, &tiling_data)
33 33 
34#endif // QUANT_BATCH_MATMUL_INPLACE_ADD_TILING_DEF_H34#endif // QUANT_BATCH_MATMUL_INPLACE_ADD_TILING_DEF_H
@@ -1,4 +1,4 @@
1socVersion,caseName,kernelUtTarget,prefix,coreNum,batchA,batchB,batchC,m,k,n,transA,transB,groupSize,hasX1Scale,hasX2Scale,result,numBlocks,tilingKey,tilingData,comment1socVersion,caseName,kernelUtTarget,prefix,coreNum,batchA,batchB,batchC,m,k,n,transA,transB,groupSize,hasX1Scale,hasX2Scale,result,numBlocks,tilingKey,tilingData,comment
2Ascend950,hif8_tt,HIF8_FLOW,kernel,,1,1,1,128,512,128,1,0,0,1,1,TRUE,16,1,AUTO,FALSE2Ascend950,hif8_tt,HIF8_FLOW,kernel,,1,1,1,128,512,128,1,0,0,1,1,TRUE,16,1,AUTO,FALSE
3-Ascend950,mx_2,MX_FLOW,kernel,,1,1,1,1024,512,1024,1,0,32,1,1,TRUE,32,33,AUTO,FALSE3+Ascend950,mx_2,MX_FLOW,kernel,,1,1,1,1024,512,1024,1,0,32,1,1,TRUE,32,1,AUTO,FALSE
4-Ascend950,mx_test1,MX_FLOW,kernel,,1,1,1,128,512,128,1,0,32,1,1,TRUE,16,33,AUTO,FALSE4+Ascend950,mx_test1,MX_FLOW,kernel,,1,1,1,128,512,128,1,0,32,1,1,TRUE,16,1,AUTO,FALSE
@@ -35,12 +35,6 @@
35 35 
36using namespace QuantBatchMatmulInplaceAddArch35TilingKey;36using namespace QuantBatchMatmulInplaceAddArch35TilingKey;
37 37 
38-#if SUPPORT_MX_WITHOUT_BATCH_TILING_KEY
39-#define QBMIIA_UT_SUPPORT_MX_WITHOUT_BATCH 1
40-#else
41-#define QBMIIA_UT_SUPPORT_MX_WITHOUT_BATCH 0
42-#endif
43- 
44#define QBMIIA_PARAM_LIST_DEF \38#define QBMIIA_PARAM_LIST_DEF \
45 GM_ADDR x1, GM_ADDR x2, GM_ADDR x2Scale, GM_ADDR yIn, GM_ADDR x1Scale, GM_ADDR y, GM_ADDR workspace, GM_ADDR tiling39 GM_ADDR x1, GM_ADDR x2, GM_ADDR x2Scale, GM_ADDR yIn, GM_ADDR x1Scale, GM_ADDR y, GM_ADDR workspace, GM_ADDR tiling
46 40 
@@ -50,11 +44,9 @@ using QuantBatchMatmulInplaceAddAptFunc = void (*)(GM_ADDR, GM_ADDR, GM_ADDR, GM
50 GM_ADDR);44 GM_ADDR);
51 45 
52static std::unordered_map<uint64_t, QuantBatchMatmulInplaceAddAptFunc> s_funcMapApt = {46static std::unordered_map<uint64_t, QuantBatchMatmulInplaceAddAptFunc> s_funcMapApt = {
53- {1UL, quant_batch_matmul_inplace_add<1, 0, TPL_NO_VEC_EPILOGUE_WITH_MMAPI>},47+#if SUPPORT_WITHOUT_BATCH_TILING_KEY
54- {17UL, quant_batch_matmul_inplace_add<1, 0, TPL_NO_VEC_EPILOGUE_CUSTOM_GMTOAL1_WITH_MMAPI>},48+ {1UL, quant_batch_matmul_inplace_add<1, 0, TPL_NO_VEC_EPILOGUE_WITH_MMAPI_WITHOUT_BATCH>},
55-#if QBMIIA_UT_SUPPORT_MX_WITHOUT_BATCH49+ {17UL, quant_batch_matmul_inplace_add<1, 0, TPL_NO_VEC_EPILOGUE_CUSTOM_GMTOAL1_WITH_MMAPI_WITHOUT_BATCH>},
56- {33UL, quant_batch_matmul_inplace_add<1, 0, TPL_NO_VEC_EPILOGUE_WITH_MMAPI_WITHOUT_BATCH>},
57- {49UL, quant_batch_matmul_inplace_add<1, 0, TPL_NO_VEC_EPILOGUE_CUSTOM_GMTOAL1_WITH_MMAPI_WITHOUT_BATCH>},
58#endif50#endif
59};51};
60#endif52#endif
@@ -173,9 +165,7 @@ public:
173 }165 }
174 166 
175#if defined(__CCE_AICORE__) && __CCE_AICORE__ == 310167#if defined(__CCE_AICORE__) && __CCE_AICORE__ == 310
176- static constexpr bool IsMxWithoutBatchUtSupported() { return QBMIIA_UT_SUPPORT_MX_WITHOUT_BATCH != 0; }168+ static bool IsWithoutBatchTilingData(const QuantBatchMatmulInplaceAddTestParam& param)
177- 
178- static bool IsMxWithoutBatchTilingData(const QuantBatchMatmulInplaceAddTestParam& param)
179 {169 {
180 constexpr uint64_t kernelTypeShift = 4UL;170 constexpr uint64_t kernelTypeShift = 4UL;
181 constexpr uint64_t kernelTypeMask = 0xFUL;171 constexpr uint64_t kernelTypeMask = 0xFUL;
@@ -184,21 +174,16 @@ public:
184 kernelType == TPL_NO_VEC_EPILOGUE_CUSTOM_GMTOAL1_WITH_MMAPI_WITHOUT_BATCH;174 kernelType == TPL_NO_VEC_EPILOGUE_CUSTOM_GMTOAL1_WITH_MMAPI_WITHOUT_BATCH;
185 }175 }
186 176 
187- static bool ShouldSkipMxWithoutBatchUt(const QuantBatchMatmulInplaceAddTestParam& param)
188- {
189- return IsMxWithoutBatchTilingData(param) && !IsMxWithoutBatchUtSupported();
190- }
191- 
192 static size_t GetTilingDataSize(const QuantBatchMatmulInplaceAddTestParam& param)177 static size_t GetTilingDataSize(const QuantBatchMatmulInplaceAddTestParam& param)
193 {178 {
194- if (IsMxWithoutBatchTilingData(param)) {179+ if (IsWithoutBatchTilingData(param)) {
195- return sizeof(QMMIA::QuantBatchMatmulInplaceAddTensorAPIWithoutBatchTilingData);180+ return sizeof(QMMIA::QbmmiaWithoutBatchTilingData);
196 }181 }
197- return sizeof(QMMIA::QuantBatchMatmulInplaceAddTilingData);182+ return sizeof(QMMIA::QbmmiaTilingData);
198 }183 }
199 184 
200 static void InitDefaultTilingData(const QuantBatchMatmulInplaceAddTestParam& param,185 static void InitDefaultTilingData(const QuantBatchMatmulInplaceAddTestParam& param,
201- QMMIA::QuantBatchMatmulInplaceAddTilingData& tilingData)186+ QMMIA::QbmmiaTilingData& tilingData)
202 {187 {
203 memset(&tilingData, 0, sizeof(tilingData));188 memset(&tilingData, 0, sizeof(tilingData));
204 tilingData.params.batchA = static_cast<uint32_t>(param.batchA > 0 ? param.batchA : 1);189 tilingData.params.batchA = static_cast<uint32_t>(param.batchA > 0 ? param.batchA : 1);
@@ -218,10 +203,10 @@ public:
218 tilingData.adaptiveSlidingWin.nBaseTailSplitCnt = 1;203 tilingData.adaptiveSlidingWin.nBaseTailSplitCnt = 1;
219 }204 }
220 205 
221- static void InitDefaultWithoutBatchTilingData(206+ static void InitDefaultWithoutBatchTilingData(const QuantBatchMatmulInplaceAddTestParam& param,
222- const QuantBatchMatmulInplaceAddTestParam& param,207+ QMMIA::QbmmiaWithoutBatchTilingData& tilingData)
223- QMMIA::QuantBatchMatmulInplaceAddTensorAPIWithoutBatchTilingData& tilingData)
224 {208 {
209+ constexpr uint8_t PERTENSOR_MODE = 0x1U;
225 constexpr uint8_t MX_PERGROUP_MODE = 0x1U << 3;210 constexpr uint8_t MX_PERGROUP_MODE = 0x1U << 3;
226 memset(&tilingData, 0, sizeof(tilingData));211 memset(&tilingData, 0, sizeof(tilingData));
227 tilingData.m = static_cast<uint32_t>(param.m);212 tilingData.m = static_cast<uint32_t>(param.m);
@@ -230,14 +215,14 @@ public:
230 tilingData.baseM = static_cast<uint16_t>(std::min<int64_t>(param.m, 128));215 tilingData.baseM = static_cast<uint16_t>(std::min<int64_t>(param.m, 128));
231 tilingData.baseN = static_cast<uint16_t>(std::min<int64_t>(param.n, 128));216 tilingData.baseN = static_cast<uint16_t>(std::min<int64_t>(param.n, 128));
232 tilingData.baseK = static_cast<uint16_t>(std::min<int64_t>(param.k, 64));217 tilingData.baseK = static_cast<uint16_t>(std::min<int64_t>(param.k, 64));
233- tilingData.scaleKL1 = static_cast<uint32_t>(tilingData.baseK);218+ tilingData.scaleKL1 = param.groupSize > 0 ? static_cast<uint32_t>(tilingData.baseK) : 0U;
234 tilingData.groupSizeK = static_cast<uint16_t>(param.groupSize);219 tilingData.groupSizeK = static_cast<uint16_t>(param.groupSize);
235 tilingData.mBaseTailSplitCnt = 1;220 tilingData.mBaseTailSplitCnt = 1;
236 tilingData.nBaseTailSplitCnt = 1;221 tilingData.nBaseTailSplitCnt = 1;
237 tilingData.kAL1 = tilingData.baseK;222 tilingData.kAL1 = tilingData.baseK;
238 tilingData.kBL1 = tilingData.baseK;223 tilingData.kBL1 = tilingData.baseK;
239- tilingData.x1QuantMode = MX_PERGROUP_MODE;224+ tilingData.x1QuantMode = param.groupSize > 0 ? MX_PERGROUP_MODE : PERTENSOR_MODE;
240- tilingData.x2QuantMode = MX_PERGROUP_MODE;225+ tilingData.x2QuantMode = param.groupSize > 0 ? MX_PERGROUP_MODE : PERTENSOR_MODE;
241 tilingData.nBufferNum = 2;226 tilingData.nBufferNum = 2;
242 tilingData.dbL0C = 2;227 tilingData.dbL0C = 2;
243 }228 }
@@ -246,12 +231,12 @@ public:
246 {231 {
247 size_t tilingDataSize = GetTilingDataSize(param);232 size_t tilingDataSize = GetTilingDataSize(param);
248 if (param.tilingData.empty() || param.tilingData == "AUTO") {233 if (param.tilingData.empty() || param.tilingData == "AUTO") {
249- if (IsMxWithoutBatchTilingData(param)) {234+ if (IsWithoutBatchTilingData(param)) {
250- QMMIA::QuantBatchMatmulInplaceAddTensorAPIWithoutBatchTilingData tilingStruct;235+ QMMIA::QbmmiaWithoutBatchTilingData tilingStruct;
251 InitDefaultWithoutBatchTilingData(param, tilingStruct);236 InitDefaultWithoutBatchTilingData(param, tilingStruct);
252 memcpy(tiling, &tilingStruct, tilingDataSize);237 memcpy(tiling, &tilingStruct, tilingDataSize);
253 } else {238 } else {
254- QMMIA::QuantBatchMatmulInplaceAddTilingData tilingStruct;239+ QMMIA::QbmmiaTilingData tilingStruct;
255 InitDefaultTilingData(param, tilingStruct);240 InitDefaultTilingData(param, tilingStruct);
256 memcpy(tiling, &tilingStruct, tilingDataSize);241 memcpy(tiling, &tilingStruct, tilingDataSize);
257 }242 }
@@ -299,15 +284,6 @@ public:
299 static void TestOneParamCase950(const QuantBatchMatmulInplaceAddTestParam& param,284 static void TestOneParamCase950(const QuantBatchMatmulInplaceAddTestParam& param,
300 decltype(s_funcMapApt)& funcMapApt)285 decltype(s_funcMapApt)& funcMapApt)
301 {286 {
302- if (ShouldSkipMxWithoutBatchUt(param)) {
303-#ifdef __CCE_KT_TEST__
304- GTEST_SKIP() << "Skip MX without-batch TensorAPI UT before asc-devkit 9.1.0: " << param.caseName;
305-#else
306- cout << "Skip MX without-batch TensorAPI UT before asc-devkit 9.1.0: " << param.caseName << endl;
307- return;
308-#endif
309- }
310- 
311 int64_t batchA = param.batchA > 0 ? param.batchA : 1L;287 int64_t batchA = param.batchA > 0 ? param.batchA : 1L;
312 int64_t batchB = param.batchB > 0 ? param.batchB : 1L;288 int64_t batchB = param.batchB > 0 ? param.batchB : 1L;
313 int64_t batchC = param.batchC > 0 ? param.batchC : 1L;289 int64_t batchC = param.batchC > 0 ? param.batchC : 1L;
@@ -13,6 +13,8 @@
13 * \brief13 * \brief
14 */14 */
15 15 
16+#include <algorithm>
17+ 
16#include "common/op_host/op_tiling/tiling_type_mm.h"18#include "common/op_host/op_tiling/tiling_type_mm.h"
17#include "log/log.h"19#include "log/log.h"
18#include "error_util.h"20#include "error_util.h"
@@ -23,6 +25,11 @@
23#include "quant_batch_matmul_v3_tiling_strategy.h"25#include "quant_batch_matmul_v3_tiling_strategy.h"
24 26 
25namespace {27namespace {
28+constexpr uint64_t MIN_REDUCED_STEP_K = 2UL;
29+constexpr uint64_t MAX_REDUCED_STEP_K = 8UL;
30+// Keep A full-load if repeated A reads exceed this share of estimated non-full-load A/B traffic.
31+constexpr double REPEAT_A_LOAD_RATIO_THRESHOLD = 0.20;
32+ 
26const std::vector<int32_t> supportedNpuArch = {static_cast<int32_t>(NpuArch::DAV_3510),33const std::vector<int32_t> supportedNpuArch = {static_cast<int32_t>(NpuArch::DAV_3510),
27 static_cast<int32_t>(NpuArch::DAV_RESV)};34 static_cast<int32_t>(NpuArch::DAV_RESV)};
28constexpr int32_t TILING_PRIORITY = optiling::strategy::CUBE_BASIC_API_ASW;35constexpr int32_t TILING_PRIORITY = optiling::strategy::CUBE_BASIC_API_ASW;
@@ -53,6 +60,16 @@ void AdaptiveSlidingWindowCubeBasicAPITiling::ResetTilingData()
53 if (!isTilingOut_) {60 if (!isTilingOut_) {
54 tilingData_ = DequantBmm::QuantBatchMatmulV3BasicAPITilingData();61 tilingData_ = DequantBmm::QuantBatchMatmulV3BasicAPITilingData();
55 }62 }
63+ withoutBatchTilingData_ = DequantBmm::QuantBatchMatmulV3TensorAPIWithoutBatchTilingData();
64+ useWithoutBatchTilingData_ = false;
65+ tilingDataSize_ = sizeof(DequantBmm::QuantBatchMatmulV3BasicAPITilingData);
66+}
67+ 
68+bool AdaptiveSlidingWindowCubeBasicAPITiling::IsWithoutBatchTilingData() const
69+{
70+ // The software S4S4 fallback needs AIV preprocessing and the full tiling data layout.
71+ return compileInfo_.npuArch == NpuArch::DAV_3510 && IsTensorApiEnabled() && inputParams_.batchC == 1UL &&
72+ !isSupportS4S4_;
56}73}
57 74 
58bool AdaptiveSlidingWindowCubeBasicAPITiling::IsCapable()75bool AdaptiveSlidingWindowCubeBasicAPITiling::IsCapable()
@@ -95,7 +112,11 @@ ge::graphStatus AdaptiveSlidingWindowCubeBasicAPITiling::GetWorkspaceSize()
95 112 
96uint64_t AdaptiveSlidingWindowCubeBasicAPITiling::GetBatchCoreCnt() const { return inputParams_.batchC; }113uint64_t AdaptiveSlidingWindowCubeBasicAPITiling::GetBatchCoreCnt() const { return inputParams_.batchC; }
97 114 
98-const void* AdaptiveSlidingWindowCubeBasicAPITiling::GetTilingData() const { return &tilingData_; }115+const void* AdaptiveSlidingWindowCubeBasicAPITiling::GetTilingData() const
116+{
117+ return useWithoutBatchTilingData_ ? static_cast<const void*>(&withoutBatchTilingData_) :
118+ static_cast<const void*>(&tilingData_);
119+}
99 120 
100uint64_t AdaptiveSlidingWindowCubeBasicAPITiling::GetKernelType() const121uint64_t AdaptiveSlidingWindowCubeBasicAPITiling::GetKernelType() const
101{122{
@@ -112,12 +133,12 @@ uint64_t AdaptiveSlidingWindowCubeBasicAPITiling::GetApiLevel(NpuArch npuArch) c
112{133{
113 switch (npuArch) {134 switch (npuArch) {
114 case NpuArch::DAV_3510: {135 case NpuArch::DAV_3510: {
115- const bool isTensorapiCapable = IsTensorapiCapable();136+ const bool tensorApiEnabled = IsTensorApiEnabled();
116- if (inputParams_.bFormat == ge::FORMAT_FRACTAL_NZ && !isTensorapiCapable) {137+ if (inputParams_.bFormat == ge::FORMAT_FRACTAL_NZ && !tensorApiEnabled) {
117 return static_cast<uint64_t>(QMMApiLevel::HIGH_LEVEL);138 return static_cast<uint64_t>(QMMApiLevel::HIGH_LEVEL);
118 }139 }
119- return isTensorapiCapable ? static_cast<uint64_t>(QMMApiLevel::BLAZE_LEVEL) :140+ return tensorApiEnabled ? static_cast<uint64_t>(QMMApiLevel::BLAZE_LEVEL) :
120- static_cast<uint64_t>(QMMApiLevel::BASIC_LEVEL);141+ static_cast<uint64_t>(QMMApiLevel::BASIC_LEVEL);
121 }142 }
122 case NpuArch::DAV_RESV:143 case NpuArch::DAV_RESV:
123 if (inputParams_.aDtype == ge::DT_INT8 && inputParams_.bDtype == ge::DT_INT8 &&144 if (inputParams_.aDtype == ge::DT_INT8 && inputParams_.bDtype == ge::DT_INT8 &&
@@ -130,6 +151,30 @@ uint64_t AdaptiveSlidingWindowCubeBasicAPITiling::GetApiLevel(NpuArch npuArch) c
130 }151 }
131}152}
132 153 
154+uint64_t AdaptiveSlidingWindowCubeBasicAPITiling::GetBatchMode() const
155+{
156+ return IsWithoutBatchTilingData() ? static_cast<uint64_t>(BatchMode::WITHOUT_BATCH) :
157+ static_cast<uint64_t>(BatchMode::WITH_BATCH);
158+}
159+ 
160+bool AdaptiveSlidingWindowCubeBasicAPITiling::CalcBasicBlock()
161+{
162+ if (compileInfo_.npuArch != NpuArch::DAV_3510) {
163+ return AdaptiveSlidingWindowTiling::CalcBasicBlock();
164+ }
165+ BaseBlockMode mode = compileInfo_.supportMmadS8S4 ? BaseBlockMode::MMAD_S8S4 : BaseBlockMode::CUBE_BASIC;
166+ BaseBlockCalculator calculator(inputParams_, compileInfo_, GetBatchCoreCnt());
167+ if (!calculator.Compute(mode)) {
168+ return false;
169+ }
170+ const BaseBlockRes& baseBlockRes = calculator.GetOutput();
171+ adaptiveWin_.baseM = baseBlockRes.baseM;
172+ adaptiveWin_.baseN = baseBlockRes.baseN;
173+ adaptiveWin_.baseK = baseBlockRes.baseK;
174+ adaptiveWin_.useTailWinLogic = baseBlockRes.useTailWinLogic;
175+ return true;
176+}
177+ 
133bool AdaptiveSlidingWindowCubeBasicAPITiling::CalL1Tiling()178bool AdaptiveSlidingWindowCubeBasicAPITiling::CalL1Tiling()
134{179{
135 basicTiling_.usedCoreNum = CalUsedCoreNum();180 basicTiling_.usedCoreNum = CalUsedCoreNum();
@@ -183,11 +228,31 @@ ge::graphStatus AdaptiveSlidingWindowCubeBasicAPITiling::DoLibApiTiling()
183 tilingData_.matmulTiling.baseK = basicTiling_.baseK;228 tilingData_.matmulTiling.baseK = basicTiling_.baseK;
184 tilingData_.matmulTiling.isBias = inputParams_.hasBias ? 1UL : 0UL;229 tilingData_.matmulTiling.isBias = inputParams_.hasBias ? 1UL : 0UL;
185 tilingData_.matmulTiling.dbL0C = static_cast<uint8_t>(basicTiling_.dbL0c);230 tilingData_.matmulTiling.dbL0C = static_cast<uint8_t>(basicTiling_.dbL0c);
186- CalculateNBufferNum4Cube();231+ CalculateNBufferNum();
232+ if (useWithoutBatchTilingData_) {
233+ SetWithoutBatchTilingData();
234+ }
187 return ge::GRAPH_SUCCESS;235 return ge::GRAPH_SUCCESS;
188}236}
189 237 
190-void AdaptiveSlidingWindowCubeBasicAPITiling::CalculateNBufferNum4Cube()238+void AdaptiveSlidingWindowCubeBasicAPITiling::CalculateNBufferNum()
239+{
240+ if (compileInfo_.npuArch != NpuArch::DAV_3510) {
241+ CalculateLegacyNBufferNum();
242+ return;
243+ }
244+ 
245+ const uint64_t currentKAL1 = static_cast<uint64_t>(basicTiling_.stepKa) * tilingData_.matmulTiling.baseK;
246+ const uint64_t currentKBL1 = static_cast<uint64_t>(basicTiling_.stepKb) * tilingData_.matmulTiling.baseK;
247+ const CubeL1Context ctx = {tilingData_.matmulTiling.baseM, tilingData_.matmulTiling.baseN,
248+ tilingData_.matmulTiling.baseK, isAFullLoad_};
249+ const CubeL1Plan plan = SelectCubeL1Plan(ctx, currentKAL1, currentKBL1);
250+ tilingData_.matmulTiling.kAL1 = static_cast<uint32_t>(plan.kAL1);
251+ tilingData_.matmulTiling.kBL1 = static_cast<uint32_t>(plan.kBL1);
252+ tilingData_.matmulTiling.nBufferNum = static_cast<uint8_t>(plan.l1BufferNum);
253+}
254+ 
255+void AdaptiveSlidingWindowCubeBasicAPITiling::CalculateLegacyNBufferNum()
191{256{
192 tilingData_.matmulTiling.kAL1 = basicTiling_.stepKa * tilingData_.matmulTiling.baseK;257 tilingData_.matmulTiling.kAL1 = basicTiling_.stepKa * tilingData_.matmulTiling.baseK;
193 tilingData_.matmulTiling.kBL1 = basicTiling_.stepKb * tilingData_.matmulTiling.baseK;258 tilingData_.matmulTiling.kBL1 = basicTiling_.stepKb * tilingData_.matmulTiling.baseK;
@@ -234,26 +299,252 @@ void AdaptiveSlidingWindowCubeBasicAPITiling::CalculateNBufferNum4Cube()
234 }299 }
235}300}
236 301 
302+AdaptiveSlidingWindowCubeBasicAPITiling::CubeL1Plan AdaptiveSlidingWindowCubeBasicAPITiling::SelectCubeL1Plan(
303+ const CubeL1Context& ctx, uint64_t currentKAL1, uint64_t currentKBL1) const
304+{
305+ // Fallback: keep the caller's current (possibly asymmetric) two-buffer plan.
306+ CubeL1Plan plan = {currentKAL1, currentKBL1, qmmv3_tiling_const::L1_TWO_BUFFER};
307+ 
308+ // Both callers supply positive L1 steps with kL1 = stepK * baseK. Collapse them onto the shared minimum step so a
309+ // promoted plan uses one symmetric kL1 for A and B.
310+ const uint64_t baseK = ctx.baseK;
311+ const uint64_t currentStepK = ctx.isAFullLoad ? currentKBL1 / baseK : std::min(currentKAL1, currentKBL1) / baseK;
312+ const uint64_t currentKL1 = currentStepK * baseK;
313+ 
314+ // Candidate 1: four buffers at the current step. Unconditional (legacy behavior); it only needs to fit L1.
315+ if (CanFitL1BufferNum(ctx, currentKL1, qmmv3_tiling_const::L1_FOUR_BUFFER)) {
316+ return {currentKL1, currentKL1, qmmv3_tiling_const::L1_FOUR_BUFFER};
317+ }
318+ 
319+ // Candidates 2-4 only pay off when the roofline is MTE2-bound; A-full-load is always treated as bound.
320+ const bool isMte2Bound = ctx.isAFullLoad || IsMte2Bound(qmmv3_tiling_const::ASCEND_950_MAX_HBM_BW_TBPS *
321+ qmmv3_tiling_const::MTE2_BW_UTILIZATION,
322+ qmmv3_tiling_const::ASCEND_950_MAX_L2_BW_TBPS *
323+ qmmv3_tiling_const::MTE2_BW_UTILIZATION);
324+ if (!isMte2Bound) {
325+ return plan;
326+ }
327+ 
328+ // Candidate 2: four buffers at a reduced step.
329+ if (TryApplyReducedStepK(plan, ctx, currentKL1, qmmv3_tiling_const::L1_FOUR_BUFFER)) {
330+ return plan;
331+ }
332+ 
333+ // Candidate 3: three buffers at the current step. Collapsing an asymmetric plan onto the shared step needs the
334+ // same K-inner alignment as the reduced-step candidates; a symmetric plan is always allowed.
335+ const bool isDirectPromoteAllowed = currentKAL1 == currentKBL1 || AreKInnerAxesAligned();
336+ if (isDirectPromoteAllowed && CanFitL1BufferNum(ctx, currentKL1, qmmv3_tiling_const::L1_THREE_BUFFER)) {
337+ return {currentKL1, currentKL1, qmmv3_tiling_const::L1_THREE_BUFFER};
338+ }
339+ 
340+ // Candidate 4: three buffers at a reduced step; otherwise keep the two-buffer fallback.
341+ (void)TryApplyReducedStepK(plan, ctx, currentKL1, qmmv3_tiling_const::L1_THREE_BUFFER);
342+ return plan;
343+}
344+ 
345+bool AdaptiveSlidingWindowCubeBasicAPITiling::TryApplyReducedStepK(CubeL1Plan& plan, const CubeL1Context& ctx,
346+ uint64_t currentKL1, uint32_t l1BufferNum) const
347+{
348+ const uint64_t baseK = ctx.baseK;
349+ const uint64_t currentStepK = currentKL1 / baseK;
350+ const bool isCurrentTwoBufferNotOverK = currentKL1 * qmmv3_tiling_const::L1_TWO_BUFFER < inputParams_.kSize;
351+ if (currentStepK <= MIN_REDUCED_STEP_K || !isCurrentTwoBufferNotOverK || !AreKInnerAxesAligned()) {
352+ return false;
353+ }
354+ const uint64_t reducedStepK = SelectReducedStepK(ctx, currentKL1, l1BufferNum);
355+ if (reducedStepK == 0UL) {
356+ return false;
357+ }
358+ const uint64_t reducedKL1 = reducedStepK * baseK;
359+ if (!CanFitL1BufferNum(ctx, reducedKL1, l1BufferNum)) {
360+ return false;
361+ }
362+ plan = {reducedKL1, reducedKL1, l1BufferNum};
363+ return true;
364+}
365+ 
366+uint64_t AdaptiveSlidingWindowCubeBasicAPITiling::SelectReducedStepK(const CubeL1Context& ctx, uint64_t currentKL1,
367+ uint32_t l1BufferNum) const
368+{
369+ // SelectCubeL1Plan has already checked the reduced-step eligibility.
370+ const uint64_t baseK = ctx.baseK;
371+ const uint64_t currentStepK = currentKL1 / baseK;
372+ // baseK has already been bounded by the L0A/L0B double-buffer capacity. stepK only groups baseK tiles in L1, so
373+ // the L0 max-baseK formula is not a stepK limit. Bound this reduced search by the remaining K tiles, the current
374+ // step and the issue-queue search cap instead.
375+ const uint64_t kStepCount = ops::CeilDiv(inputParams_.kSize, baseK);
376+ const uint64_t maxCandidateStepK = std::min(std::min(currentStepK - 1UL, kStepCount), MAX_REDUCED_STEP_K);
377+ if (maxCandidateStepK < MIN_REDUCED_STEP_K) {
378+ return 0UL;
379+ }
380+ 
381+ // Search from large to small. When K is an operand's inner axis, its candidate kL1 must be 256-byte aligned.
382+ for (uint64_t stepK = maxCandidateStepK; stepK >= MIN_REDUCED_STEP_K; --stepK) {
383+ const uint64_t kL1 = baseK * stepK;
384+ if (IsKInnerKL1AlignedTo256Bytes(kL1) && CanFitL1BufferNum(ctx, kL1, l1BufferNum)) {
385+ return stepK;
386+ }
387+ if (stepK == MIN_REDUCED_STEP_K) {
388+ break;
389+ }
390+ }
391+ return 0UL;
392+}
393+ 
394+bool AdaptiveSlidingWindowCubeBasicAPITiling::CanFitL1BufferNum(const CubeL1Context& ctx, uint64_t kL1,
395+ uint32_t l1BufferNum) const
396+{
397+ if (l1BufferNum == qmmv3_tiling_const::L1_THREE_BUFFER && !IsTensorApiEnabled()) {
398+ return false;
399+ }
400+ return CalcUsedL1Size(ctx, kL1, l1BufferNum) <= aicoreParams_.l1Size;
401+}
402+ 
403+uint64_t AdaptiveSlidingWindowCubeBasicAPITiling::CalcUsedL1Size(const CubeL1Context& ctx, uint64_t kL1,
404+ uint32_t l1BufferNum) const
405+{
406+ const uint64_t bL1OneBuffer = GetSizeWithDataType(ctx.baseN * kL1, inputParams_.bDtype);
407+ // TT passes a scalar scale directly to Fixpipe. TC keeps baseN scale values in each of its two scale slots.
408+ const uint64_t scaleL1OneBuffer = inputParams_.isPerChannel ?
409+ GetSizeWithDataType(ctx.baseN, inputParams_.scaleDtype) :
410+ 0UL;
411+ const uint64_t biasL1OneBuffer = inputParams_.hasBias ? GetSizeWithDataType(ctx.baseN, inputParams_.biasDtype) :
412+ 0UL;
413+ const uint64_t aL1OneBuffer = ctx.isAFullLoad ? CalcAFullLoadL1Size(ctx.baseM) :
414+ GetSizeWithDataType(ctx.baseM * kL1, inputParams_.aDtype);
415+ return bL1OneBuffer * l1BufferNum + scaleL1OneBuffer * qmmv3_tiling_const::L1_TWO_BUFFER +
416+ biasL1OneBuffer * qmmv3_tiling_const::L1_TWO_BUFFER +
417+ (ctx.isAFullLoad ? aL1OneBuffer : aL1OneBuffer * l1BufferNum);
418+}
419+ 
420+uint64_t AdaptiveSlidingWindowCubeBasicAPITiling::CalcAFullLoadL1Size(uint64_t baseM) const
421+{
422+ if (inputParams_.transA) {
423+ return baseM * GetSizeWithDataType(ops::CeilAlign(inputParams_.kSize, qmmv3_tiling_const::CUBE_BLOCK),
424+ inputParams_.aDtype);
425+ }
426+ return baseM * ops::CeilAlign(GetSizeWithDataType(inputParams_.kSize, inputParams_.aDtype),
427+ qmmv3_tiling_const::CUBE_REDUCE_BLOCK);
428+}
429+ 
430+// Use the padded L1 layout as a proxy for full-K data traffic.
431+uint64_t AdaptiveSlidingWindowCubeBasicAPITiling::CalcAFullKLoadSize(uint64_t mSize) const
432+{
433+ const uint64_t aReduceAlign = GetShapeWithDataType(qmmv3_tiling_const::CUBE_REDUCE_BLOCK, inputParams_.aDtype);
434+ const uint64_t alignedM = ops::CeilAlign(mSize,
435+ inputParams_.transA ? aReduceAlign : qmmv3_tiling_const::CUBE_BLOCK);
436+ const uint64_t fullKa = ops::CeilAlign(inputParams_.kSize,
437+ inputParams_.transA ? qmmv3_tiling_const::CUBE_BLOCK : aReduceAlign);
438+ return GetSizeWithDataType(alignedM * fullKa, inputParams_.aDtype);
439+}
440+ 
441+uint64_t AdaptiveSlidingWindowCubeBasicAPITiling::CalcBFullKLoadSize(uint64_t nSize) const
442+{
443+ const uint64_t bReduceAlign = GetShapeWithDataType(qmmv3_tiling_const::CUBE_REDUCE_BLOCK, inputParams_.bDtype);
444+ const uint64_t alignedN = ops::CeilAlign(nSize,
445+ inputParams_.transB ? qmmv3_tiling_const::CUBE_BLOCK : bReduceAlign);
446+ const uint64_t fullKb = ops::CeilAlign(inputParams_.kSize,
447+ inputParams_.transB ? bReduceAlign : qmmv3_tiling_const::CUBE_BLOCK);
448+ return GetSizeWithDataType(alignedN * fullKb, inputParams_.bDtype);
449+}
450+ 
451+bool AdaptiveSlidingWindowCubeBasicAPITiling::ShouldKeepAFullLoadByRepeatLoadRatio() const
452+{
453+ if (adaptiveWin_.nBlockCnt <= 1UL) {
454+ return false;
455+ }
456+ const double singleRoundABytes = static_cast<double>(CalcAFullKLoadSize(inputParams_.mSize));
457+ const double repeatABytes = singleRoundABytes * static_cast<double>(adaptiveWin_.nBlockCnt - 1UL);
458+ const double nonFullLoadABytes = singleRoundABytes * static_cast<double>(adaptiveWin_.nBlockCnt);
459+ double singleRoundBBytes = static_cast<double>(CalcBFullKLoadSize(inputParams_.nSize));
460+ if (inputParams_.isPerChannel) {
461+ singleRoundBBytes += static_cast<double>(GetSizeWithDataType(inputParams_.nSize, inputParams_.scaleDtype));
462+ }
463+ const double nonFullLoadBBytes = singleRoundBBytes * static_cast<double>(adaptiveWin_.mBlockCnt);
464+ const double totalLoadBytes = nonFullLoadABytes + nonFullLoadBBytes;
465+ return repeatABytes / totalLoadBytes > REPEAT_A_LOAD_RATIO_THRESHOLD;
466+}
467+ 
468+bool AdaptiveSlidingWindowCubeBasicAPITiling::IsMte2Bound(double gmBandwidthTbps, double l2BandwidthTbps) const
469+{
470+ return !AreOperandInnerAxesAligned() || EstimateMte2TimeUs(gmBandwidthTbps, l2BandwidthTbps) > EstimateMacTimeUs();
471+}
472+ 
473+double AdaptiveSlidingWindowCubeBasicAPITiling::EstimateMte2TimeUs(double gmBandwidthTbps, double l2BandwidthTbps) const
474+{
475+ const double singleRoundABytes = static_cast<double>(CalcAFullKLoadSize(inputParams_.mSize));
476+ double singleRoundBBytes = static_cast<double>(CalcBFullKLoadSize(inputParams_.nSize));
477+ if (inputParams_.isPerChannel) {
478+ singleRoundBBytes += static_cast<double>(GetSizeWithDataType(inputParams_.nSize, inputParams_.scaleDtype));
479+ }
480+ const double singleRoundBiasBytes = inputParams_.hasBias ? static_cast<double>(GetSizeWithDataType(
481+ inputParams_.nSize, inputParams_.biasDtype)) :
482+ 0.0;
483+ const uint64_t batchCount = std::max<uint64_t>(1UL, inputParams_.batchC);
484+ // This estimate is used only for non-full plans, which reload A for every N block.
485+ const uint64_t aLoadCount = batchCount * adaptiveWin_.nBlockCnt;
486+ const uint64_t bLoadCount = batchCount * adaptiveWin_.mBlockCnt;
487+ const uint64_t biasLoadCount = inputParams_.hasBias ? batchCount * adaptiveWin_.mBlockCnt : 0UL;
488+ const Mte2LoadEstimate estimate = {singleRoundABytes, singleRoundBBytes, singleRoundBiasBytes,
489+ aLoadCount, bLoadCount, biasLoadCount};
490+ return EstimateMte2LoadTimeUs(estimate, gmBandwidthTbps, l2BandwidthTbps);
491+}
492+ 
493+double AdaptiveSlidingWindowCubeBasicAPITiling::EstimateMacTimeUs() const
494+{
495+ return EstimateMatmulMacTimeUs(qmmv3_tiling_const::CUBE_REDUCE_BLOCK);
496+}
497+ 
498+bool AdaptiveSlidingWindowCubeBasicAPITiling::CanSelectMultiBufferByL1Plan(bool isAFullLoad, uint64_t baseM,
499+ uint64_t baseN) const
500+{
501+ const L1TilingMode mode = isAFullLoad ? L1TilingMode::A_L1_FULL_LOAD : L1TilingMode::DEFAULT;
502+ L1TilingDataCalculator calculator(inputParams_, compileInfo_, baseM, baseN, adaptiveWin_.baseK);
503+ if (!calculator.Compute(mode)) {
504+ return false;
505+ }
506+ const L1TilingData& l1Tiling = calculator.GetOutput();
507+ const CubeL1Context ctx = {baseM, baseN, adaptiveWin_.baseK, isAFullLoad};
508+ const CubeL1Plan plan = SelectCubeL1Plan(ctx, l1Tiling.stepKa_ * adaptiveWin_.baseK,
509+ l1Tiling.stepKb_ * adaptiveWin_.baseK);
510+ return plan.l1BufferNum > qmmv3_tiling_const::L1_TWO_BUFFER;
511+}
512+ 
237void AdaptiveSlidingWindowCubeBasicAPITiling::UpdateAFullLoadStatus()513void AdaptiveSlidingWindowCubeBasicAPITiling::UpdateAFullLoadStatus()
238{514{
239- uint64_t realBaseMSize = adaptiveWin_.mBaseTailSplitCnt == 1UL ? adaptiveWin_.baseM : adaptiveWin_.mTailMain;515+ const uint64_t realBaseMSize = adaptiveWin_.mBaseTailSplitCnt == 1UL ? adaptiveWin_.baseM : adaptiveWin_.mTailMain;
240- uint64_t singleCoreASize = realBaseMSize *516+ const uint64_t singleCoreASize = realBaseMSize *
241- (inputParams_.transA ?517+ (inputParams_.transA ?
242- GetSizeWithDataType(518+ GetSizeWithDataType(
243- ops::CeilAlign(inputParams_.kSize, qmmv3_tiling_const::CUBE_BLOCK),519+ ops::CeilAlign(inputParams_.kSize, qmmv3_tiling_const::CUBE_BLOCK),
244- inputParams_.aDtype) :520+ inputParams_.aDtype) :
245- ops::CeilAlign(GetSizeWithDataType(inputParams_.kSize, inputParams_.aDtype),521+ ops::CeilAlign(GetSizeWithDataType(inputParams_.kSize, inputParams_.aDtype),
246- qmmv3_tiling_const::CUBE_REDUCE_BLOCK));522+ qmmv3_tiling_const::CUBE_REDUCE_BLOCK));
523+ const bool isAFullLoadCandidate = singleCoreASize <=
524+ aicoreParams_.l1Size / qmmv3_tiling_const::AFULLLOAD_SINGLE_CORE_A_SCALER &&
525+ adaptiveWin_.mBlockCnt < qmmv3_tiling_const::WINDOW_LEN &&
526+ aicoreParams_.aicNum % adaptiveWin_.mBlockCnt == 0 &&
527+ adaptiveWin_.totalBlockCnt > aicoreParams_.aicNum && inputParams_.batchC == 1;
528+ bool selectAFullLoad = isAFullLoadCandidate;
529+ if (selectAFullLoad && compileInfo_.npuArch == NpuArch::DAV_3510) {
530+ const bool aFullSelectsMultiBuffer = CanSelectMultiBufferByL1Plan(true, realBaseMSize, adaptiveWin_.baseN);
247 531 
248- isAFullLoad_ = singleCoreASize <= aicoreParams_.l1Size / qmmv3_tiling_const::AFULLLOAD_SINGLE_CORE_A_SCALER &&532+ if (!aFullSelectsMultiBuffer) {
249- adaptiveWin_.mBlockCnt < qmmv3_tiling_const::WINDOW_LEN &&533+ const bool nonFullSelectsMultiBuffer = CanSelectMultiBufferByL1Plan(false, adaptiveWin_.baseM,
250- aicoreParams_.aicNum % adaptiveWin_.mBlockCnt == 0 &&534+ adaptiveWin_.baseN);
251- adaptiveWin_.totalBlockCnt > aicoreParams_.aicNum && inputParams_.batchC == 1;535+ if (nonFullSelectsMultiBuffer && !ShouldKeepAFullLoadByRepeatLoadRatio()) {
252- if (isAFullLoad_ && adaptiveWin_.baseM != realBaseMSize) {536+ selectAFullLoad = false;
253- adaptiveWin_.baseM = realBaseMSize;537+ }
254- adaptiveWin_.mBaseTailSplitCnt = 1UL;538+ }
255- adaptiveWin_.mTailMain = 0UL;
256 }539 }
540+ isAFullLoad_ = selectAFullLoad;
541+ 
542+ if (!isAFullLoad_ || adaptiveWin_.baseM == realBaseMSize) {
543+ return;
544+ }
545+ adaptiveWin_.baseM = realBaseMSize;
546+ adaptiveWin_.mBaseTailSplitCnt = 1UL;
547+ adaptiveWin_.mTailMain = 0UL;
257}548}
258 549 
259void AdaptiveSlidingWindowCubeBasicAPITiling::UpdateBFullLoadStatus()550void AdaptiveSlidingWindowCubeBasicAPITiling::UpdateBFullLoadStatus()
@@ -292,6 +583,11 @@ void AdaptiveSlidingWindowCubeBasicAPITiling::AnalyseFullLoadInfo()
292 583 
293void AdaptiveSlidingWindowCubeBasicAPITiling::SetTilingData()584void AdaptiveSlidingWindowCubeBasicAPITiling::SetTilingData()
294{585{
586+ useWithoutBatchTilingData_ = IsWithoutBatchTilingData();
587+ tilingDataSize_ = useWithoutBatchTilingData_ ?
588+ sizeof(DequantBmm::QuantBatchMatmulV3TensorAPIWithoutBatchTilingData) :
589+ sizeof(DequantBmm::QuantBatchMatmulV3BasicAPITilingData);
590+ 
295 QuantBatchMatMulV3TilingUtil::SetCommonTilingData(inputParams_, tilingData_);591 QuantBatchMatMulV3TilingUtil::SetCommonTilingData(inputParams_, tilingData_);
296 tilingData_.matmulTiling.weightMustHitL2 = static_cast<uint8_t>(592 tilingData_.matmulTiling.weightMustHitL2 = static_cast<uint8_t>(
297 IsWeightMustHitL2(inputParams_, basicTiling_.baseM));593 IsWeightMustHitL2(inputParams_, basicTiling_.baseM));
@@ -318,6 +614,38 @@ void AdaptiveSlidingWindowCubeBasicAPITiling::SetTilingData()
318 tilingData_.adaptiveSlidingWin.nBaseTailSplitCnt = static_cast<uint32_t>(adaptiveWin_.nBaseTailSplitCnt);614 tilingData_.adaptiveSlidingWin.nBaseTailSplitCnt = static_cast<uint32_t>(adaptiveWin_.nBaseTailSplitCnt);
319 tilingData_.adaptiveSlidingWin.mTailMain = static_cast<uint32_t>(adaptiveWin_.mTailMain);615 tilingData_.adaptiveSlidingWin.mTailMain = static_cast<uint32_t>(adaptiveWin_.mTailMain);
320 tilingData_.adaptiveSlidingWin.nTailMain = static_cast<uint32_t>(adaptiveWin_.nTailMain);616 tilingData_.adaptiveSlidingWin.nTailMain = static_cast<uint32_t>(adaptiveWin_.nTailMain);
617+ 
618+ if (useWithoutBatchTilingData_) {
619+ SetWithoutBatchTilingData();
620+ }
621+}
622+ 
623+void AdaptiveSlidingWindowCubeBasicAPITiling::SetWithoutBatchTilingData()
624+{
625+ withoutBatchTilingData_.m = static_cast<uint32_t>(inputParams_.mSize);
626+ withoutBatchTilingData_.n = static_cast<uint32_t>(inputParams_.nSize);
627+ withoutBatchTilingData_.k = static_cast<uint32_t>(inputParams_.kSize);
628+ withoutBatchTilingData_.kAL1 = tilingData_.matmulTiling.kAL1;
629+ withoutBatchTilingData_.kBL1 = tilingData_.matmulTiling.kBL1;
630+ withoutBatchTilingData_.baseM = static_cast<uint16_t>(basicTiling_.baseM);
631+ withoutBatchTilingData_.baseN = static_cast<uint16_t>(basicTiling_.baseN);
632+ withoutBatchTilingData_.baseK = static_cast<uint16_t>(basicTiling_.baseK);
633+ withoutBatchTilingData_.groupSizeM = static_cast<uint16_t>(inputParams_.groupSizeM);
634+ withoutBatchTilingData_.groupSizeN = static_cast<uint16_t>(inputParams_.groupSizeN);
635+ withoutBatchTilingData_.groupSizeK = static_cast<uint16_t>(inputParams_.groupSizeK);
636+ withoutBatchTilingData_.mTailTile = static_cast<uint16_t>(adaptiveWin_.mTailTile);
637+ withoutBatchTilingData_.nTailTile = static_cast<uint16_t>(adaptiveWin_.nTailTile);
638+ withoutBatchTilingData_.mBaseTailSplitCnt = static_cast<uint16_t>(adaptiveWin_.mBaseTailSplitCnt);
639+ withoutBatchTilingData_.nBaseTailSplitCnt = static_cast<uint16_t>(adaptiveWin_.nBaseTailSplitCnt);
640+ withoutBatchTilingData_.mTailMain = static_cast<uint16_t>(adaptiveWin_.mTailMain);
641+ withoutBatchTilingData_.nTailMain = static_cast<uint16_t>(adaptiveWin_.nTailMain);
642+ withoutBatchTilingData_.x1QuantMode = static_cast<uint8_t>(tilingData_.params.x1QuantMode);
643+ withoutBatchTilingData_.x2QuantMode = static_cast<uint8_t>(tilingData_.params.x2QuantMode);
644+ withoutBatchTilingData_.isBias = tilingData_.matmulTiling.isBias;
645+ withoutBatchTilingData_.biasDtype = static_cast<uint8_t>(inputParams_.biasDtype);
646+ withoutBatchTilingData_.nBufferNum = tilingData_.matmulTiling.nBufferNum;
647+ withoutBatchTilingData_.dbL0C = tilingData_.matmulTiling.dbL0C;
648+ withoutBatchTilingData_.weightMustHitL2 = tilingData_.matmulTiling.weightMustHitL2;
321}649}
322 650 
323REGISTER_TILING_TEMPLATE_WITH_ARCH(QuantBatchMatmulV3, AdaptiveSlidingWindowCubeBasicAPITiling, supportedNpuArch,651REGISTER_TILING_TEMPLATE_WITH_ARCH(QuantBatchMatmulV3, AdaptiveSlidingWindowCubeBasicAPITiling, supportedNpuArch,
@@ -1,5 +1,5 @@
1/**1/**
2- * Copyright (c) 2025 Huawei Technologies Co., Ltd.2+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3 * This program is free software, you can redistribute it and/or modify it under the terms and conditions of3 * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4 * CANN Open Software License Agreement Version 2.0 (the "License").4 * CANN Open Software License Agreement Version 2.0 (the "License").
5 * Please refer to the License for details. You may not use this file except in compliance with the License.5 * Please refer to the License for details. You may not use this file except in compliance with the License.
@@ -31,7 +31,38 @@ public:
31 ge::graphStatus DoLibApiTiling() override;31 ge::graphStatus DoLibApiTiling() override;
32 32 
33private:33private:
34- void CalculateNBufferNum4Cube();34+ // Fixed geometry for one L1 plan search; the candidate step varies as a scalar kL1 alongside it.
35+ struct CubeL1Context {
36+ uint64_t baseM;
37+ uint64_t baseN;
38+ uint64_t baseK;
39+ bool isAFullLoad;
40+ };
41+ 
42+ struct CubeL1Plan {
43+ uint64_t kAL1;
44+ uint64_t kBL1;
45+ uint32_t l1BufferNum;
46+ };
47+ 
48+ void CalculateNBufferNum();
49+ void CalculateLegacyNBufferNum();
50+ CubeL1Plan SelectCubeL1Plan(const CubeL1Context& ctx, uint64_t currentKAL1, uint64_t currentKBL1) const;
51+ bool TryApplyReducedStepK(CubeL1Plan& plan, const CubeL1Context& ctx, uint64_t currentKL1,
52+ uint32_t l1BufferNum) const;
53+ uint64_t SelectReducedStepK(const CubeL1Context& ctx, uint64_t currentKL1, uint32_t l1BufferNum) const;
54+ bool CanFitL1BufferNum(const CubeL1Context& ctx, uint64_t kL1, uint32_t l1BufferNum) const;
55+ uint64_t CalcUsedL1Size(const CubeL1Context& ctx, uint64_t kL1, uint32_t l1BufferNum) const;
56+ uint64_t CalcAFullLoadL1Size(uint64_t baseM) const;
57+ uint64_t CalcAFullKLoadSize(uint64_t mSize) const;
58+ uint64_t CalcBFullKLoadSize(uint64_t nSize) const;
59+ bool ShouldKeepAFullLoadByRepeatLoadRatio() const;
60+ bool IsMte2Bound(double gmBandwidthTbps, double l2BandwidthTbps) const;
61+ double EstimateMte2TimeUs(double gmBandwidthTbps, double l2BandwidthTbps) const;
62+ double EstimateMacTimeUs() const;
63+ bool CanSelectMultiBufferByL1Plan(bool isAFullLoad, uint64_t baseM, uint64_t baseN) const;
64+ bool IsWithoutBatchTilingData() const;
65+ void SetWithoutBatchTilingData();
35 void UpdateAFullLoadStatus();66 void UpdateAFullLoadStatus();
36 void UpdateBFullLoadStatus();67 void UpdateBFullLoadStatus();
37 68 
@@ -43,12 +74,16 @@ protected:
43 const void* GetTilingData() const override;74 const void* GetTilingData() const override;
44 uint64_t GetKernelType() const override;75 uint64_t GetKernelType() const override;
45 uint64_t GetApiLevel(NpuArch npuArch) const override;76 uint64_t GetApiLevel(NpuArch npuArch) const override;
77+ uint64_t GetBatchMode() const override;
78+ bool CalcBasicBlock() override;
46 void AnalyseFullLoadInfo() override;79 void AnalyseFullLoadInfo() override;
47 bool CalL1Tiling() override;80 bool CalL1Tiling() override;
48 void SetTilingData() override;81 void SetTilingData() override;
49 82 
50 DequantBmm::QuantBatchMatmulV3BasicAPITilingData tilingDataSelf_;83 DequantBmm::QuantBatchMatmulV3BasicAPITilingData tilingDataSelf_;
51 DequantBmm::QuantBatchMatmulV3BasicAPITilingData& tilingData_;84 DequantBmm::QuantBatchMatmulV3BasicAPITilingData& tilingData_;
85+ DequantBmm::QuantBatchMatmulV3TensorAPIWithoutBatchTilingData withoutBatchTilingData_;
86+ bool useWithoutBatchTilingData_ = false;
52 bool isSupportS4S4_ = false;87 bool isSupportS4S4_ = false;
53};88};
54} // namespace optiling89} // namespace optiling
@@ -33,7 +33,6 @@ constexpr uint64_t MX_L0C_PINGPONG_SCALE_KL1_TARGET = 2048UL;
33constexpr uint64_t MX_L0C_PINGPONG_OUTPUT_SIZE_LIMIT = 128UL * 1024UL * 1024UL;33constexpr uint64_t MX_L0C_PINGPONG_OUTPUT_SIZE_LIMIT = 128UL * 1024UL * 1024UL;
34// Keep A full-load if repeated A reads exceed this share of non-full-load GM traffic.34// Keep A full-load if repeated A reads exceed this share of non-full-load GM traffic.
35constexpr double REPEAT_A_LOAD_RATIO_THRESHOLD = 0.20;35constexpr double REPEAT_A_LOAD_RATIO_THRESHOLD = 0.20;
36-constexpr double MTE2_BW_UTILIZATION = 0.9;
37 36 
38const std::vector<int32_t> supportedNpuArch = {static_cast<int32_t>(NpuArch::DAV_3510)};37const std::vector<int32_t> supportedNpuArch = {static_cast<int32_t>(NpuArch::DAV_3510)};
39constexpr int32_t TILING_PRIORITY = optiling::strategy::MX_BASIC_API_ASW;38constexpr int32_t TILING_PRIORITY = optiling::strategy::MX_BASIC_API_ASW;
@@ -82,7 +81,7 @@ void AdaptiveSlidingWindowMXBasicAPITiling::ResetTilingData()
82 81 
83bool AdaptiveSlidingWindowMXBasicAPITiling::IsWithoutBatchTilingData() const82bool AdaptiveSlidingWindowMXBasicAPITiling::IsWithoutBatchTilingData() const
84{83{
85- return IsTensorapiCapable() && inputParams_.batchC == 1UL;84+ return IsTensorApiEnabled() && inputParams_.batchC == 1UL;
86}85}
87 86 
88void AdaptiveSlidingWindowMXBasicAPITiling::AdjustScaleFactorForL0CPingpong(uint32_t& scaleFactor, uint32_t step,87void AdaptiveSlidingWindowMXBasicAPITiling::AdjustScaleFactorForL0CPingpong(uint32_t& scaleFactor, uint32_t step,
@@ -109,7 +108,7 @@ const void* AdaptiveSlidingWindowMXBasicAPITiling::GetTilingData() const
109 108 
110uint64_t AdaptiveSlidingWindowMXBasicAPITiling::GetApiLevel(NpuArch npuArch) const109uint64_t AdaptiveSlidingWindowMXBasicAPITiling::GetApiLevel(NpuArch npuArch) const
111{110{
112- return IsTensorapiCapable() ? static_cast<uint64_t>(QMMApiLevel::BLAZE_LEVEL) :111+ return IsTensorApiEnabled() ? static_cast<uint64_t>(QMMApiLevel::BLAZE_LEVEL) :
113 static_cast<uint64_t>(QMMApiLevel::BASIC_LEVEL);112 static_cast<uint64_t>(QMMApiLevel::BASIC_LEVEL);
114}113}
115 114 
@@ -197,19 +196,11 @@ ge::graphStatus AdaptiveSlidingWindowMXBasicAPITiling::DoLibApiTiling()
197 tilingData_.matmulTiling.isBias = inputParams_.hasBias ? 1UL : 0UL;196 tilingData_.matmulTiling.isBias = inputParams_.hasBias ? 1UL : 0UL;
198 tilingData_.matmulTiling.dbL0C = static_cast<uint8_t>(basicTiling_.dbL0c);197 tilingData_.matmulTiling.dbL0C = static_cast<uint8_t>(basicTiling_.dbL0c);
199 198 
200- uint64_t scaleKL1 = std::min(199+ // DeriveScaleKL1 shrinks basicTiling_.scaleFactorA/B in place when the L0C ping-pong template fires; those
201- static_cast<uint64_t>(basicTiling_.scaleFactorA) * basicTiling_.stepKa * basicTiling_.baseK,200+ // adjusted factors flow into mxTypePara later, so the in-place write-back must be preserved.
202- static_cast<uint64_t>(basicTiling_.scaleFactorB) * basicTiling_.stepKb * basicTiling_.baseK);201+ tilingData_.matmulTiling.scaleKL1 = static_cast<uint32_t>(
203- uint64_t outputSize = GetSizeWithDataType(inputParams_.mSize * inputParams_.nSize, inputParams_.cDtype);202+ DeriveScaleKL1(basicTiling_.scaleFactorA, basicTiling_.stepKa, basicTiling_.scaleFactorB, basicTiling_.stepKb,
204- if (IsMxL0CPingpong(inputParams_) && outputSize <= MX_L0C_PINGPONG_OUTPUT_SIZE_LIMIT &&203+ basicTiling_.baseK));
205- scaleKL1 > MX_L0C_PINGPONG_SCALE_KL1_TARGET) {
206- AdjustScaleFactorForL0CPingpong(basicTiling_.scaleFactorA, basicTiling_.stepKa, basicTiling_.baseK);
207- AdjustScaleFactorForL0CPingpong(basicTiling_.scaleFactorB, basicTiling_.stepKb, basicTiling_.baseK);
208- scaleKL1 = std::min(
209- static_cast<uint64_t>(basicTiling_.scaleFactorA) * basicTiling_.stepKa * basicTiling_.baseK,
210- static_cast<uint64_t>(basicTiling_.scaleFactorB) * basicTiling_.stepKb * basicTiling_.baseK);
211- }
212- tilingData_.matmulTiling.scaleKL1 = static_cast<uint32_t>(scaleKL1);
213 CalculateNBufferNum();204 CalculateNBufferNum();
214 if (useWithoutBatchTilingData_) {205 if (useWithoutBatchTilingData_) {
215 SetWithoutBatchTilingData();206 SetWithoutBatchTilingData();
@@ -221,91 +212,101 @@ void AdaptiveSlidingWindowMXBasicAPITiling::CalculateNBufferNum()
221{212{
222 const uint32_t stepK = std::min(basicTiling_.stepKa, basicTiling_.stepKb);213 const uint32_t stepK = std::min(basicTiling_.stepKa, basicTiling_.stepKb);
223 const uint64_t currentKL1 = static_cast<uint64_t>(stepK) * tilingData_.matmulTiling.baseK;214 const uint64_t currentKL1 = static_cast<uint64_t>(stepK) * tilingData_.matmulTiling.baseK;
224- const MxL1EstimateParams currentParams = BuildL1EstimateParams(currentKL1);215+ const MxL1EstimateParams currentParams = BuildL1EstimateParams(currentKL1, tilingData_.matmulTiling.scaleKL1,
216+ tilingData_.matmulTiling.baseM,
217+ tilingData_.matmulTiling.baseN, isAFullLoad_);
218+ const MxL1Plan plan = SelectMxL1Plan(currentParams, tilingData_.matmulTiling.baseK,
219+ tilingData_.matmulTiling.scaleKL1);
220+ tilingData_.matmulTiling.kAL1 = static_cast<uint32_t>(plan.kL1);
221+ tilingData_.matmulTiling.kBL1 = tilingData_.matmulTiling.kAL1;
222+ tilingData_.matmulTiling.scaleKL1 = static_cast<uint32_t>(plan.scaleKL1);
223+ tilingData_.matmulTiling.nBufferNum = static_cast<uint8_t>(plan.l1BufferNum);
224+}
225+ 
226+AdaptiveSlidingWindowMXBasicAPITiling::MxL1EstimateParams AdaptiveSlidingWindowMXBasicAPITiling::BuildL1EstimateParams(
227+ uint64_t kL1, uint64_t baseScaleKL1, uint64_t baseM, uint64_t baseN, bool isAFullLoad) const
228+{
229+ return {kL1, GetHalfKFallbackScaleKL1(baseScaleKL1, kL1), baseM, baseN, isAFullLoad};
230+}
231+ 
232+uint64_t AdaptiveSlidingWindowMXBasicAPITiling::DeriveScaleKL1(uint32_t& scaleFactorA, uint64_t stepKa,
233+ uint32_t& scaleFactorB, uint64_t stepKb,
234+ uint64_t baseK) const
235+{
236+ uint64_t scaleKL1 = std::min(static_cast<uint64_t>(scaleFactorA) * stepKa * baseK,
237+ static_cast<uint64_t>(scaleFactorB) * stepKb * baseK);
238+ const uint64_t outputSize = GetSizeWithDataType(inputParams_.mSize * inputParams_.nSize, inputParams_.cDtype);
239+ if (IsMxL0CPingpong(inputParams_) && outputSize <= MX_L0C_PINGPONG_OUTPUT_SIZE_LIMIT &&
240+ scaleKL1 > MX_L0C_PINGPONG_SCALE_KL1_TARGET) {
241+ AdjustScaleFactorForL0CPingpong(scaleFactorA, static_cast<uint32_t>(stepKa), static_cast<uint32_t>(baseK));
242+ AdjustScaleFactorForL0CPingpong(scaleFactorB, static_cast<uint32_t>(stepKb), static_cast<uint32_t>(baseK));
243+ scaleKL1 = std::min(static_cast<uint64_t>(scaleFactorA) * stepKa * baseK,
244+ static_cast<uint64_t>(scaleFactorB) * stepKb * baseK);
245+ }
246+ return scaleKL1;
247+}
248+ 
249+AdaptiveSlidingWindowMXBasicAPITiling::MxL1Plan AdaptiveSlidingWindowMXBasicAPITiling::MakeMxL1Plan(
250+ const MxL1EstimateParams& params, uint32_t l1BufferNum) const
251+{
252+ // Two-buffer keeps the (possibly half-K fallback) scaleKL1; multi-buffer tries to widen scale to full-K coverage.
253+ const uint64_t scaleKL1 = l1BufferNum == qmmv3_tiling_const::L1_TWO_BUFFER ?
254+ params.scaleKL1 :
255+ GetFullCoverScaleKL1IfPossible(params, l1BufferNum);
256+ return {params.kL1, scaleKL1, l1BufferNum};
257+}
258+ 
259+AdaptiveSlidingWindowMXBasicAPITiling::MxL1Plan AdaptiveSlidingWindowMXBasicAPITiling::SelectMxL1Plan(
260+ const MxL1EstimateParams& currentParams, uint64_t baseK, uint64_t baseScaleKL1) const
261+{
262+ const uint64_t currentKL1 = currentParams.kL1;
263+ const uint64_t stepK = currentKL1 / baseK;
225 // Restrict the smaller stepK=2 candidates to cases where the current double buffer cannot cover K.264 // Restrict the smaller stepK=2 candidates to cases where the current double buffer cannot cover K.
226 const bool isCurrentTwoBufferNotOverK = currentKL1 * qmmv3_tiling_const::L1_TWO_BUFFER < inputParams_.kSize;265 const bool isCurrentTwoBufferNotOverK = currentKL1 * qmmv3_tiling_const::L1_TWO_BUFFER < inputParams_.kSize;
227 if (CanFitL1BufferNum(currentParams, qmmv3_tiling_const::L1_FOUR_BUFFER)) {266 if (CanFitL1BufferNum(currentParams, qmmv3_tiling_const::L1_FOUR_BUFFER)) {
228- ApplyMultiBufferL1Tiling(currentParams, qmmv3_tiling_const::L1_FOUR_BUFFER);267+ return MakeMxL1Plan(currentParams, qmmv3_tiling_const::L1_FOUR_BUFFER);
229- return;
230 }268 }
231 269 
232 // If stepK 3/4 blocks four-buffer from fitting L1 while two-buffer still cannot cover K,270 // If stepK 3/4 blocks four-buffer from fitting L1 while two-buffer still cannot cover K,
233 // try stepK 2 to reduce per-round L1 usage and leave room for four-buffer.271 // try stepK 2 to reduce per-round L1 usage and leave room for four-buffer.
234- const uint64_t stepKTwoKL1 = static_cast<uint64_t>(STEP_K_TWO) * tilingData_.matmulTiling.baseK;272+ const uint64_t stepKTwoKL1 = static_cast<uint64_t>(STEP_K_TWO) * baseK;
235- const bool canReduceStepK = isCurrentTwoBufferNotOverK && (stepK == 3U || stepK == 4U) &&273+ const bool canReduceStepK = isCurrentTwoBufferNotOverK && (stepK == 3UL || stepK == 4UL) &&
236 CanReduceStepKToTwo(stepKTwoKL1);274 CanReduceStepKToTwo(stepKTwoKL1);
237 MxL1EstimateParams stepKTwoParams = currentParams;275 MxL1EstimateParams stepKTwoParams = currentParams;
238 if (canReduceStepK) {276 if (canReduceStepK) {
239- stepKTwoParams = BuildL1EstimateParams(stepKTwoKL1);277+ stepKTwoParams = BuildL1EstimateParams(stepKTwoKL1, baseScaleKL1, currentParams.baseM, currentParams.baseN,
278+ currentParams.isAFullLoad);
240 // Prefer four buffers globally, even when it requires a smaller stepK.279 // Prefer four buffers globally, even when it requires a smaller stepK.
241 if (CanFitL1BufferNum(stepKTwoParams, qmmv3_tiling_const::L1_FOUR_BUFFER)) {280 if (CanFitL1BufferNum(stepKTwoParams, qmmv3_tiling_const::L1_FOUR_BUFFER)) {
242- ApplyMultiBufferL1Tiling(stepKTwoParams, qmmv3_tiling_const::L1_FOUR_BUFFER);281+ return MakeMxL1Plan(stepKTwoParams, qmmv3_tiling_const::L1_FOUR_BUFFER);
243- return;
244 }282 }
245 }283 }
246 284 
247 // A full-load uses the third buffer only for the B-side pipeline. Otherwise, keep the current stepK and enable285 // A full-load uses the third buffer only for the B-side pipeline. Otherwise, keep the current stepK and enable
248 // triple-buffer only when the current double buffer cannot cover K and MTE2 is expected to dominate.286 // triple-buffer only when the current double buffer cannot cover K and MTE2 is expected to dominate.
249- const bool canUseCurrentThreeBuffer = isAFullLoad_ ||287+ const bool canUseCurrentThreeBuffer = currentParams.isAFullLoad ||
250 (isCurrentTwoBufferNotOverK &&288 (isCurrentTwoBufferNotOverK &&
251- IsMxMte2Bound(289+ IsMte2Bound(qmmv3_tiling_const::ASCEND_950_MAX_HBM_BW_TBPS *
252- qmmv3_tiling_const::ASCEND_950_MAX_HBM_BW_TBPS * MTE2_BW_UTILIZATION,290+ qmmv3_tiling_const::MTE2_BW_UTILIZATION,
253- qmmv3_tiling_const::ASCEND_950_MAX_L2_BW_TBPS * MTE2_BW_UTILIZATION));291+ qmmv3_tiling_const::ASCEND_950_MAX_L2_BW_TBPS *
292+ qmmv3_tiling_const::MTE2_BW_UTILIZATION));
254 if (canUseCurrentThreeBuffer && CanFitL1BufferNum(currentParams, qmmv3_tiling_const::L1_THREE_BUFFER)) {293 if (canUseCurrentThreeBuffer && CanFitL1BufferNum(currentParams, qmmv3_tiling_const::L1_THREE_BUFFER)) {
255- ApplyMultiBufferL1Tiling(currentParams, qmmv3_tiling_const::L1_THREE_BUFFER);294+ return MakeMxL1Plan(currentParams, qmmv3_tiling_const::L1_THREE_BUFFER);
256- return;
257 }295 }
258 if (canReduceStepK && canUseCurrentThreeBuffer &&296 if (canReduceStepK && canUseCurrentThreeBuffer &&
259 CanFitL1BufferNum(stepKTwoParams, qmmv3_tiling_const::L1_THREE_BUFFER)) {297 CanFitL1BufferNum(stepKTwoParams, qmmv3_tiling_const::L1_THREE_BUFFER)) {
260- ApplyMultiBufferL1Tiling(stepKTwoParams, qmmv3_tiling_const::L1_THREE_BUFFER);298+ return MakeMxL1Plan(stepKTwoParams, qmmv3_tiling_const::L1_THREE_BUFFER);
261- return;
262 }299 }
263- 300+ return MakeMxL1Plan(currentParams, qmmv3_tiling_const::L1_TWO_BUFFER);
264- tilingData_.matmulTiling.kAL1 = static_cast<uint32_t>(currentParams.kL1);
265- tilingData_.matmulTiling.kBL1 = tilingData_.matmulTiling.kAL1;
266- tilingData_.matmulTiling.scaleKL1 = static_cast<uint32_t>(currentParams.scaleKL1);
267- tilingData_.matmulTiling.nBufferNum = qmmv3_tiling_const::L1_TWO_BUFFER;
268-}
269- 
270-AdaptiveSlidingWindowMXBasicAPITiling::MxL1EstimateParams AdaptiveSlidingWindowMXBasicAPITiling::BuildL1EstimateParams(
271- uint64_t kL1) const
272-{
273- return {kL1, GetHalfKFallbackScaleKL1(kL1), tilingData_.matmulTiling.baseM, tilingData_.matmulTiling.baseN,
274- isAFullLoad_};
275-}
276- 
277-void AdaptiveSlidingWindowMXBasicAPITiling::ApplyMultiBufferL1Tiling(const MxL1EstimateParams& params,
278- uint32_t l1BufferNum)
279-{
280- tilingData_.matmulTiling.kAL1 = static_cast<uint32_t>(params.kL1);
281- tilingData_.matmulTiling.kBL1 = tilingData_.matmulTiling.kAL1;
282- tilingData_.matmulTiling.scaleKL1 = static_cast<uint32_t>(GetFullCoverScaleKL1IfPossible(params, l1BufferNum));
283- tilingData_.matmulTiling.nBufferNum = static_cast<uint8_t>(l1BufferNum);
284}301}
285 302 
286bool AdaptiveSlidingWindowMXBasicAPITiling::CanReduceStepKToTwo(uint64_t stepKTwoKL1) const303bool AdaptiveSlidingWindowMXBasicAPITiling::CanReduceStepKToTwo(uint64_t stepKTwoKL1) const
287{304{
288- const bool isAInnerKAligned = inputParams_.transA || GetSizeWithDataType(inputParams_.kSize, inputParams_.aDtype) %305+ return AreKInnerAxesAligned() && IsKInnerKL1AlignedTo256Bytes(stepKTwoKL1);
289- qmmv3_tiling_const::MTE2_ADDRESS_ALIGN_SIZE ==
290- 0UL;
291- const bool isBInnerKAligned = !inputParams_.transB || GetSizeWithDataType(inputParams_.kSize, inputParams_.bDtype) %
292- qmmv3_tiling_const::MTE2_ADDRESS_ALIGN_SIZE ==
293- 0UL;
294- 
295- const bool isStepKTwoAInnerKAligned = inputParams_.transA || GetSizeWithDataType(stepKTwoKL1, inputParams_.aDtype) %
296- qmmv3_tiling_const::BASIC_BLOCK_SIZE_256 ==
297- 0UL;
298- const bool isStepKTwoBInnerKAligned = !inputParams_.transB ||
299- GetSizeWithDataType(stepKTwoKL1, inputParams_.bDtype) %
300- qmmv3_tiling_const::BASIC_BLOCK_SIZE_256 ==
301- 0UL;
302- 
303- return isAInnerKAligned && isBInnerKAligned && isStepKTwoAInnerKAligned && isStepKTwoBInnerKAligned;
304}306}
305 307 
306-uint64_t AdaptiveSlidingWindowMXBasicAPITiling::GetHalfKFallbackScaleKL1(uint64_t kL1) const308+uint64_t AdaptiveSlidingWindowMXBasicAPITiling::GetHalfKFallbackScaleKL1(uint64_t scaleKL1, uint64_t kL1) const
307{309{
308- uint64_t scaleKL1 = tilingData_.matmulTiling.scaleKL1;
309 if (scaleKL1 % qmmv3_tiling_const::ESTIMATED_SCALE_K == 0UL) {310 if (scaleKL1 % qmmv3_tiling_const::ESTIMATED_SCALE_K == 0UL) {
310 return scaleKL1;311 return scaleKL1;
311 }312 }
@@ -341,25 +342,10 @@ uint64_t AdaptiveSlidingWindowMXBasicAPITiling::CalcMxFullKLoadSize(uint64_t out
341 return GetSizeWithDataType(outerSize * kAligned, dataDtype) + GetSizeWithDataType(outerSize * scaleK, scaleDtype);342 return GetSizeWithDataType(outerSize * kAligned, dataDtype) + GetSizeWithDataType(outerSize * scaleK, scaleDtype);
342}343}
343 344 
344-uint32_t AdaptiveSlidingWindowMXBasicAPITiling::SelectL1BufferNum(const MxL1EstimateParams& params) const
345-{
346- if (CanFitL1BufferNum(params, qmmv3_tiling_const::L1_FOUR_BUFFER)) {
347- return qmmv3_tiling_const::L1_FOUR_BUFFER;
348- }
349- const bool canUseThreeBuffer = params.isAFullLoad ||
350- (params.kL1 * qmmv3_tiling_const::L1_TWO_BUFFER < inputParams_.kSize &&
351- IsMxMte2Bound(qmmv3_tiling_const::ASCEND_950_MAX_HBM_BW_TBPS * MTE2_BW_UTILIZATION,
352- qmmv3_tiling_const::ASCEND_950_MAX_L2_BW_TBPS * MTE2_BW_UTILIZATION));
353- if (canUseThreeBuffer && CanFitL1BufferNum(params, qmmv3_tiling_const::L1_THREE_BUFFER)) {
354- return qmmv3_tiling_const::L1_THREE_BUFFER;
355- }
356- return qmmv3_tiling_const::L1_TWO_BUFFER;
357-}
358- 
359bool AdaptiveSlidingWindowMXBasicAPITiling::CanFitL1BufferNum(const MxL1EstimateParams& params,345bool AdaptiveSlidingWindowMXBasicAPITiling::CanFitL1BufferNum(const MxL1EstimateParams& params,
360 uint32_t l1BufferNum) const346 uint32_t l1BufferNum) const
361{347{
362- if (l1BufferNum == qmmv3_tiling_const::L1_THREE_BUFFER && !IsTensorapiCapable()) {348+ if (l1BufferNum == qmmv3_tiling_const::L1_THREE_BUFFER && !IsTensorApiEnabled()) {
363 return false;349 return false;
364 }350 }
365 return CalcUsedL1Size(params, l1BufferNum) <= aicoreParams_.l1Size;351 return CalcUsedL1Size(params, l1BufferNum) <= aicoreParams_.l1Size;
@@ -388,32 +374,25 @@ uint64_t AdaptiveSlidingWindowMXBasicAPITiling::CalcUsedL1Size(const MxL1Estimat
388 return usedL1Size;374 return usedL1Size;
389}375}
390 376 
391-bool AdaptiveSlidingWindowMXBasicAPITiling::CanOpenMultiBufferByL1Estimate(bool isAFullLoad, uint64_t baseM,377+bool AdaptiveSlidingWindowMXBasicAPITiling::CanSelectMultiBufferByL1Plan(bool isAFullLoad, uint64_t baseM,
392- uint64_t baseN) const378+ uint64_t baseN) const
393{379{
394- if (!isAFullLoad) {380+ // Faithful dry-run of the final L1 tiling + N-buffer selection for this candidate, mirroring the cube path.
395- const bool isAInnerKAligned = inputParams_.transA ||381+ const L1TilingMode mode = isAFullLoad ? L1TilingMode::A_L1_FULL_LOAD : L1TilingMode::DEFAULT;
396- GetSizeWithDataType(inputParams_.kSize, inputParams_.aDtype) %382+ L1TilingDataCalculator calculator(inputParams_, compileInfo_, baseM, baseN, adaptiveWin_.baseK);
397- qmmv3_tiling_const::MTE2_ADDRESS_ALIGN_SIZE ==383+ if (!calculator.Compute(mode)) {
398- 0UL;384+ return false;
399- const bool isBInnerKAligned = !inputParams_.transB ||
400- GetSizeWithDataType(inputParams_.kSize, inputParams_.bDtype) %
401- qmmv3_tiling_const::MTE2_ADDRESS_ALIGN_SIZE ==
402- 0UL;
403- // Use max stepK=4 for a conservative two-buffer K-coverage estimate.
404- const bool isEstimatedTwoBufferNotOverK = 4UL * adaptiveWin_.baseK * qmmv3_tiling_const::L1_TWO_BUFFER <
405- inputParams_.kSize;
406- if (!isEstimatedTwoBufferNotOverK || !isAInnerKAligned || !isBInnerKAligned) {
407- return false;
408- }
409 }385 }
410- // This runs before final L1 tiling. Estimate with stepK=2 and capped scaleKL1. Apply the same three-buffer386+ const L1TilingData& l1Tiling = calculator.GetOutput();
411- // eligibility as the final selection so an MTE2-bound non-full-load candidate can still replace A full-load.387+ const uint64_t baseK = adaptiveWin_.baseK;
412- uint64_t estimatedKL1 = static_cast<uint64_t>(STEP_K_TWO) * adaptiveWin_.baseK;388+ const uint64_t currentKL1 = std::min(l1Tiling.stepKa_, l1Tiling.stepKb_) * baseK;
413- uint64_t estimatedScaleKL1 = ops::CeilAlign(std::min(inputParams_.kSize, qmmv3_tiling_const::ESTIMATED_SCALE_K),389+ // Run on local copies of the scale factors: the dry-run must not mutate the real basicTiling_/tilingData_ state.
414- estimatedKL1);390+ uint32_t scaleFactorA = static_cast<uint32_t>(l1Tiling.scaleFactorA_);
415- MxL1EstimateParams estimateParams = {estimatedKL1, estimatedScaleKL1, baseM, baseN, isAFullLoad};391+ uint32_t scaleFactorB = static_cast<uint32_t>(l1Tiling.scaleFactorB_);
416- return SelectL1BufferNum(estimateParams) != qmmv3_tiling_const::L1_TWO_BUFFER;392+ const uint64_t baseScaleKL1 = DeriveScaleKL1(scaleFactorA, l1Tiling.stepKa_, scaleFactorB, l1Tiling.stepKb_, baseK);
393+ const MxL1EstimateParams currentParams = BuildL1EstimateParams(currentKL1, baseScaleKL1, baseM, baseN, isAFullLoad);
394+ const MxL1Plan plan = SelectMxL1Plan(currentParams, baseK, baseScaleKL1);
395+ return plan.l1BufferNum > qmmv3_tiling_const::L1_TWO_BUFFER;
417}396}
418 397 
419bool AdaptiveSlidingWindowMXBasicAPITiling::ShouldKeepAFullLoadByRepeatLoadRatio() const398bool AdaptiveSlidingWindowMXBasicAPITiling::ShouldKeepAFullLoadByRepeatLoadRatio() const
@@ -435,7 +414,7 @@ bool AdaptiveSlidingWindowMXBasicAPITiling::ShouldKeepAFullLoadByRepeatLoadRatio
435 return repeatABytes / totalLoadBytes > REPEAT_A_LOAD_RATIO_THRESHOLD;414 return repeatABytes / totalLoadBytes > REPEAT_A_LOAD_RATIO_THRESHOLD;
436}415}
437 416 
438-bool AdaptiveSlidingWindowMXBasicAPITiling::IsMxMte2Bound(double gmBandwidthTbps, double l2BandwidthTbps) const417+bool AdaptiveSlidingWindowMXBasicAPITiling::IsMte2Bound(double gmBandwidthTbps, double l2BandwidthTbps) const
439{418{
440 const uint64_t usedCoreNum = CalUsedCoreNum();419 const uint64_t usedCoreNum = CalUsedCoreNum();
441 if (gmBandwidthTbps <= 0.0 || l2BandwidthTbps <= 0.0 || adaptiveWin_.baseM == 0UL || adaptiveWin_.baseN == 0UL ||420 if (gmBandwidthTbps <= 0.0 || l2BandwidthTbps <= 0.0 || adaptiveWin_.baseM == 0UL || adaptiveWin_.baseN == 0UL ||
@@ -443,22 +422,14 @@ bool AdaptiveSlidingWindowMXBasicAPITiling::IsMxMte2Bound(double gmBandwidthTbps
443 return false;422 return false;
444 }423 }
445 424 
446- const uint64_t aInnerAxis = inputParams_.transA ? inputParams_.mSize : inputParams_.kSize;425+ if (!AreOperandInnerAxesAligned()) {
447- const uint64_t bInnerAxis = inputParams_.transB ? inputParams_.kSize : inputParams_.nSize;
448- const bool isInnerAxisAligned = GetSizeWithDataType(aInnerAxis, inputParams_.aDtype) %
449- qmmv3_tiling_const::MTE2_ADDRESS_ALIGN_SIZE ==
450- 0UL &&
451- GetSizeWithDataType(bInnerAxis, inputParams_.bDtype) %
452- qmmv3_tiling_const::MTE2_ADDRESS_ALIGN_SIZE ==
453- 0UL;
454- if (!isInnerAxisAligned) {
455 return true;426 return true;
456 }427 }
457 428 
458- return EstimateMxMte2TimeUs(gmBandwidthTbps, l2BandwidthTbps) > EstimateMxCubeTimeUs();429+ return EstimateMte2TimeUs(gmBandwidthTbps, l2BandwidthTbps) > EstimateMacTimeUs();
459}430}
460 431 
461-double AdaptiveSlidingWindowMXBasicAPITiling::EstimateMxMte2TimeUs(double gmBandwidthTbps, double l2BandwidthTbps) const432+double AdaptiveSlidingWindowMXBasicAPITiling::EstimateMte2TimeUs(double gmBandwidthTbps, double l2BandwidthTbps) const
462{433{
463 const double singleRoundABytes = static_cast<double>(434 const double singleRoundABytes = static_cast<double>(
464 CalcMxFullKLoadSize(inputParams_.mSize, inputParams_.aDtype, inputParams_.perTokenScaleDtype));435 CalcMxFullKLoadSize(inputParams_.mSize, inputParams_.aDtype, inputParams_.perTokenScaleDtype));
@@ -470,34 +441,18 @@ double AdaptiveSlidingWindowMXBasicAPITiling::EstimateMxMte2TimeUs(double gmBand
470 const uint64_t mBlockCnt = ops::CeilDiv(inputParams_.mSize, adaptiveWin_.baseM);441 const uint64_t mBlockCnt = ops::CeilDiv(inputParams_.mSize, adaptiveWin_.baseM);
471 const uint64_t nBlockCnt = ops::CeilDiv(inputParams_.nSize, adaptiveWin_.baseN);442 const uint64_t nBlockCnt = ops::CeilDiv(inputParams_.nSize, adaptiveWin_.baseN);
472 const uint64_t batchCount = std::max<uint64_t>(1UL, inputParams_.batchC);443 const uint64_t batchCount = std::max<uint64_t>(1UL, inputParams_.batchC);
473- const uint64_t aLoadCount = batchCount * (isAFullLoad_ ? 1UL : nBlockCnt);444+ // IsMte2Bound is reached only by a non-full plan, so A is loaded once for every N block.
445+ const uint64_t aLoadCount = batchCount * nBlockCnt;
474 const uint64_t bLoadCount = batchCount * mBlockCnt;446 const uint64_t bLoadCount = batchCount * mBlockCnt;
475 const uint64_t biasLoadCount = inputParams_.hasBias ? batchCount * mBlockCnt : 0UL;447 const uint64_t biasLoadCount = inputParams_.hasBias ? batchCount * mBlockCnt : 0UL;
476- const uint64_t aGmLoadCount = std::min<uint64_t>(aLoadCount, std::max<uint64_t>(1UL, inputParams_.batchA));448+ const Mte2LoadEstimate estimate = {singleRoundABytes, singleRoundBBytes, singleRoundBiasBytes,
477- const uint64_t bGmLoadCount = std::min<uint64_t>(bLoadCount, std::max<uint64_t>(1UL, inputParams_.batchB));449+ aLoadCount, bLoadCount, biasLoadCount};
478- const uint64_t biasGmLoadCount = std::min<uint64_t>(biasLoadCount, std::max<uint64_t>(1UL, inputParams_.batchBias));450+ return EstimateMte2LoadTimeUs(estimate, gmBandwidthTbps, l2BandwidthTbps);
479- const double gmLoadBytes = singleRoundABytes * static_cast<double>(aGmLoadCount) +
480- singleRoundBBytes * static_cast<double>(bGmLoadCount) +
481- singleRoundBiasBytes * static_cast<double>(biasGmLoadCount);
482- const double l2LoadBytes = singleRoundABytes * static_cast<double>(aLoadCount - aGmLoadCount) +
483- singleRoundBBytes * static_cast<double>(bLoadCount - bGmLoadCount) +
484- singleRoundBiasBytes * static_cast<double>(biasLoadCount - biasGmLoadCount);
485- return gmLoadBytes / (gmBandwidthTbps * qmmv3_tiling_const::BYTES_PER_US_PER_TBPS) +
486- l2LoadBytes / (l2BandwidthTbps * qmmv3_tiling_const::BYTES_PER_US_PER_TBPS);
487}451}
488 452 
489-double AdaptiveSlidingWindowMXBasicAPITiling::EstimateMxCubeTimeUs() const453+double AdaptiveSlidingWindowMXBasicAPITiling::EstimateMacTimeUs() const
490{454{
491- const uint64_t alignedM = ops::CeilAlign(inputParams_.mSize, qmmv3_tiling_const::CUBE_BLOCK);455+ return EstimateMatmulMacTimeUs(qmmv3_tiling_const::MXFP_DIVISOR_SIZE);
492- const uint64_t alignedN = ops::CeilAlign(inputParams_.nSize, qmmv3_tiling_const::CUBE_BLOCK);
493- const uint64_t alignedK = ops::CeilAlign(inputParams_.kSize, qmmv3_tiling_const::MXFP_DIVISOR_SIZE);
494- const uint64_t batchCount = std::max<uint64_t>(1UL, inputParams_.batchC);
495- const double totalCubeMacs = static_cast<double>(batchCount) * static_cast<double>(alignedM) *
496- static_cast<double>(alignedN) * static_cast<double>(alignedK);
497- const double cubeMacsPerCycle = static_cast<double>(
498- GetShapeWithDataType(qmmv3_tiling_const::MXFP8_CUBE_MACS_PER_CYCLE, inputParams_.aDtype));
499- return totalCubeMacs / static_cast<double>(CalUsedCoreNum()) / cubeMacsPerCycle /
500- qmmv3_tiling_const::ASCEND_950_CUBE_FREQ_MHZ;
501}456}
502 457 
503void AdaptiveSlidingWindowMXBasicAPITiling::UpdateAFullLoadStatus()458void AdaptiveSlidingWindowMXBasicAPITiling::UpdateAFullLoadStatus()
@@ -515,9 +470,9 @@ void AdaptiveSlidingWindowMXBasicAPITiling::UpdateAFullLoadStatus()
515 return;470 return;
516 }471 }
517 // Prefer A full-load when it still leaves enough L1 to enable 4-buffer or 3-buffer.472 // Prefer A full-load when it still leaves enough L1 to enable 4-buffer or 3-buffer.
518- if (CanOpenMultiBufferByL1Estimate(true, realBaseMSize, adaptiveWin_.baseN)) {473+ if (CanSelectMultiBufferByL1Plan(true, realBaseMSize, adaptiveWin_.baseN)) {
519 isAFullLoad_ = true;474 isAFullLoad_ = true;
520- } else if (CanOpenMultiBufferByL1Estimate(false, adaptiveWin_.baseM, adaptiveWin_.baseN) &&475+ } else if (CanSelectMultiBufferByL1Plan(false, adaptiveWin_.baseM, adaptiveWin_.baseN) &&
521 !ShouldKeepAFullLoadByRepeatLoadRatio()) {476 !ShouldKeepAFullLoadByRepeatLoadRatio()) {
522 // Keep A full-load disabled only when repeated A load is a small part of non-full-load GM traffic.477 // Keep A full-load disabled only when repeated A load is a small part of non-full-load GM traffic.
523 return;478 return;
@@ -1,5 +1,5 @@
1/**1/**
2- * Copyright (c) 2025 Huawei Technologies Co., Ltd.2+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3 * This program is free software, you can redistribute it and/or modify it under the terms and conditions of3 * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4 * CANN Open Software License Agreement Version 2.0 (the "License").4 * CANN Open Software License Agreement Version 2.0 (the "License").
5 * Please refer to the License for details. You may not use this file except in compliance with the License.5 * Please refer to the License for details. You may not use this file except in compliance with the License.
@@ -43,22 +43,31 @@ private:
43 bool isAFullLoad;43 bool isAFullLoad;
44 };44 };
45 45 
46+ struct MxL1Plan {
47+ uint64_t kL1;
48+ uint64_t scaleKL1;
49+ uint32_t l1BufferNum;
50+ };
51+ 
46 void CalculateNBufferNum();52 void CalculateNBufferNum();
47- MxL1EstimateParams BuildL1EstimateParams(uint64_t kL1) const;53+ uint64_t DeriveScaleKL1(uint32_t& scaleFactorA, uint64_t stepKa, uint32_t& scaleFactorB, uint64_t stepKb,
48- void ApplyMultiBufferL1Tiling(const MxL1EstimateParams& params, uint32_t l1BufferNum);54+ uint64_t baseK) const;
49- uint64_t GetHalfKFallbackScaleKL1(uint64_t kL1) const;55+ MxL1EstimateParams BuildL1EstimateParams(uint64_t kL1, uint64_t baseScaleKL1, uint64_t baseM, uint64_t baseN,
56+ bool isAFullLoad) const;
57+ MxL1Plan SelectMxL1Plan(const MxL1EstimateParams& currentParams, uint64_t baseK, uint64_t baseScaleKL1) const;
58+ MxL1Plan MakeMxL1Plan(const MxL1EstimateParams& params, uint32_t l1BufferNum) const;
59+ uint64_t GetHalfKFallbackScaleKL1(uint64_t scaleKL1, uint64_t kL1) const;
50 uint64_t GetFullCoverScaleKL1IfPossible(const MxL1EstimateParams& params, uint32_t l1BufferNum) const;60 uint64_t GetFullCoverScaleKL1IfPossible(const MxL1EstimateParams& params, uint32_t l1BufferNum) const;
51 bool CanReduceStepKToTwo(uint64_t stepKTwoKL1) const;61 bool CanReduceStepKToTwo(uint64_t stepKTwoKL1) const;
52 bool CanFitL1BufferNum(const MxL1EstimateParams& params, uint32_t l1BufferNum) const;62 bool CanFitL1BufferNum(const MxL1EstimateParams& params, uint32_t l1BufferNum) const;
53- uint32_t SelectL1BufferNum(const MxL1EstimateParams& params) const;
54 uint64_t CalcUsedL1Size(const MxL1EstimateParams& params, uint32_t l1BufferNum) const;63 uint64_t CalcUsedL1Size(const MxL1EstimateParams& params, uint32_t l1BufferNum) const;
55 uint64_t CalcMxFullKLoadSize(uint64_t outerSize, ge::DataType dataDtype, ge::DataType scaleDtype) const;64 uint64_t CalcMxFullKLoadSize(uint64_t outerSize, ge::DataType dataDtype, ge::DataType scaleDtype) const;
56 bool ShouldKeepAFullLoadByRepeatLoadRatio() const;65 bool ShouldKeepAFullLoadByRepeatLoadRatio() const;
57- bool IsMxMte2Bound(double gmBandwidthTbps, double l2BandwidthTbps) const;66+ bool IsMte2Bound(double gmBandwidthTbps, double l2BandwidthTbps) const;
58- double EstimateMxMte2TimeUs(double gmBandwidthTbps, double l2BandwidthTbps) const;67+ double EstimateMte2TimeUs(double gmBandwidthTbps, double l2BandwidthTbps) const;
59- double EstimateMxCubeTimeUs() const;68+ double EstimateMacTimeUs() const;
60 void UpdateAFullLoadStatus();69 void UpdateAFullLoadStatus();
61- bool CanOpenMultiBufferByL1Estimate(bool isAFullLoad, uint64_t baseM, uint64_t baseN) const;70+ bool CanSelectMultiBufferByL1Plan(bool isAFullLoad, uint64_t baseM, uint64_t baseN) const;
62 bool IsWithoutBatchTilingData() const;71 bool IsWithoutBatchTilingData() const;
63 void SetWithoutBatchTilingData();72 void SetWithoutBatchTilingData();
64 void NormalizeSingleRoundTailSplitBasicBlock();73 void NormalizeSingleRoundTailSplitBasicBlock();
@@ -14,6 +14,8 @@
14 */14 */
15#include "adaptive_sliding_window_tiling.h"15#include "adaptive_sliding_window_tiling.h"
16 16 
17+#include <algorithm>
18+ 
17#include "common/op_host/op_tiling/tiling_type_mm.h"19#include "common/op_host/op_tiling/tiling_type_mm.h"
18#include "log/log.h"20#include "log/log.h"
19#include "error_util.h"21#include "error_util.h"
@@ -39,8 +41,6 @@ constexpr uint32_t SCALER_FACTOR_M_BIT = 16;
39constexpr uint32_t SCALER_FACTOR_N_BIT = 24;41constexpr uint32_t SCALER_FACTOR_N_BIT = 24;
40 42 
41constexpr uint32_t VEC_CORE_GROUP_NUM = 2;43constexpr uint32_t VEC_CORE_GROUP_NUM = 2;
42- 
43-constexpr uint64_t LOAD_BALANCE_THRESHOLD = 1792; // Minimum M/N size to enable outer-axis load balancing.
44} // namespace44} // namespace
45 45 
46namespace optiling {46namespace optiling {
@@ -451,6 +451,66 @@ uint32_t AdaptiveSlidingWindowTiling::CalUsedCoreNum() const
451 return static_cast<uint32_t>(adaptiveWin_.tailWinBlockCnt * adaptiveWin_.mTailTile * adaptiveWin_.nTailTile);451 return static_cast<uint32_t>(adaptiveWin_.tailWinBlockCnt * adaptiveWin_.mTailTile * adaptiveWin_.nTailTile);
452}452}
453 453 
454+bool AdaptiveSlidingWindowTiling::AreOperandInnerAxesAligned() const
455+{
456+ const uint64_t aInnerAxis = inputParams_.transA ? inputParams_.mSize : inputParams_.kSize;
457+ const uint64_t bInnerAxis = inputParams_.transB ? inputParams_.kSize : inputParams_.nSize;
458+ const uint64_t aInnerAxisBytes = GetSizeWithDataType(aInnerAxis, inputParams_.aDtype);
459+ const uint64_t bInnerAxisBytes = GetSizeWithDataType(bInnerAxis, inputParams_.bDtype);
460+ return aInnerAxisBytes % qmmv3_tiling_const::MTE2_ADDRESS_ALIGN_SIZE == 0UL &&
461+ bInnerAxisBytes % qmmv3_tiling_const::MTE2_ADDRESS_ALIGN_SIZE == 0UL;
462+}
463+ 
464+bool AdaptiveSlidingWindowTiling::AreKInnerAxesAligned() const
465+{
466+ const uint64_t aKBytes = GetSizeWithDataType(inputParams_.kSize, inputParams_.aDtype);
467+ const uint64_t bKBytes = GetSizeWithDataType(inputParams_.kSize, inputParams_.bDtype);
468+ const bool isAInnerKAligned = inputParams_.transA || aKBytes % qmmv3_tiling_const::MTE2_ADDRESS_ALIGN_SIZE == 0UL;
469+ const bool isBInnerKAligned = !inputParams_.transB || bKBytes % qmmv3_tiling_const::MTE2_ADDRESS_ALIGN_SIZE == 0UL;
470+ return isAInnerKAligned && isBInnerKAligned;
471+}
472+ 
473+bool AdaptiveSlidingWindowTiling::IsKInnerKL1AlignedTo256Bytes(uint64_t kL1) const
474+{
475+ const uint64_t aKL1Bytes = GetSizeWithDataType(kL1, inputParams_.aDtype);
476+ const uint64_t bKL1Bytes = GetSizeWithDataType(kL1, inputParams_.bDtype);
477+ const bool isAInnerKAligned = inputParams_.transA || aKL1Bytes % qmmv3_tiling_const::BASIC_BLOCK_SIZE_256 == 0UL;
478+ const bool isBInnerKAligned = !inputParams_.transB || bKL1Bytes % qmmv3_tiling_const::BASIC_BLOCK_SIZE_256 == 0UL;
479+ return isAInnerKAligned && isBInnerKAligned;
480+}
481+ 
482+double AdaptiveSlidingWindowTiling::EstimateMte2LoadTimeUs(const Mte2LoadEstimate& estimate, double gmBandwidthTbps,
483+ double l2BandwidthTbps) const
484+{
485+ const uint64_t aGmLoadCount = std::min<uint64_t>(estimate.aLoadCount, std::max<uint64_t>(1UL, inputParams_.batchA));
486+ const uint64_t bGmLoadCount = std::min<uint64_t>(estimate.bLoadCount, std::max<uint64_t>(1UL, inputParams_.batchB));
487+ const uint64_t biasGmLoadCount = std::min<uint64_t>(estimate.biasLoadCount,
488+ std::max<uint64_t>(1UL, inputParams_.batchBias));
489+ const double gmLoadBytes = estimate.singleRoundABytes * static_cast<double>(aGmLoadCount) +
490+ estimate.singleRoundBBytes * static_cast<double>(bGmLoadCount) +
491+ estimate.singleRoundBiasBytes * static_cast<double>(biasGmLoadCount);
492+ const double l2LoadBytes = estimate.singleRoundABytes * static_cast<double>(estimate.aLoadCount - aGmLoadCount) +
493+ estimate.singleRoundBBytes * static_cast<double>(estimate.bLoadCount - bGmLoadCount) +
494+ estimate.singleRoundBiasBytes *
495+ static_cast<double>(estimate.biasLoadCount - biasGmLoadCount);
496+ return gmLoadBytes / (gmBandwidthTbps * qmmv3_tiling_const::BYTES_PER_US_PER_TBPS) +
497+ l2LoadBytes / (l2BandwidthTbps * qmmv3_tiling_const::BYTES_PER_US_PER_TBPS);
498+}
499+ 
500+double AdaptiveSlidingWindowTiling::EstimateMatmulMacTimeUs(uint64_t kAlignSize) const
501+{
502+ const uint64_t alignedM = ops::CeilAlign(inputParams_.mSize, qmmv3_tiling_const::CUBE_BLOCK);
503+ const uint64_t alignedN = ops::CeilAlign(inputParams_.nSize, qmmv3_tiling_const::CUBE_BLOCK);
504+ const uint64_t alignedK = ops::CeilAlign(inputParams_.kSize, kAlignSize);
505+ const uint64_t batchCount = std::max<uint64_t>(1UL, inputParams_.batchC);
506+ const double totalMacs = static_cast<double>(batchCount) * static_cast<double>(alignedM) *
507+ static_cast<double>(alignedN) * static_cast<double>(alignedK);
508+ const double macsPerCycle = static_cast<double>(
509+ GetShapeWithDataType(qmmv3_tiling_const::B8_CUBE_MACS_PER_CYCLE, inputParams_.aDtype));
510+ return totalMacs / static_cast<double>(CalUsedCoreNum()) / macsPerCycle /
511+ qmmv3_tiling_const::ASCEND_950_CUBE_FREQ_MHZ;
512+}
513+ 
454uint32_t AdaptiveSlidingWindowTiling::CalUsedCoreNum(uint32_t mTile, uint32_t nTile)514uint32_t AdaptiveSlidingWindowTiling::CalUsedCoreNum(uint32_t mTile, uint32_t nTile)
455{515{
456 return mTile * nTile * static_cast<uint32_t>(adaptiveWin_.tailWinBlockCnt);516 return mTile * nTile * static_cast<uint32_t>(adaptiveWin_.tailWinBlockCnt);
@@ -780,11 +840,11 @@ void AdaptiveSlidingWindowTiling::OptimizeEdgeBasicBlock()
780 qmmv3_tiling_const::MTE2_ADDRESS_ALIGN_SIZE ==840 qmmv3_tiling_const::MTE2_ADDRESS_ALIGN_SIZE ==
781 0UL;841 0UL;
782 if (mBaseTail > 0UL && !inputParams_.transA &&842 if (mBaseTail > 0UL && !inputParams_.transA &&
783- (isInnerAxisAlign || (inputParams_.mSize >= LOAD_BALANCE_THRESHOLD && !isMxfp4))) {843+ (isInnerAxisAlign || (inputParams_.mSize >= qmmv3_tiling_const::LOAD_BALANCE_THRESHOLD && !isMxfp4))) {
784 GetOuterMAxisTailCnt(adaptiveWin_.mBaseTailSplitCnt, adaptiveWin_.mTailMain);844 GetOuterMAxisTailCnt(adaptiveWin_.mBaseTailSplitCnt, adaptiveWin_.mTailMain);
785 }845 }
786 if (nBaseTail > 0UL && inputParams_.transB && !balanceAfterFixp && !inputParams_.isPerBlock && !isMxfp4 &&846 if (nBaseTail > 0UL && inputParams_.transB && !balanceAfterFixp && !inputParams_.isPerBlock && !isMxfp4 &&
787- (isInnerAxisAlign || (inputParams_.nSize >= LOAD_BALANCE_THRESHOLD))) {847+ (isInnerAxisAlign || (inputParams_.nSize >= qmmv3_tiling_const::LOAD_BALANCE_THRESHOLD))) {
788 GetOuterNAxisTailCnt(adaptiveWin_.nBaseTailSplitCnt, adaptiveWin_.nTailMain);848 GetOuterNAxisTailCnt(adaptiveWin_.nBaseTailSplitCnt, adaptiveWin_.nTailMain);
789 }849 }
790}850}
@@ -1,5 +1,5 @@
1/**1/**
2- * Copyright (c) 2025 Huawei Technologies Co., Ltd.2+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3 * This program is free software, you can redistribute it and/or modify it under the terms and conditions of3 * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4 * CANN Open Software License Agreement Version 2.0 (the "License").4 * CANN Open Software License Agreement Version 2.0 (the "License").
5 * Please refer to the License for details. You may not use this file except in compliance with the License.5 * Please refer to the License for details. You may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
20#include "exe_graph/runtime/shape.h"20#include "exe_graph/runtime/shape.h"
21#include "exe_graph/runtime/storage_shape.h"21#include "exe_graph/runtime/storage_shape.h"
22#include "exe_graph/runtime/tiling_context.h"22#include "exe_graph/runtime/tiling_context.h"
23-#include "graph/types.h"23+#include "graph/ge_error_codes.h"
24#include "platform/soc_spec.h"24#include "platform/soc_spec.h"
25 25 
26#include "../quant_batch_matmul_v3_tiling_base.h"26#include "../quant_batch_matmul_v3_tiling_base.h"
@@ -74,6 +74,16 @@ public:
74 ge::graphStatus PostTiling() override;74 ge::graphStatus PostTiling() override;
75 75 
76protected:76protected:
77+ struct Mte2LoadEstimate {
78+ double singleRoundABytes;
79+ double singleRoundBBytes;
80+ double singleRoundBiasBytes;
81+ uint64_t aLoadCount;
82+ uint64_t bLoadCount;
83+ uint64_t biasLoadCount;
84+ };
85+ 
86+ virtual bool IsTensorApiEnabled() const { return IsTensorapiCapable(); }
77 virtual void ResetTilingData();87 virtual void ResetTilingData();
78 ge::graphStatus CheckContext() override;88 ge::graphStatus CheckContext() override;
79 ge::graphStatus CalcUbTiling() override;89 ge::graphStatus CalcUbTiling() override;
@@ -90,6 +100,12 @@ protected:
90 void SetBf16Compat();100 void SetBf16Compat();
91 virtual void SetTilingData();101 virtual void SetTilingData();
92 uint32_t CalUsedCoreNum() const;102 uint32_t CalUsedCoreNum() const;
103+ bool AreOperandInnerAxesAligned() const;
104+ bool AreKInnerAxesAligned() const;
105+ bool IsKInnerKL1AlignedTo256Bytes(uint64_t kL1) const;
106+ double EstimateMte2LoadTimeUs(const Mte2LoadEstimate& estimate, double gmBandwidthTbps,
107+ double l2BandwidthTbps) const;
108+ double EstimateMatmulMacTimeUs(uint64_t kAlignSize) const;
93 virtual bool CalcBasicBlock();109 virtual bool CalcBasicBlock();
94 virtual void CalcTailBasicBlock();110 virtual void CalcTailBasicBlock();
95 virtual void CalcTailBasicBlockAfullLoad();111 virtual void CalcTailBasicBlockAfullLoad();
@@ -1,5 +1,5 @@
1/**1/**
2- * Copyright (c) 2025 Huawei Technologies Co., Ltd.2+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3 * This program is free software, you can redistribute it and/or modify it under the terms and conditions of3 * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4 * CANN Open Software License Agreement Version 2.0 (the "License").4 * CANN Open Software License Agreement Version 2.0 (the "License").
5 * Please refer to the License for details. You may not use this file except in compliance with the License.5 * Please refer to the License for details. You may not use this file except in compliance with the License.
@@ -21,8 +21,10 @@
21 21 
22namespace {22namespace {
23constexpr uint64_t PER_BLOCK_BASE_SIZE_256 = 256UL;23constexpr uint64_t PER_BLOCK_BASE_SIZE_256 = 256UL;
24-// If adjusted baseN loses 128B alignment and K is below this threshold, keep the original base block.24+// Reject candidates whose baseN is not 128-wide when K is below this byte-scaled threshold.
25constexpr uint64_t LOAD_BALANCE_BASE_N_128_ALIGN_K_THRESHOLD = 2560UL;25constexpr uint64_t LOAD_BALANCE_BASE_N_128_ALIGN_K_THRESHOLD = 2560UL;
26+// Two/three-round grids use the original search; larger grids require stricter transfer alignment.
27+constexpr uint64_t LOAD_BALANCE_SMALL_ROUND_LIMIT = 3UL;
26// Rebalance M/N split when one base dimension is at least twice the other.28// Rebalance M/N split when one base dimension is at least twice the other.
27constexpr uint64_t BASEM_BASEN_RATIO = 2UL;29constexpr uint64_t BASEM_BASEN_RATIO = 2UL;
28// Oversized baseK candidates are halved above this supported tiling range.30// Oversized baseK candidates are halved above this supported tiling range.
@@ -33,6 +35,9 @@ constexpr uint32_t DOUBLE_CORE_NUM = 2U;
33// Epsilon for comparing score ratios during base-block search.35// Epsilon for comparing score ratios during base-block search.
34constexpr double SCORE_COMPARE_EPS = 1e-12;36constexpr double SCORE_COMPARE_EPS = 1e-12;
35constexpr uint32_t SMALL_MN_EXPAND_RATIO = 3U;37constexpr uint32_t SMALL_MN_EXPAND_RATIO = 3U;
38+// Do not switch a Cube/MX tile across the compute/memory roofline on a marginal estimate. The margin absorbs
39+// cache/pipeline effects that are not represented by the per-K tile arithmetic-intensity model.
40+constexpr double LOAD_BALANCE_ROOFLINE_MARGIN = 0.05;
36 41 
37uint64_t GetNextLoadBalanceBase(uint64_t curBase, uint64_t baseAlign)42uint64_t GetNextLoadBalanceBase(uint64_t curBase, uint64_t baseAlign)
38{43{
@@ -55,6 +60,23 @@ double GetMemoryComputeScore(uint64_t baseM, uint64_t baseN)
55 // This is (baseM + baseN) / (baseM * baseN); lower means smaller baseM + baseN for the same output area.60 // This is (baseM + baseN) / (baseM * baseN); lower means smaller baseM + baseN for the same output area.
56 return (static_cast<double>(baseM) + baseN) / (static_cast<double>(baseM) * baseN);61 return (static_cast<double>(baseM) + baseN) / (static_cast<double>(baseM) * baseN);
57}62}
63+ 
64+double GetDtypeBytes(ge::DataType dtype)
65+{
66+ if (dtype == ge::DT_INT4 || dtype == ge::DT_FLOAT4_E2M1 || dtype == ge::DT_FLOAT4_E1M2) {
67+ return 0.5;
68+ }
69+ return static_cast<double>(ge::GetSizeByDataType(dtype));
70+}
71+ 
72+double GetTileArithmeticIntensity(uint64_t baseM, uint64_t baseN, ge::DataType aDtype, ge::DataType bDtype)
73+{
74+ const double aBytesPerK = static_cast<double>(baseM) * GetDtypeBytes(aDtype);
75+ const double bBytesPerK = static_cast<double>(baseN) * GetDtypeBytes(bDtype);
76+ const double bytesPerK = aBytesPerK + bBytesPerK;
77+ return bytesPerK > 0.0 ? static_cast<double>(baseM) * baseN / bytesPerK : 0.0;
78+}
79+ 
58} // namespace80} // namespace
59 81 
60namespace optiling {82namespace optiling {
@@ -101,7 +123,7 @@ bool BaseBlockCalculator::Compute(BaseBlockMode mode)
101 OP_LOGE(inputParams_.opName, "Failed to adjust base block.");123 OP_LOGE(inputParams_.opName, "Failed to adjust base block.");
102 return false;124 return false;
103 }125 }
104- OptimizeBaseBlockForLoadBalance();126+ OptimizeBaseBlockForLoadBalance(mode);
105 }127 }
106 return ValidateBaseBlock();128 return ValidateBaseBlock();
107}129}
@@ -110,6 +132,12 @@ const BaseBlockRes& BaseBlockCalculator::GetOutput() const { return baseBlockRes
110 132 
111bool BaseBlockCalculator::ValidateInput() const133bool BaseBlockCalculator::ValidateInput() const
112{134{
135+ OP_TILING_CHECK(
136+ inputParams_.mSize == 0UL || inputParams_.nSize == 0UL || inputParams_.kSize == 0UL,
137+ CUBE_INNER_ERR_REPORT(inputParams_.opName,
138+ "Invalid BaseBlockCalculator shape: M(%lu), N(%lu) and K(%lu) should be greater than 0.",
139+ inputParams_.mSize, inputParams_.nSize, inputParams_.kSize),
140+ return false);
113 OP_TILING_CHECK(141 OP_TILING_CHECK(
114 compileInfo_.aicNum == 0UL || batchCoreCnt_ == 0UL,142 compileInfo_.aicNum == 0UL || batchCoreCnt_ == 0UL,
115 CUBE_INNER_ERR_REPORT(143 CUBE_INNER_ERR_REPORT(
@@ -328,14 +356,21 @@ bool BaseBlockCalculator::OptimizeBaseBlockForCoreUtilization(BaseBlockMode mode
328 }356 }
329}357}
330 358 
331-void BaseBlockCalculator::OptimizeBaseBlockForLoadBalance()359+void BaseBlockCalculator::OptimizeBaseBlockForLoadBalance(BaseBlockMode mode)
332{360{
333- if (!inputParams_.isMxPerGroup || compileInfo_.npuArch != NpuArch::DAV_3510) {361+ const bool enableLoadBalance = inputParams_.isMxPerGroup || mode == BaseBlockMode::CUBE_BASIC;
362+ if (!enableLoadBalance || compileInfo_.npuArch != NpuArch::DAV_3510) {
363+ return;
364+ }
365+ // For pure Cube K-inner operands, conservatively keep the original base below the unscaled K threshold.
366+ // This initial guard compares K elements directly, without converting them to bytes.
367+ if (mode == BaseBlockMode::CUBE_BASIC && (!inputParams_.transA || inputParams_.transB) &&
368+ inputParams_.kSize < qmmv3_tiling_const::L2_ALIGN_SIZE) {
334 return;369 return;
335 }370 }
336 uint64_t roundLimit = GetSingleCoreMaxRound(baseBlockRes_.baseM, baseBlockRes_.baseN);371 uint64_t roundLimit = GetSingleCoreMaxRound(baseBlockRes_.baseM, baseBlockRes_.baseN);
337- // Rebalance only two- or three-round cases; keep the default block otherwise.372+ // Keep single-round grids unchanged; candidates beyond the original two/three-round window are guarded below.
338- if (roundLimit == 1UL || roundLimit > 3UL) {373+ if (roundLimit == 1UL) {
339 return;374 return;
340 }375 }
341 uint64_t originLastRoundBlockCnt = GetLastRoundBlockCnt(baseBlockRes_.baseM, baseBlockRes_.baseN);376 uint64_t originLastRoundBlockCnt = GetLastRoundBlockCnt(baseBlockRes_.baseM, baseBlockRes_.baseN);
@@ -348,54 +383,92 @@ void BaseBlockCalculator::OptimizeBaseBlockForLoadBalance()
348 uint64_t bestBaseM = baseBlockRes_.baseM;383 uint64_t bestBaseM = baseBlockRes_.baseM;
349 uint64_t bestBaseN = baseBlockRes_.baseN;384 uint64_t bestBaseN = baseBlockRes_.baseN;
350 SearchLoadBalanceBaseBlock(roundLimit, originLastRoundUsedCore, originMemoryComputeScore, bestBaseM, bestBaseN);385 SearchLoadBalanceBaseBlock(roundLimit, originLastRoundUsedCore, originMemoryComputeScore, bestBaseM, bestBaseN);
351- TryApplyLoadBalanceBase(bestBaseM, bestBaseN);386+ ApplyLoadBalanceBase(bestBaseM, bestBaseN);
352}387}
353 388 
354void BaseBlockCalculator::SearchLoadBalanceBaseBlock(uint64_t roundLimit, uint64_t originLastRoundUsedCore,389void BaseBlockCalculator::SearchLoadBalanceBaseBlock(uint64_t roundLimit, uint64_t originLastRoundUsedCore,
355 double originMemoryComputeScore, uint64_t& bestBaseM,390 double originMemoryComputeScore, uint64_t& bestBaseM,
356 uint64_t& bestBaseN) const391 uint64_t& bestBaseN) const
357{392{
358- double balanceRate = 0.0;393+ // Treat the current physical block as the baseline for every supported template. A candidate must improve
359- double memoryComputeScore = 0.0;394+ // balance, or improve the memory/compute tie-breaker at equal balance.
395+ double balanceRate = GetBalanceRate(baseBlockRes_.baseM, baseBlockRes_.baseN);
396+ double memoryComputeScore = originMemoryComputeScore;
360 uint64_t baseMAlignNum = inputParams_.transA ?397 uint64_t baseMAlignNum = inputParams_.transA ?
361 GetShapeWithDataType(qmmv3_tiling_const::L2_ALIGN_SIZE, inputParams_.aDtype) :398 GetShapeWithDataType(qmmv3_tiling_const::L2_ALIGN_SIZE, inputParams_.aDtype) :
362 qmmv3_tiling_const::CUBE_BLOCK;399 qmmv3_tiling_const::CUBE_BLOCK;
363 uint64_t baseNAlignNum = GetBaseNAlignSize(qmmv3_tiling_const::L2_ALIGN_SIZE);400 uint64_t baseNAlignNum = GetBaseNAlignSize(qmmv3_tiling_const::L2_ALIGN_SIZE);
364 uint64_t searchBaseM = ops::CeilAlign(baseBlockRes_.baseM, baseMAlignNum);401 uint64_t searchBaseM = ops::CeilAlign(baseBlockRes_.baseM, baseMAlignNum);
365 uint64_t searchBaseN = ops::CeilAlign(baseBlockRes_.baseN, baseNAlignNum);402 uint64_t searchBaseN = ops::CeilAlign(baseBlockRes_.baseN, baseNAlignNum);
366- bool hasCandidate = false;
367 for (uint64_t curBaseM = searchBaseM; curBaseM != 0UL; curBaseM = GetNextLoadBalanceBase(curBaseM, baseMAlignNum)) {403 for (uint64_t curBaseM = searchBaseM; curBaseM != 0UL; curBaseM = GetNextLoadBalanceBase(curBaseM, baseMAlignNum)) {
368 for (uint64_t curBaseN = searchBaseN; curBaseN != 0UL;404 for (uint64_t curBaseN = searchBaseN; curBaseN != 0UL;
369 curBaseN = GetNextLoadBalanceBase(curBaseN, baseNAlignNum)) {405 curBaseN = GetNextLoadBalanceBase(curBaseN, baseNAlignNum)) {
370- uint64_t curRound = GetSingleCoreMaxRound(curBaseM, curBaseN);406+ // The kernel uses the real-axis aligned block when an L2-aligned search point exceeds M/N. Score that
407+ // effective block directly so selection and application do not evaluate different geometries.
408+ const uint64_t effectiveBaseM = curBaseM > inputParams_.mSize ?
409+ ops::CeilAlign(inputParams_.mSize, GetBaseMAlignSize()) :
410+ curBaseM;
411+ const uint64_t effectiveBaseN = curBaseN > inputParams_.nSize ?
412+ ops::CeilAlign(inputParams_.nSize,
413+ GetBaseNAlignSize(qmmv3_tiling_const::L1_ALIGN_SIZE)) :
414+ curBaseN;
415+ uint64_t curRound = GetSingleCoreMaxRound(effectiveBaseM, effectiveBaseN);
371 // Decreasing baseN only increases tile count in this loop, so later candidates will not recover.416 // Decreasing baseN only increases tile count in this loop, so later candidates will not recover.
372 if (curRound > roundLimit) {417 if (curRound > roundLimit) {
373 break;418 break;
374 }419 }
375- if (ShouldSkipLoadBalanceCandidate(curBaseM, curBaseN, originLastRoundUsedCore, originMemoryComputeScore)) {420+ if (ShouldSkipLoadBalanceCandidate(effectiveBaseM, effectiveBaseN, roundLimit, originLastRoundUsedCore,
421+ originMemoryComputeScore)) {
376 continue;422 continue;
377 }423 }
378- double curBalanceRate = GetBalanceRate(curBaseM, curBaseN);424+ double curBalanceRate = GetBalanceRate(effectiveBaseM, effectiveBaseN);
379- double curMemoryComputeScore = GetMemoryComputeScore(curBaseM, curBaseN);425+ double curMemoryComputeScore = GetMemoryComputeScore(effectiveBaseM, effectiveBaseN);
380 // Pick higher curBalanceRate first; use memory-compute score only as a tie-breaker.426 // Pick higher curBalanceRate first; use memory-compute score only as a tie-breaker.
381 bool balanceBetter = curBalanceRate > balanceRate + SCORE_COMPARE_EPS;427 bool balanceBetter = curBalanceRate > balanceRate + SCORE_COMPARE_EPS;
382 bool memoryComputeBetter = IsScoreEqual(curBalanceRate, balanceRate) &&428 bool memoryComputeBetter = IsScoreEqual(curBalanceRate, balanceRate) &&
383 curMemoryComputeScore + SCORE_COMPARE_EPS < memoryComputeScore;429 curMemoryComputeScore + SCORE_COMPARE_EPS < memoryComputeScore;
384- if (!hasCandidate || balanceBetter || memoryComputeBetter) {430+ if (balanceBetter || memoryComputeBetter) {
385- bestBaseM = curBaseM;431+ bestBaseM = effectiveBaseM;
386- bestBaseN = curBaseN;432+ bestBaseN = effectiveBaseN;
387 balanceRate = curBalanceRate;433 balanceRate = curBalanceRate;
388 memoryComputeScore = curMemoryComputeScore;434 memoryComputeScore = curMemoryComputeScore;
389- hasCandidate = true;
390 }435 }
391 }436 }
392 }437 }
393}438}
394 439 
395-bool BaseBlockCalculator::ShouldSkipLoadBalanceCandidate(uint64_t curBaseM, uint64_t curBaseN,440+bool BaseBlockCalculator::ShouldSkipLoadBalanceCandidate(uint64_t curBaseM, uint64_t curBaseN, uint64_t roundLimit,
396 uint64_t originLastRoundUsedCore,441 uint64_t originLastRoundUsedCore,
397 double originMemoryComputeScore) const442 double originMemoryComputeScore) const
398{443{
444+ if (curBaseN % qmmv3_tiling_const::BASIC_BLOCK_SIZE_128 != 0UL &&
445+ inputParams_.kSize < GetShapeWithDataType(LOAD_BALANCE_BASE_N_128_ALIGN_K_THRESHOLD, inputParams_.aDtype)) {
446+ return true;
447+ }
448+ if (roundLimit > LOAD_BALANCE_SMALL_ROUND_LIMIT) {
449+ // Larger-round adjustments must retain a 128-column-aligned baseN for Fixpipe writeback.
450+ if (curBaseN % qmmv3_tiling_const::BASIC_BLOCK_SIZE_128 != 0UL) {
451+ return true;
452+ }
453+ const bool isKInnerAxisUnaligned = (!inputParams_.transA &&
454+ GetSizeWithDataType(inputParams_.kSize, inputParams_.aDtype) %
455+ qmmv3_tiling_const::L2_ALIGN_SIZE !=
456+ 0UL) ||
457+ (inputParams_.transB &&
458+ GetSizeWithDataType(inputParams_.kSize, inputParams_.bDtype) %
459+ qmmv3_tiling_const::L2_ALIGN_SIZE !=
460+ 0UL);
461+ // The K threshold is in elements; reject M changes only, leaving N-only candidates eligible.
462+ if (curBaseM != baseBlockRes_.baseM && isKInnerAxisUnaligned &&
463+ inputParams_.kSize < qmmv3_tiling_const::LOAD_BALANCE_THRESHOLD) {
464+ return true;
465+ }
466+ }
467+ // Keep a candidate from crossing the compute/MTE2 roofline while load-balance changes the logical block grid.
468+ // Use the common Cube/MX arithmetic-intensity model with the effective L2 bandwidth below.
469+ if (ShouldKeepOriginForRoofline(curBaseM, curBaseN)) {
470+ return true;
471+ }
399 bool isOriginBase = curBaseM == baseBlockRes_.baseM && curBaseN == baseBlockRes_.baseN;472 bool isOriginBase = curBaseM == baseBlockRes_.baseM && curBaseN == baseBlockRes_.baseN;
400 uint64_t curLastRoundBlockCnt = GetLastRoundBlockCnt(curBaseM, curBaseN);473 uint64_t curLastRoundBlockCnt = GetLastRoundBlockCnt(curBaseM, curBaseN);
401 double curMemoryComputeScore = GetMemoryComputeScore(curBaseM, curBaseN);474 double curMemoryComputeScore = GetMemoryComputeScore(curBaseM, curBaseN);
@@ -405,16 +478,48 @@ bool BaseBlockCalculator::ShouldSkipLoadBalanceCandidate(uint64_t curBaseM, uint
405 return isOriginBase || lastRoundBlockCntLess || memoryComputeWorseWithoutCoreGain;478 return isOriginBase || lastRoundBlockCntLess || memoryComputeWorseWithoutCoreGain;
406}479}
407 480 
408-void BaseBlockCalculator::TryApplyLoadBalanceBase(uint64_t bestBaseM, uint64_t bestBaseN)481+bool BaseBlockCalculator::ShouldKeepOriginForRoofline(uint64_t curBaseM, uint64_t curBaseN) const
409{482{
410- uint64_t baseN128AlignFallbackKThreshold = GetShapeWithDataType(LOAD_BALANCE_BASE_N_128_ALIGN_K_THRESHOLD,483+ if (curBaseM == baseBlockRes_.baseM && curBaseN == baseBlockRes_.baseN) {
411- inputParams_.aDtype);484+ return false;
412- // For small K, keep the original base if the candidate baseN is not 128-aligned.
413- bool shouldFallbackToOriginBase = bestBaseN % qmmv3_tiling_const::BASIC_BLOCK_SIZE_128 != 0UL &&
414- inputParams_.kSize < baseN128AlignFallbackKThreshold;
415- if (shouldFallbackToOriginBase) {
416- return;
417 }485 }
486+ 
487+ // This guard targets the load-balance trade-off only: if a candidate removes a whole wave, keep it eligible even
488+ // when its per-tile intensity is lower. For the same number of waves, require that it really adds logical work
489+ // before trading the original compute-bound tile for a memory-bound one.
490+ const uint64_t originBlockCnt = batchCoreCnt_ * ops::CeilDiv(inputParams_.mSize, baseBlockRes_.baseM) *
491+ ops::CeilDiv(inputParams_.nSize, baseBlockRes_.baseN);
492+ const uint64_t candidateBlockCnt = batchCoreCnt_ * ops::CeilDiv(inputParams_.mSize, curBaseM) *
493+ ops::CeilDiv(inputParams_.nSize, curBaseN);
494+ if (GetSingleCoreMaxRound(curBaseM, curBaseN) != GetSingleCoreMaxRound(baseBlockRes_.baseM, baseBlockRes_.baseN) ||
495+ candidateBlockCnt <= originBlockCnt) {
496+ return false;
497+ }
498+ 
499+ const double originIntensity = GetTileArithmeticIntensity(baseBlockRes_.baseM, baseBlockRes_.baseN,
500+ inputParams_.aDtype, inputParams_.bDtype);
501+ const double candidateIntensity = GetTileArithmeticIntensity(curBaseM, curBaseN, inputParams_.aDtype,
502+ inputParams_.bDtype);
503+ const double dtypeBytes = GetDtypeBytes(inputParams_.aDtype);
504+ if (dtypeBytes <= 0.0 || compileInfo_.aicNum == 0U) {
505+ return false;
506+ }
507+ 
508+ // Match EstimateMatmulMacTimeUs: B8 peak is scaled by input element size and replicated over active AICs.
509+ const double macsPerCycle = static_cast<double>(qmmv3_tiling_const::B8_CUBE_MACS_PER_CYCLE) / dtypeBytes;
510+ const double cubeMacsPerUs = macsPerCycle * qmmv3_tiling_const::ASCEND_950_CUBE_FREQ_MHZ *
511+ static_cast<double>(compileInfo_.aicNum);
512+ // Use effective L2 bandwidth here to avoid over-constraining MX candidates at the early base-block stage.
513+ const double l2BytesPerUs = qmmv3_tiling_const::ASCEND_950_MAX_L2_BW_TBPS *
514+ qmmv3_tiling_const::MTE2_BW_UTILIZATION * qmmv3_tiling_const::BYTES_PER_US_PER_TBPS;
515+ const double rooflineIntensity = cubeMacsPerUs / l2BytesPerUs;
516+ const double originComputeBoundLimit = rooflineIntensity * (1.0 + LOAD_BALANCE_ROOFLINE_MARGIN);
517+ const double candidateMte2BoundLimit = rooflineIntensity * (1.0 - LOAD_BALANCE_ROOFLINE_MARGIN);
518+ return originIntensity > originComputeBoundLimit && candidateIntensity < candidateMte2BoundLimit;
519+}
520+ 
521+void BaseBlockCalculator::ApplyLoadBalanceBase(uint64_t bestBaseM, uint64_t bestBaseN)
522+{
418 baseBlockRes_.baseM = bestBaseM;523 baseBlockRes_.baseM = bestBaseM;
419 baseBlockRes_.baseN = bestBaseN;524 baseBlockRes_.baseN = bestBaseN;
420 if (baseBlockRes_.baseM > inputParams_.mSize) {525 if (baseBlockRes_.baseM > inputParams_.mSize) {
@@ -1,5 +1,5 @@
1/**1/**
2- * Copyright (c) 2025 Huawei Technologies Co., Ltd.2+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3 * This program is free software, you can redistribute it and/or modify it under the terms and conditions of3 * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4 * CANN Open Software License Agreement Version 2.0 (the "License").4 * CANN Open Software License Agreement Version 2.0 (the "License").
5 * Please refer to the License for details. You may not use this file except in compliance with the License.5 * Please refer to the License for details. You may not use this file except in compliance with the License.
@@ -35,7 +35,7 @@ struct BaseBlockRes {
35 bool useTailWinLogic = true;35 bool useTailWinLogic = true;
36};36};
37 37 
38-enum class BaseBlockMode { DEFAULT = 0, PERBLOCK, MMAD_S8S4, STREAMK };38+enum class BaseBlockMode { DEFAULT = 0, PERBLOCK, MMAD_S8S4, STREAMK, CUBE_BASIC };
39 39 
40uint64_t GetStreamKSingleCoreKAlignSize(ge::DataType inputDtype);40uint64_t GetStreamKSingleCoreKAlignSize(ge::DataType inputDtype);
41 41 
@@ -70,12 +70,13 @@ private:
70 uint64_t GetBaseMAlignSize() const;70 uint64_t GetBaseMAlignSize() const;
71 uint64_t GetBaseKAlignSize() const;71 uint64_t GetBaseKAlignSize() const;
72 bool OptimizeBaseBlockForCoreUtilization(BaseBlockMode mode);72 bool OptimizeBaseBlockForCoreUtilization(BaseBlockMode mode);
73- void OptimizeBaseBlockForLoadBalance();73+ void OptimizeBaseBlockForLoadBalance(BaseBlockMode mode);
74 void SearchLoadBalanceBaseBlock(uint64_t roundLimit, uint64_t originLastRoundUsedCore,74 void SearchLoadBalanceBaseBlock(uint64_t roundLimit, uint64_t originLastRoundUsedCore,
75 double originMemoryComputeScore, uint64_t& bestBaseM, uint64_t& bestBaseN) const;75 double originMemoryComputeScore, uint64_t& bestBaseM, uint64_t& bestBaseN) const;
76- bool ShouldSkipLoadBalanceCandidate(uint64_t curBaseM, uint64_t curBaseN, uint64_t originLastRoundUsedCore,76+ bool ShouldSkipLoadBalanceCandidate(uint64_t curBaseM, uint64_t curBaseN, uint64_t roundLimit,
77- double originMemoryComputeScore) const;77+ uint64_t originLastRoundUsedCore, double originMemoryComputeScore) const;
78- void TryApplyLoadBalanceBase(uint64_t bestBaseM, uint64_t bestBaseN);78+ bool ShouldKeepOriginForRoofline(uint64_t curBaseM, uint64_t curBaseN) const;
79+ void ApplyLoadBalanceBase(uint64_t bestBaseM, uint64_t bestBaseN);
79 bool AdjustBaseBlockDefault();80 bool AdjustBaseBlockDefault();
80 void TrySwapBaseMNForMxFalseTrue(uint64_t& baseM, uint64_t& baseN) const;81 void TrySwapBaseMNForMxFalseTrue(uint64_t& baseM, uint64_t& baseN) const;
81 bool AdjustBaseBlockPerblock();82 bool AdjustBaseBlockPerblock();
@@ -1,5 +1,5 @@
1/**1/**
2- * Copyright (c) 2025 Huawei Technologies Co., Ltd.2+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3 * This program is free software, you can redistribute it and/or modify it under the terms and conditions of3 * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4 * CANN Open Software License Agreement Version 2.0 (the "License").4 * CANN Open Software License Agreement Version 2.0 (the "License").
5 * Please refer to the License for details. You may not use this file except in compliance with the License.5 * Please refer to the License for details. You may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@
23#include "exe_graph/runtime/tiling_context.h"23#include "exe_graph/runtime/tiling_context.h"
24#include "graph/types.h"24#include "graph/types.h"
25 25 
26+#include "../quant_batch_matmul_v3_compile_info.h"
26#include "../quant_batch_matmul_v3_tiling_base.h"27#include "../quant_batch_matmul_v3_tiling_base.h"
27#include "matmul/quant_batch_matmul_v3/op_kernel/arch35/quant_batch_matmul_v3_tiling_data.h"28#include "matmul/quant_batch_matmul_v3/op_kernel/arch35/quant_batch_matmul_v3_tiling_data.h"
28 29 
@@ -42,6 +43,8 @@ constexpr uint64_t BASIC_BLOCK_SIZE_32 = 32UL;
42constexpr uint64_t BASIC_BLOCK_SIZE_128 = 128UL;43constexpr uint64_t BASIC_BLOCK_SIZE_128 = 128UL;
43constexpr uint64_t BASIC_BLOCK_SIZE_256 = 256UL;44constexpr uint64_t BASIC_BLOCK_SIZE_256 = 256UL;
44constexpr uint64_t PER_BLOCK_SIZE = 128UL;45constexpr uint64_t PER_BLOCK_SIZE = 128UL;
46+// Minimum axis size for load balancing with an unaligned K-inner dimension.
47+constexpr uint64_t LOAD_BALANCE_THRESHOLD = 1792UL;
45constexpr uint32_t DOUBLE_BUFFER_NUM = 2U;48constexpr uint32_t DOUBLE_BUFFER_NUM = 2U;
46constexpr uint32_t DATA_SIZE_L0C = 4U;49constexpr uint32_t DATA_SIZE_L0C = 4U;
47constexpr uint8_t L1_TWO_BUFFER = 2U;50constexpr uint8_t L1_TWO_BUFFER = 2U;
@@ -58,13 +61,14 @@ constexpr uint64_t AFULLLOAD_SINGLE_CORE_B_SCALER = 2UL;
58constexpr uint64_t ESTIMATED_SCALE_K = 4096UL;61constexpr uint64_t ESTIMATED_SCALE_K = 4096UL;
59constexpr uint32_t SCALER_FACTOR_MAX = 127U;62constexpr uint32_t SCALER_FACTOR_MAX = 127U;
60constexpr uint32_t SCALER_FACTOR_MIN = 1U;63constexpr uint32_t SCALER_FACTOR_MIN = 1U;
61-// Fixed Ascend 950 theoretical parameters used by the DAV_3510 MX performance model.64+// Fixed Ascend 950 theoretical parameters used by the DAV_3510 performance models.
62constexpr double ASCEND_950_MAX_HBM_BW_TBPS = 4.0;65constexpr double ASCEND_950_MAX_HBM_BW_TBPS = 4.0;
63constexpr double ASCEND_950_MAX_L2_BW_TBPS = 5.2;66constexpr double ASCEND_950_MAX_L2_BW_TBPS = 5.2;
67+constexpr double MTE2_BW_UTILIZATION = 0.9;
64// One TB/s transfers 10^6 bytes per microsecond.68// One TB/s transfers 10^6 bytes per microsecond.
65constexpr double BYTES_PER_US_PER_TBPS = 1000.0 * 1000.0;69constexpr double BYTES_PER_US_PER_TBPS = 1000.0 * 1000.0;
66constexpr double ASCEND_950_CUBE_FREQ_MHZ = 1650.0;70constexpr double ASCEND_950_CUBE_FREQ_MHZ = 1650.0;
67-constexpr uint64_t MXFP8_CUBE_MACS_PER_CYCLE = 16UL * 32UL * 16UL;71+constexpr uint64_t B8_CUBE_MACS_PER_CYCLE = 16UL * 32UL * 16UL;
68} // namespace qmmv3_tiling_const72} // namespace qmmv3_tiling_const
69 73 
70struct BasicRunInfoTiling {74struct BasicRunInfoTiling {
@@ -1,5 +1,5 @@
1/**1/**
2- * Copyright (c) 2025 Huawei Technologies Co., Ltd.2+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3 * This program is free software, you can redistribute it and/or modify it under the terms and conditions of3 * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4 * CANN Open Software License Agreement Version 2.0 (the "License").4 * CANN Open Software License Agreement Version 2.0 (the "License").
5 * Please refer to the License for details. You may not use this file except in compliance with the License.5 * Please refer to the License for details. You may not use this file except in compliance with the License.
@@ -14,6 +14,10 @@
14 */14 */
15#ifndef __OP_HOST_QUANT_BATCH_MATMUL_V3_COMPILE_INFO_H__15#ifndef __OP_HOST_QUANT_BATCH_MATMUL_V3_COMPILE_INFO_H__
16#define __OP_HOST_QUANT_BATCH_MATMUL_V3_COMPILE_INFO_H__16#define __OP_HOST_QUANT_BATCH_MATMUL_V3_COMPILE_INFO_H__
17+ 
18+#include <cstdint>
19+#include <string>
20+ 
17#include "tiling/platform/platform_ascendc.h"21#include "tiling/platform/platform_ascendc.h"
18#include "platform/soc_spec.h"22#include "platform/soc_spec.h"
19 23 
@@ -38,4 +42,4 @@ struct QuantBatchMatmulV3CompileInfo {
38};42};
39 43 
40} // namespace optiling44} // namespace optiling
41-#endif // __OP_HOST_QUANT_BATCH_MATMUL_V3_COMPILE_INFO_H__45+#endif // __OP_HOST_QUANT_BATCH_MATMUL_V3_COMPILE_INFO_H__
@@ -10,14 +10,16 @@
10 10 
11/* !11/* !
12 * \file qbmm_cube_tensor_api_blaze.h12 * \file qbmm_cube_tensor_api_blaze.h
13- * \brief Blaze tensor API entry for quant batch matmul cube kernels (ND / WeightNz)13+ * \brief Blaze tensor API entries for quant batch matmul cube kernels with and without batch (ND / WeightNz).
14 */14 */
15#pragma once15#pragma once
16#include "quant_batch_matmul_v3_tiling_data.h"16#include "quant_batch_matmul_v3_tiling_data.h"
17#include "blaze/gemm/block/block_scheduler_qbmm.h"17#include "blaze/gemm/block/block_scheduler_qbmm.h"
18#include "blaze/epilogue/block/block_epilogue_empty.h"18#include "blaze/epilogue/block/block_epilogue_empty.h"
19#include "blaze/gemm/block/block_mmad_a8w8_fixpipe_quant.h"19#include "blaze/gemm/block/block_mmad_a8w8_fixpipe_quant.h"
20+#include "blaze/gemm/kernel/kernel_universal.h"
20#include "blaze/gemm/kernel/kernel_qbmm_cube.h"21#include "blaze/gemm/kernel/kernel_qbmm_cube.h"
22+#include "blaze/gemm/kernel/kernel_qbmm_cube_without_batch.h"
21 23 
22template <class A_TYPE, class B_TYPE, class SCALE_TYPE, class C_TYPE, class BIAS_TYPE, class aLayout, class bLayout,24template <class A_TYPE, class B_TYPE, class SCALE_TYPE, class C_TYPE, class BIAS_TYPE, class aLayout, class bLayout,
23 class cLayout, uint64_t FULL_LOAD_MODE = 0>25 class cLayout, uint64_t FULL_LOAD_MODE = 0>
@@ -80,3 +82,42 @@ __aicore__ inline void QbmmCubeTensorApiKernel(GM_ADDR aGM, GM_ADDR bGM, GM_ADDR
80 MatmulKernel qbmm;82 MatmulKernel qbmm;
81 qbmm(params);83 qbmm(params);
82}84}
85+ 
86+template <class A_TYPE, class B_TYPE, class SCALE_TYPE, class C_TYPE, class BIAS_TYPE, class aLayout, class bLayout,
87+ class cLayout, uint64_t FULL_LOAD_MODE = 0>
88+__aicore__ inline void QbmmCubeWithoutBatchTensorApiKernel(GM_ADDR aGM, GM_ADDR bGM, GM_ADDR scale, GM_ADDR bias,
89+ GM_ADDR perTokenScale, GM_ADDR cGM, const void* tilingData)
90+{
91+ using AType = A_TYPE;
92+ using BType = B_TYPE;
93+ using BiasType = BIAS_TYPE;
94+ using X2ScaleType = SCALE_TYPE;
95+ using OutType = C_TYPE;
96+ using BlockEpilogue = Blaze::Epilogue::Block::BlockEpilogueEmpty;
97+ using ProblemShape = asc::te::shape<int64_t, int64_t, int64_t, int64_t>;
98+ using BlockScheduler = Blaze::Gemm::Block::BlockSchedulerQuantBatchMatmulV3<ProblemShape, FULL_LOAD_MODE, aLayout,
99+ bLayout, AType>;
100+ using DispatchPolicy = Blaze::Gemm::MatmulWithScaleFixpipeQuant<
101+ FULL_LOAD_MODE, false, Blaze::Gemm::KernelMmadWithScaleFixpipeQuantWithoutBatch>;
102+ using BlockMmad = Blaze::Gemm::Block::BlockMmad<DispatchPolicy, AType, aLayout,
103+ AscendC::Std::tuple<BType, X2ScaleType>, bLayout, OutType, cLayout,
104+ BiasType, cLayout>;
105+ using MatmulKernel = Blaze::Gemm::Kernel::GemmUniversal<ProblemShape, BlockMmad, BlockEpilogue, BlockScheduler>;
106+ using Params = typename MatmulKernel::Params;
107+ 
108+ const auto& quantBmmTilingData = *static_cast<const DequantBmm::QuantBatchMatmulV3TensorAPIWithoutBatchTilingData*>(
109+ tilingData);
110+ using QBMMTiling = typename MatmulKernel::QBMMTiling;
111+ const QBMMTiling qbmmParams{
112+ quantBmmTilingData.x1QuantMode, quantBmmTilingData.x2QuantMode, quantBmmTilingData.kAL1,
113+ quantBmmTilingData.kBL1, quantBmmTilingData.nBufferNum, quantBmmTilingData.baseM,
114+ quantBmmTilingData.baseN, quantBmmTilingData.baseK, quantBmmTilingData.isBias,
115+ quantBmmTilingData.dbL0C, quantBmmTilingData.weightMustHitL2};
116+ MatmulKernel{}(
117+ Params{{quantBmmTilingData.m, quantBmmTilingData.n, quantBmmTilingData.k, 1L},
118+ {aGM, bGM, cGM, bias, perTokenScale, scale},
119+ {quantBmmTilingData.baseM, quantBmmTilingData.baseN, quantBmmTilingData.mTailTile,
120+ quantBmmTilingData.nTailTile, quantBmmTilingData.mBaseTailSplitCnt,
121+ quantBmmTilingData.nBaseTailSplitCnt, quantBmmTilingData.mTailMain, quantBmmTilingData.nTailMain},
122+ qbmmParams});
123+}
@@ -10,7 +10,7 @@
10 10 
11/* !11/* !
12 * \file qbmm_mix_tensor_api_blaze.h12 * \file qbmm_mix_tensor_api_blaze.h
13- * \brief Blaze tensor API entry for quant batch matmul MIX kernels (WeightNz)13+ * \brief Blaze tensor API entries for quant batch matmul MIX kernels with and without batch (WeightNz).
14 */14 */
15#pragma once15#pragma once
16#include "quant_batch_matmul_v3_tiling_data.h"16#include "quant_batch_matmul_v3_tiling_data.h"
@@ -18,6 +18,7 @@
18#include "blaze/epilogue/block/block_epilogue_dequant.h"18#include "blaze/epilogue/block/block_epilogue_dequant.h"
19#include "blaze/gemm/block/block_mmad_a8w8_mix.h"19#include "blaze/gemm/block/block_mmad_a8w8_mix.h"
20#include "blaze/gemm/kernel/kernel_qbmm_mix.h"20#include "blaze/gemm/kernel/kernel_qbmm_mix.h"
21+#include "blaze/gemm/kernel/kernel_qbmm_mix_without_batch.h"
21 22 
22template <class A_TYPE, class B_TYPE, class SCALE_TYPE, class C_TYPE, class BIAS_TYPE, class aLayout, class bLayout,23template <class A_TYPE, class B_TYPE, class SCALE_TYPE, class C_TYPE, class BIAS_TYPE, class aLayout, class bLayout,
23 class cLayout, uint64_t FULL_LOAD_MODE = 0>24 class cLayout, uint64_t FULL_LOAD_MODE = 0>
@@ -106,3 +107,64 @@ __aicore__ inline void QbmmMixTensorApiKernel(GM_ADDR aGM, GM_ADDR bGM, GM_ADDR
106 MatmulKernel qbmm;107 MatmulKernel qbmm;
107 qbmm(params);108 qbmm(params);
108}109}
110+ 
111+template <class A_TYPE, class B_TYPE, class SCALE_TYPE, class C_TYPE, class BIAS_TYPE, class aLayout, class bLayout,
112+ class cLayout, uint64_t FULL_LOAD_MODE = 0>
113+__aicore__ inline void QbmmMixWithoutBatchTensorApiKernel(GM_ADDR aGM, GM_ADDR bGM, GM_ADDR scale, GM_ADDR bias,
114+ GM_ADDR perTokenScale, GM_ADDR cGM, const void* tilingData)
115+{
116+ using AType = A_TYPE;
117+ using BType = B_TYPE;
118+ using BiasType = BIAS_TYPE;
119+ using X2ScaleType = SCALE_TYPE;
120+ using OutType = C_TYPE;
121+ using L0CType = typename AscendC::GetMmDstType<AType>::Type;
122+ 
123+ using ProblemShape = asc::te::shape<int64_t, int64_t, int64_t, int64_t>;
124+ using BlockScheduler = Blaze::Gemm::Block::BlockSchedulerQuantBatchMatmulV3<ProblemShape, FULL_LOAD_MODE, aLayout,
125+ bLayout, AType>;
126+ using DispatchPolicy = Blaze::Gemm::MatmulWithScaleMix<FULL_LOAD_MODE, false,
127+ Blaze::Gemm::KernelMmadWithScaleMixWithoutBatch>;
128+ using BlockMmad = Blaze::Gemm::Block::BlockMmad<DispatchPolicy, AType, aLayout,
129+ AscendC::Std::tuple<BType, X2ScaleType>, bLayout, OutType, cLayout,
130+ BiasType, cLayout>;
131+ using BlockEpilogue = Blaze::Epilogue::Block::BlockEpilogueDequant<OutType, BiasType, X2ScaleType, float, L0CType>;
132+ using MatmulKernel = Blaze::Gemm::Kernel::GemmUniversal<ProblemShape, BlockMmad, BlockEpilogue, BlockScheduler>;
133+ using Params = typename MatmulKernel::Params;
134+ using EpilogueParams = typename BlockEpilogue::Params;
135+ 
136+ const auto* quantBmmTilingData = static_cast<const DequantBmm::QuantBatchMatmulV3TensorAPIWithoutBatchTilingData*>(
137+ tilingData);
138+ 
139+ EpilogueParams epilogueParams{scale,
140+ perTokenScale,
141+ bias,
142+ cGM,
143+ static_cast<int64_t>(quantBmmTilingData->m),
144+ static_cast<int64_t>(quantBmmTilingData->n),
145+ static_cast<int64_t>(quantBmmTilingData->baseM),
146+ static_cast<int64_t>(quantBmmTilingData->baseN),
147+ quantBmmTilingData->x1QuantMode,
148+ quantBmmTilingData->x2QuantMode,
149+ static_cast<bool>(quantBmmTilingData->isBias),
150+ quantBmmTilingData->biasDtype};
151+ 
152+ const ProblemShape problemShape{static_cast<int64_t>(quantBmmTilingData->m),
153+ static_cast<int64_t>(quantBmmTilingData->n),
154+ static_cast<int64_t>(quantBmmTilingData->k), 1};
155+ const typename BlockMmad::BlockShape l0TileShape{static_cast<int64_t>(quantBmmTilingData->baseM),
156+ static_cast<int64_t>(quantBmmTilingData->baseN),
157+ static_cast<int64_t>(quantBmmTilingData->baseK), 0};
158+ Params params{.problemShape = problemShape,
159+ .mmParams = {aGM, bGM, problemShape, l0TileShape, static_cast<uint64_t>(quantBmmTilingData->kAL1),
160+ static_cast<uint64_t>(quantBmmTilingData->kBL1),
161+ static_cast<uint64_t>(quantBmmTilingData->nBufferNum), quantBmmTilingData->dbL0C > 1},
162+ .schParams = {quantBmmTilingData->baseM, quantBmmTilingData->baseN, quantBmmTilingData->mTailTile,
163+ quantBmmTilingData->nTailTile, quantBmmTilingData->mBaseTailSplitCnt,
164+ quantBmmTilingData->nBaseTailSplitCnt, quantBmmTilingData->mTailMain,
165+ quantBmmTilingData->nTailMain},
166+ .epilogueParams = epilogueParams,
167+ .qbmmParams = {quantBmmTilingData->weightMustHitL2}};
168+ MatmulKernel qbmm;
169+ qbmm(params);
170+}
@@ -1,82 +0,0 @@
1-/**
2- * Copyright (c) 2026 Huawei Technologies Co., Ltd.
3- * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4- * CANN Open Software License Agreement Version 2.0 (the "License").
5- * Please refer to the License for details. You may not use this file except in compliance with the License.
6- * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
7- * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8- * See LICENSE in the root of the software repository for the full text of the License.
9- */
10- 
11-/*!
12- * \file qbmm_mix_without_batch_tensor_api_blaze.h
13- * \brief Blaze tensor API entry for quant matmul MIX kernels without batch (WeightNz).
14- */
15-#pragma once
16- 
17-#include "quant_batch_matmul_v3_tiling_data.h"
18-#include "blaze/gemm/block/block_scheduler_qbmm.h"
19-#include "blaze/epilogue/block/block_epilogue_dequant.h"
20-#include "blaze/gemm/block/block_mmad_a8w8_mix.h"
21-#include "blaze/gemm/kernel/kernel_qbmm_mix_without_batch.h"
22- 
23-template <class A_TYPE, class B_TYPE, class SCALE_TYPE, class C_TYPE, class BIAS_TYPE, class aLayout, class bLayout,
24- class cLayout, uint64_t FULL_LOAD_MODE = 0>
25-__aicore__ inline void QbmmMixWithoutBatchTensorApiKernel(GM_ADDR aGM, GM_ADDR bGM, GM_ADDR scale, GM_ADDR bias,
26- GM_ADDR perTokenScale, GM_ADDR cGM, const void* tilingData)
27-{
28- using AType = A_TYPE;
29- using BType = B_TYPE;
30- using BiasType = BIAS_TYPE;
31- using X2ScaleType = SCALE_TYPE;
32- using OutType = C_TYPE;
33- using L0CType = typename AscendC::GetMmDstType<AType>::Type;
34- 
35- using ProblemShape = asc::te::shape<int64_t, int64_t, int64_t, int64_t>;
36- using BlockScheduler = Blaze::Gemm::Block::BlockSchedulerQuantBatchMatmulV3<ProblemShape, FULL_LOAD_MODE, aLayout,
37- bLayout, AType>;
38- using DispatchPolicy = Blaze::Gemm::MatmulWithScaleMix<FULL_LOAD_MODE, false,
39- Blaze::Gemm::KernelMmadWithScaleMixWithoutBatch>;
40- using BlockMmad = Blaze::Gemm::Block::BlockMmad<DispatchPolicy, AType, aLayout,
41- AscendC::Std::tuple<BType, X2ScaleType>, bLayout, OutType, cLayout,
42- BiasType, cLayout>;
43- using BlockEpilogue = Blaze::Epilogue::Block::BlockEpilogueDequant<OutType, BiasType, X2ScaleType, float, L0CType>;
44- using MatmulKernel = Blaze::Gemm::Kernel::GemmUniversal<ProblemShape, BlockMmad, BlockEpilogue, BlockScheduler>;
45- using Params = typename MatmulKernel::Params;
46- using EpilogueParams = typename BlockEpilogue::Params;
47- 
48- const auto* quantBmmTilingData = static_cast<const DequantBmm::QuantBatchMatmulV3TensorAPIWithoutBatchTilingData*>(
49- tilingData);
50- 
51- EpilogueParams epilogueParams{scale,
52- perTokenScale,
53- bias,
54- cGM,
55- static_cast<int64_t>(quantBmmTilingData->m),
56- static_cast<int64_t>(quantBmmTilingData->n),
57- static_cast<int64_t>(quantBmmTilingData->baseM),
58- static_cast<int64_t>(quantBmmTilingData->baseN),
59- quantBmmTilingData->x1QuantMode,
60- quantBmmTilingData->x2QuantMode,
61- static_cast<bool>(quantBmmTilingData->isBias),
62- quantBmmTilingData->biasDtype};
63- 
64- const ProblemShape problemShape{static_cast<int64_t>(quantBmmTilingData->m),
65- static_cast<int64_t>(quantBmmTilingData->n),
66- static_cast<int64_t>(quantBmmTilingData->k), 1};
67- const typename BlockMmad::BlockShape l0TileShape{static_cast<int64_t>(quantBmmTilingData->baseM),
68- static_cast<int64_t>(quantBmmTilingData->baseN),
69- static_cast<int64_t>(quantBmmTilingData->baseK), 0};
70- Params params{.problemShape = problemShape,
71- .mmParams = {aGM, bGM, problemShape, l0TileShape, static_cast<uint64_t>(quantBmmTilingData->kAL1),
72- static_cast<uint64_t>(quantBmmTilingData->kBL1),
73- static_cast<uint64_t>(quantBmmTilingData->nBufferNum), quantBmmTilingData->dbL0C > 1},
74- .schParams = {quantBmmTilingData->baseM, quantBmmTilingData->baseN, quantBmmTilingData->mTailTile,
75- quantBmmTilingData->nTailTile, quantBmmTilingData->mBaseTailSplitCnt,
76- quantBmmTilingData->nBaseTailSplitCnt, quantBmmTilingData->mTailMain,
77- quantBmmTilingData->nTailMain},
78- .epilogueParams = epilogueParams,
79- .qbmmParams = {quantBmmTilingData->weightMustHitL2}};
80- MatmulKernel qbmm;
81- qbmm(params);
82-}
@@ -10,13 +10,15 @@
10 10 
11/* !11/* !
12 * \file qbmm_mx_tensor_api_blaze.h12 * \file qbmm_mx_tensor_api_blaze.h
13- * \brief13+ * \brief Blaze tensor API entries for quant batch matmul MX kernels with and without batch.
14 */14 */
15#pragma once15#pragma once
16+#include "quant_batch_matmul_v3_tiling_data.h"
16#include "blaze/gemm/block/block_scheduler_qbmm.h"17#include "blaze/gemm/block/block_scheduler_qbmm.h"
17#include "blaze/epilogue/block/block_epilogue_empty.h"18#include "blaze/epilogue/block/block_epilogue_empty.h"
18#include "blaze/gemm/block/block_mmad_qbmm_mx.h"19#include "blaze/gemm/block/block_mmad_qbmm_mx.h"
19#include "blaze/gemm/kernel/kernel_qbmm_mx.h"20#include "blaze/gemm/kernel/kernel_qbmm_mx.h"
21+#include "blaze/gemm/kernel/kernel_qbmm_mx_without_batch.h"
20 22 
21template <class A_TYPE, class B_TYPE, class C_TYPE, class aLayout, class bLayout, class cLayout,23template <class A_TYPE, class B_TYPE, class C_TYPE, class aLayout, class bLayout, class cLayout,
22 uint64_t FULL_LOAD_MODE = 0>24 uint64_t FULL_LOAD_MODE = 0>
@@ -64,3 +66,40 @@ __aicore__ inline void QbmmMxTensorApiKernel(GM_ADDR aGM, GM_ADDR bGM, GM_ADDR s
64 dataParams.batchC3, dataParams.batchC4, dataParams.biasThreeDim, matmulTiling.baseM, matmulTiling.baseN,66 dataParams.batchC3, dataParams.batchC4, dataParams.biasThreeDim, matmulTiling.baseM, matmulTiling.baseN,
65 matmulTiling.baseK, matmulTiling.isBias, matmulTiling.dbL0C, matmulTiling.weightMustHitL2}});67 matmulTiling.baseK, matmulTiling.isBias, matmulTiling.dbL0C, matmulTiling.weightMustHitL2}});
66}68}
69+ 
70+template <class A_TYPE, class B_TYPE, class C_TYPE, class aLayout, class bLayout, class cLayout,
71+ uint64_t FULL_LOAD_MODE = 0>
72+__aicore__ inline void QbmmMxWithoutBatchTensorApiKernel(GM_ADDR aGM, GM_ADDR bGM, GM_ADDR scale, GM_ADDR bias,
73+ GM_ADDR perTokenScale, GM_ADDR cGM, const void* tilingData)
74+{
75+ using AType = A_TYPE;
76+ using BType = B_TYPE;
77+ using BiasType = float;
78+ using OutType = C_TYPE;
79+ 
80+ using BlockEpilogue = Blaze::Epilogue::Block::BlockEpilogueEmpty;
81+ using ProblemShape = asc::te::shape<int64_t, int64_t, int64_t, int64_t>;
82+ using BlockScheduler = Blaze::Gemm::Block::BlockSchedulerQuantBatchMatmulV3<ProblemShape, FULL_LOAD_MODE, aLayout,
83+ bLayout, AType>;
84+ 
85+ using DispatchPolicy = Blaze::Gemm::MatmulWithScaleMx<FULL_LOAD_MODE, false,
86+ Blaze::Gemm::KernelMmadWithScaleMxWithoutBatch>;
87+ using BlockMmad = Blaze::Gemm::Block::BlockMmad<DispatchPolicy, AType, aLayout, BType, bLayout, OutType, cLayout,
88+ BiasType, cLayout>;
89+ 
90+ using MatmulKernel = Blaze::Gemm::Kernel::GemmUniversal<ProblemShape, BlockMmad, BlockEpilogue, BlockScheduler>;
91+ using Params = typename MatmulKernel::Params;
92+ const DequantBmm::QuantBatchMatmulV3TensorAPIWithoutBatchTilingData&
93+ quantBmmTilingData = *static_cast<const DequantBmm::QuantBatchMatmulV3TensorAPIWithoutBatchTilingData*>(
94+ tilingData);
95+ 
96+ MatmulKernel{}(
97+ Params{{quantBmmTilingData.m, quantBmmTilingData.n, quantBmmTilingData.k, 1L},
98+ {aGM, bGM, cGM, bias, perTokenScale, scale},
99+ {quantBmmTilingData.kBL1, quantBmmTilingData.scaleKL1, quantBmmTilingData.nBufferNum},
100+ {quantBmmTilingData.baseM, quantBmmTilingData.baseN, quantBmmTilingData.mTailTile,
101+ quantBmmTilingData.nTailTile, quantBmmTilingData.mBaseTailSplitCnt,
102+ quantBmmTilingData.nBaseTailSplitCnt, quantBmmTilingData.mTailMain, quantBmmTilingData.nTailMain},
103+ {quantBmmTilingData.baseM, quantBmmTilingData.baseN, quantBmmTilingData.baseK, quantBmmTilingData.isBias,
104+ quantBmmTilingData.dbL0C, quantBmmTilingData.weightMustHitL2}});
105+}
@@ -1,57 +0,0 @@
1-/**
2- * Copyright (c) 2026 Huawei Technologies Co., Ltd.
3- * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4- * CANN Open Software License Agreement Version 2.0 (the "License").
5- * Please refer to the License for details. You may not use this file except in compliance with the License.
6- * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
7- * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8- * See LICENSE in the root of the software repository for the full text of the License.
9- */
10- 
11-/* !
12- * \file qbmm_mx_without_batch_tensor_api_blaze.h
13- * \brief
14- */
15-#pragma once
16-#include "quant_batch_matmul_v3_tiling_data.h"
17-#include "blaze/gemm/block/block_scheduler_qbmm.h"
18-#include "blaze/epilogue/block/block_epilogue_empty.h"
19-#include "blaze/gemm/block/block_mmad_qbmm_mx.h"
20-#include "blaze/gemm/kernel/kernel_qbmm_mx_without_batch.h"
21- 
22-template <class A_TYPE, class B_TYPE, class C_TYPE, class aLayout, class bLayout, class cLayout,
23- uint64_t FULL_LOAD_MODE = 0>
24-__aicore__ inline void QbmmMxWithoutBatchTensorApiKernel(GM_ADDR aGM, GM_ADDR bGM, GM_ADDR scale, GM_ADDR bias,
25- GM_ADDR perTokenScale, GM_ADDR cGM, const void* tilingData)
26-{
27- using AType = A_TYPE;
28- using BType = B_TYPE;
29- using BiasType = float;
30- using OutType = C_TYPE;
31- 
32- using BlockEpilogue = Blaze::Epilogue::Block::BlockEpilogueEmpty;
33- using ProblemShape = asc::te::shape<int64_t, int64_t, int64_t, int64_t>;
34- using BlockScheduler = Blaze::Gemm::Block::BlockSchedulerQuantBatchMatmulV3<ProblemShape, FULL_LOAD_MODE, aLayout,
35- bLayout, AType>;
36- 
37- using DispatchPolicy = Blaze::Gemm::MatmulWithScaleMx<FULL_LOAD_MODE, false,
38- Blaze::Gemm::KernelMmadWithScaleMxWithoutBatch>;
39- using BlockMmad = Blaze::Gemm::Block::BlockMmad<DispatchPolicy, AType, aLayout, BType, bLayout, OutType, cLayout,
40- BiasType, cLayout>;
41- 
42- using MatmulKernel = Blaze::Gemm::Kernel::GemmUniversal<ProblemShape, BlockMmad, BlockEpilogue, BlockScheduler>;
43- using Params = typename MatmulKernel::Params;
44- const DequantBmm::QuantBatchMatmulV3TensorAPIWithoutBatchTilingData&
45- quantBmmTilingData = *static_cast<const DequantBmm::QuantBatchMatmulV3TensorAPIWithoutBatchTilingData*>(
46- tilingData);
47- 
48- MatmulKernel{}(
49- Params{{quantBmmTilingData.m, quantBmmTilingData.n, quantBmmTilingData.k, 1L},
50- {aGM, bGM, cGM, bias, perTokenScale, scale},
51- {quantBmmTilingData.kBL1, quantBmmTilingData.scaleKL1, quantBmmTilingData.nBufferNum},
52- {quantBmmTilingData.baseM, quantBmmTilingData.baseN, quantBmmTilingData.mTailTile,
53- quantBmmTilingData.nTailTile, quantBmmTilingData.mBaseTailSplitCnt,
54- quantBmmTilingData.nBaseTailSplitCnt, quantBmmTilingData.mTailMain, quantBmmTilingData.nTailMain},
55- {quantBmmTilingData.baseM, quantBmmTilingData.baseN, quantBmmTilingData.baseK, quantBmmTilingData.isBias,
56- quantBmmTilingData.dbL0C, quantBmmTilingData.weightMustHitL2}});
57-}
@@ -50,11 +50,9 @@
50#include "tensor_api/tensor.h"50#include "tensor_api/tensor.h"
51#include "qbmm_cube_tensor_api_blaze.h"51#include "qbmm_cube_tensor_api_blaze.h"
52#include "qbmm_mix_tensor_api_blaze.h"52#include "qbmm_mix_tensor_api_blaze.h"
53-#include "qbmm_mix_without_batch_tensor_api_blaze.h"
54#include "qbmm_pertensor_streamk_tensor_api_blaze.h"53#include "qbmm_pertensor_streamk_tensor_api_blaze.h"
55#if (ORIG_DTYPE_SCALE == DT_FLOAT8_E8M0)54#if (ORIG_DTYPE_SCALE == DT_FLOAT8_E8M0)
56#include "qbmm_mx_tensor_api_blaze.h"55#include "qbmm_mx_tensor_api_blaze.h"
57-#include "qbmm_mx_without_batch_tensor_api_blaze.h"
58#include "qbmm_mx_l0c_pingpong.h"56#include "qbmm_mx_l0c_pingpong.h"
59#include "qbmm_mx_streamk_tensor_api_blaze.h"57#include "qbmm_mx_streamk_tensor_api_blaze.h"
60#endif58#endif
@@ -228,6 +226,16 @@ constexpr CubeFormat format_y = CubeFormat::ND;
228 fullLoadMode>(x1, x2, scale, bias, pertokenScale, y, &tilingData); \226 fullLoadMode>(x1, x2, scale, bias, pertokenScale, y, &tilingData); \
229 } \227 } \
230 } while (0)228 } while (0)
229+#define QUANT_BMMV3_CUBE_WITHOUT_BATCH_TENSOR_API_IMPL_CLASS(aLayout, bLayout, cLayout, fullLoadMode) \
230+ do { \
231+ if ASCEND_IS_AIC { \
232+ GET_TILING_DATA_WITH_STRUCT(DequantBmm::QuantBatchMatmulV3TensorAPIWithoutBatchTilingData, tilingData, \
233+ tiling); \
234+ QbmmCubeWithoutBatchTensorApiKernel<DTYPE_X1, DTYPE_X2, DTYPE_SCALE, DTYPE_Y, DTYPE_BIAS, aLayout, \
235+ bLayout, cLayout, fullLoadMode>(x1, x2, scale, bias, pertokenScale, y, \
236+ &tilingData); \
237+ } \
238+ } while (0)
231#define QUANT_BMMV3_MIX_TENSOR_API_IMPL_CLASS(aLayout, bLayout, cLayout, fullLoadMode) \239#define QUANT_BMMV3_MIX_TENSOR_API_IMPL_CLASS(aLayout, bLayout, cLayout, fullLoadMode) \
232 do { \240 do { \
233 GET_TILING_DATA_WITH_STRUCT(DequantBmm::QuantBatchMatmulV3BasicAPITilingData, tilingData, tiling); \241 GET_TILING_DATA_WITH_STRUCT(DequantBmm::QuantBatchMatmulV3BasicAPITilingData, tilingData, tiling); \
@@ -526,6 +534,26 @@ UT_STATIC __global__ __aicore__ void quant_batch_matmul_v3(GM_ADDR x1, GM_ADDR x
526 QUANT_BMMV3_PERTENSOR_STREAMK_BLAZE_IMPL_CLASS(TeALayout, TeBLayoutNz, asc::te::nd_ext_layout_ptn, 0);534 QUANT_BMMV3_PERTENSOR_STREAMK_BLAZE_IMPL_CLASS(TeALayout, TeBLayoutNz, asc::te::nd_ext_layout_ptn, 0);
527#endif535#endif
528 }536 }
537+#endif
538+#if IS_BLAZE
539+ if constexpr (TPL_BATCHMODE == TPL_WITHOUT_BATCH && TPL_KERNELTYPE == TPL_NO_VEC_EPILOGUE_WITH_MMAPI &&
540+ TPL_APILEVEL == TPL_API_LEVEL_BLAZE) {
541+#if CUBE_TEMPLATE_ND
542+ QUANT_BMMV3_CUBE_WITHOUT_BATCH_TENSOR_API_IMPL_CLASS(TeALayout, TeBLayoutNd, asc::te::nd_ext_layout_ptn, 0);
543+#elif defined(FORMAT_X2) && FORMAT_X2 == FORMAT_FRACTAL_NZ
544+ QUANT_BMMV3_CUBE_WITHOUT_BATCH_TENSOR_API_IMPL_CLASS(TeALayout, TeBLayoutNz, asc::te::nd_ext_layout_ptn, 0);
545+#endif
546+ } else if constexpr (TPL_BATCHMODE == TPL_WITHOUT_BATCH &&
547+ TPL_KERNELTYPE == TPL_NO_VEC_EPILOGUE_CUSTOM_GMTOAL1_WITH_MMAPI &&
548+ TPL_APILEVEL == TPL_API_LEVEL_BLAZE) {
549+#if CUBE_TEMPLATE_ND
550+ QUANT_BMMV3_CUBE_WITHOUT_BATCH_TENSOR_API_IMPL_CLASS(TeALayout, TeBLayoutNd, asc::te::nd_ext_layout_ptn,
551+ Blaze::Gemm::A_FULL_LOAD_MODE);
552+#elif defined(FORMAT_X2) && FORMAT_X2 == FORMAT_FRACTAL_NZ
553+ QUANT_BMMV3_CUBE_WITHOUT_BATCH_TENSOR_API_IMPL_CLASS(TeALayout, TeBLayoutNz, asc::te::nd_ext_layout_ptn,
554+ Blaze::Gemm::A_FULL_LOAD_MODE);
555+#endif
556+ }
529#endif557#endif
530 if constexpr (TPL_BATCHMODE == TPL_WITH_BATCH) { // Batch Mode = WITH_BATCH558 if constexpr (TPL_BATCHMODE == TPL_WITH_BATCH) { // Batch Mode = WITH_BATCH
531#if defined(__NPU_ARCH__) && (__NPU_ARCH__ == 3510)559#if defined(__NPU_ARCH__) && (__NPU_ARCH__ == 3510)
@@ -1,5 +1,5 @@
1/**1/**
2- * Copyright (c) 2025 Huawei Technologies Co., Ltd.2+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3 * This program is free software, you can redistribute it and/or modify it under the terms and conditions of3 * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4 * CANN Open Software License Agreement Version 2.0 (the "License").4 * CANN Open Software License Agreement Version 2.0 (the "License").
5 * Please refer to the License for details. You may not use this file except in compliance with the License.5 * Please refer to the License for details. You may not use this file except in compliance with the License.
@@ -159,6 +159,15 @@ namespace QuantBatchMatmulV3Arch35TilingKey {
159#define QBMMV3_IS_NON_MX_WEIGHT_NZ_TPL false159#define QBMMV3_IS_NON_MX_WEIGHT_NZ_TPL false
160#endif160#endif
161 161 
162+#if IS_BLAZE && !defined(IS_A4W4I)
163+#define SUPPORT_CUBE_WITHOUT_BATCH_TILING_KEY (QBMMV3_IS_NON_MX_CUBE_ND_TPL || QBMMV3_IS_NON_MX_WEIGHT_NZ_TPL)
164+#else
165+#define SUPPORT_CUBE_WITHOUT_BATCH_TILING_KEY false
166+#endif
167+ 
168+#define SUPPORT_NO_VEC_WITHOUT_BATCH_TILING_KEY \
169+ (SUPPORT_MX_WITHOUT_BATCH_TILING_KEY || SUPPORT_CUBE_WITHOUT_BATCH_TILING_KEY)
170+ 
162// Kernel type 11 is shared by the original MX StreamK path and the non-MX per-tensor StreamK path above.171// Kernel type 11 is shared by the original MX StreamK path and the non-MX per-tensor StreamK path above.
163#define SUPPORT_STREAMK_TILING_KEY (SUPPORT_MX_WITHOUT_BATCH_TILING_KEY || SUPPORT_NON_MX_STREAMK_TILING_KEY)172#define SUPPORT_STREAMK_TILING_KEY (SUPPORT_MX_WITHOUT_BATCH_TILING_KEY || SUPPORT_NON_MX_STREAMK_TILING_KEY)
164 173 
@@ -228,7 +237,7 @@ ASCENDC_TPL_SEL(
228 ASCENDC_TPL_UINT_SEL(KERNELTYPE, ASCENDC_TPL_UI_LIST, TPL_VEC_EPILOGUE_WITH_CUSTOM_MM),237 ASCENDC_TPL_UINT_SEL(KERNELTYPE, ASCENDC_TPL_UI_LIST, TPL_VEC_EPILOGUE_WITH_CUSTOM_MM),
229 ASCENDC_TPL_UINT_SEL(APILEVEL, ASCENDC_TPL_UI_LIST, TPL_API_LEVEL_BASIC)),238 ASCENDC_TPL_UINT_SEL(APILEVEL, ASCENDC_TPL_UI_LIST, TPL_API_LEVEL_BASIC)),
230#endif239#endif
231-#if ((!defined(__CCE_AICORE__)) || (SUPPORT_MX_WITHOUT_BATCH_TILING_KEY))240+#if ((!defined(__CCE_AICORE__)) || (SUPPORT_NO_VEC_WITHOUT_BATCH_TILING_KEY))
232 ASCENDC_TPL_ARGS_SEL( // kernel type {0, 1} * batch mode {1} * ATRANS {0, 1} * BTRANS {0, 1}241 ASCENDC_TPL_ARGS_SEL( // kernel type {0, 1} * batch mode {1} * ATRANS {0, 1} * BTRANS {0, 1}
233 ASCENDC_TPL_KERNEL_TYPE_SEL(ASCENDC_TPL_AIC_ONLY), ASCENDC_TPL_UINT_SEL(ATRANS, ASCENDC_TPL_UI_LIST, 0, 1),242 ASCENDC_TPL_KERNEL_TYPE_SEL(ASCENDC_TPL_AIC_ONLY), ASCENDC_TPL_UINT_SEL(ATRANS, ASCENDC_TPL_UI_LIST, 0, 1),
234 ASCENDC_TPL_UINT_SEL(BTRANS, ASCENDC_TPL_UI_LIST, 0, 1),243 ASCENDC_TPL_UINT_SEL(BTRANS, ASCENDC_TPL_UI_LIST, 0, 1),
@@ -176,7 +176,7 @@ static_assert(sizeof(QuantBatchMatmulV3StreamKBasicAPITilingData) % 8U == 0U,
176#pragma pack(pop)176#pragma pack(pop)
177 177 
178#pragma pack(push, 8)178#pragma pack(push, 8)
179-struct QuantBatchMatmulV3TensorAPIWithoutBatchTilingData {179+struct alignas(8) QuantBatchMatmulV3TensorAPIWithoutBatchTilingData {
180 uint32_t m = 0;180 uint32_t m = 0;
181 uint32_t n = 0;181 uint32_t n = 0;
182 uint32_t k = 0;182 uint32_t k = 0;
@@ -202,9 +202,6 @@ struct QuantBatchMatmulV3TensorAPIWithoutBatchTilingData {
202 uint8_t nBufferNum = 0;202 uint8_t nBufferNum = 0;
203 uint8_t dbL0C = 0;203 uint8_t dbL0C = 0;
204 uint8_t weightMustHitL2 = 1U;204 uint8_t weightMustHitL2 = 1U;
205- uint8_t reserved0 = 0;
206- uint32_t reserved1 = 0;
207- uint32_t reserved2 = 0;
208};205};
209#pragma pack(pop)206#pragma pack(pop)
210} // namespace DequantBmm207} // namespace DequantBmm
@@ -206,15 +206,15 @@ Ascend310P3,QUANTMM310P/TestQuantBatchMatmulV3Tiling.generalTest/35,quant_batch_
206Ascend310P3,QUANTMM310P/TestQuantBatchMatmulV3Tiling.generalTest/36,,310p_pertoken_bias_fp32,,,3,3,3,1,1,1,16,64,128,0,1,1,0,1,1,INT8,INT8,FLOAT,FLOAT,FLOAT,FLOAT16,ND,NZ,TRUE,8,0,,TRUE,310P pertoken fp32 bias,206Ascend310P3,QUANTMM310P/TestQuantBatchMatmulV3Tiling.generalTest/36,,310p_pertoken_bias_fp32,,,3,3,3,1,1,1,16,64,128,0,1,1,0,1,1,INT8,INT8,FLOAT,FLOAT,FLOAT,FLOAT16,ND,NZ,TRUE,8,0,,TRUE,310P pertoken fp32 bias,
207Ascend310P3,QUANTMM310P/TestQuantBatchMatmulV3Tiling.generalTest/37,,310p_pertoken_bias_int32,,,3,3,3,1,1,1,16,64,128,0,1,1,0,1,1,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,NZ,TRUE,8,0,,TRUE,310P pertoken int32 bias,207Ascend310P3,QUANTMM310P/TestQuantBatchMatmulV3Tiling.generalTest/37,,310p_pertoken_bias_int32,,,3,3,3,1,1,1,16,64,128,0,1,1,0,1,1,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,NZ,TRUE,8,0,,TRUE,310P pertoken int32 bias,
208Ascend310P3,QUANTMM310P/TestQuantBatchMatmulV3Tiling.generalTest/38,,310p_pertoken_bias_bf16_invalid,,,3,3,3,1,1,1,16,64,128,0,1,1,0,1,1,INT8,INT8,FLOAT,FLOAT,BF16,FLOAT16,ND,NZ,FALSE,8,0,,FALSE,310P pertoken bf16 bias invalid,208Ascend310P3,QUANTMM310P/TestQuantBatchMatmulV3Tiling.generalTest/38,,310p_pertoken_bias_bf16_invalid,,,3,3,3,1,1,1,16,64,128,0,1,1,0,1,1,INT8,INT8,FLOAT,FLOAT,BF16,FLOAT16,ND,NZ,FALSE,8,0,,FALSE,310P pertoken bf16 bias invalid,
209-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/0,,llama2-001,,,3,3,3,1,1,1,4096,8192,128,0,0,0,0,0,0,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,131072,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 3 0 0 0 4096 128 8192 128 128 256 1024 1024 0 16908290 1 1 1 1 0 0,FALSE,209+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/0,,llama2-001,,,3,3,3,1,1,1,4096,8192,128,0,0,0,0,0,0,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,131088,4096 128 8192 1024 1024 0 8388736 256 0 65537 65537 0 50331904 66050,FALSE,
210-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/1,,llama2-003,,,3,3,3,1,1,1,4096,8192,3584,0,0,0,0,1,0,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,131076,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 3 0 0 0 4096 3584 8192 256 256 128 512 512 0 16842754 1 1 1 1 0 0,FALSE,210+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/1,,llama2-003,,,3,3,3,1,1,1,4096,8192,3584,0,0,0,0,1,0,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,131092,4096 3584 8192 512 512 0 16777472 128 0 65537 65537 0 50331904 65794,FALSE,
211-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/2,quant_batch_matmul_v3,llama2-004,,,3,3,3,1,1,1,4096,3584,8192,0,0,0,1,0,0,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,131073,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 3 0 0 0 4096 8192 3584 256 256 128 512 512 0 16842754 1 1 1 1 0 0,FALSE,211+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/2,quant_batch_matmul_v3,llama2-004,,,3,3,3,1,1,1,4096,3584,8192,0,0,0,1,0,0,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,131089,4096 8192 3584 512 512 0 16777472 128 0 65537 65537 0 50331904 65794,FALSE,
212-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/3,quant_batch_matmul_v3,llama2-005,,,3,3,3,1,1,1,4096,8192,1024,0,0,0,1,1,0,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,131077,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 3 0 0 0 4096 1024 8192 256 256 128 512 512 0 16842754 1 1 1 1 0 0,FALSE,212+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/3,quant_batch_matmul_v3,llama2-005,,,3,3,3,1,1,1,4096,8192,1024,0,0,0,1,1,0,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,131093,4096 1024 8192 512 512 0 16777472 128 0 65537 65537 0 50331904 65794,FALSE,
213-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/4,quant_batch_matmul_v3,llama2-006,,,3,3,3,1,1,1,4,8192,128,0,0,0,0,1,1,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,ND,TRUE,8,131076,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 2 0 3 0 0 0 4 128 8192 16 16 2048 6144 6144 0 131074 1 1 1 1 0 0,FALSE,213+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/4,quant_batch_matmul_v3,llama2-006,,,3,3,3,1,1,1,4,8192,128,0,0,0,0,1,1,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,ND,TRUE,8,131092,4 128 8192 6144 6144 0 1048592 2048 0 65537 65537 0 50332160 514,FALSE,
214-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/5,,case-59,,,3,3,3,1,1,1,1024,11264,1664,0,0,0,0,1,1,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,131076,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 2 0 3 0 0 0 1024 1664 11264 256 208 128 384 384 0 16842754 1 1 1 1 0 0,FALSE,214+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/5,,case-59,,,3,3,3,1,1,1,1024,11264,1664,0,0,0,0,1,1,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,131092,1024 1664 11264 384 384 0 13631744 128 0 65537 65537 0 50332160 65794,FALSE,
215-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/6,,case-60,,,3,3,3,1,1,1,1024,12288,4608,0,0,0,0,0,1,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,131072,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 2 0 3 0 0 0 1024 4608 12288 256 256 128 384 384 0 16842754 2 2 1 1 0 0,FALSE,215+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/6,,case-60,,,3,3,3,1,1,1,1024,12288,4608,0,0,0,0,0,1,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,131088,1024 4608 12288 384 384 0 16777472 128 0 131074 65537 0 50332160 65794,FALSE,
216-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/7,,case-63,,,3,3,3,1,1,1,16,1408,11264,0,0,0,0,1,1,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,131332,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 2 0 3 0 0 0 16 11264 1408 16 256 128 256 256 0 131076 1 2 1 1 0 0,FALSE,216+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/7,,case-63,,,3,3,3,1,1,1,16,1408,11264,0,0,0,0,1,1,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,131348,16 11264 1408 256 256 0 16777232 128 0 131073 65537 0 50332160 516,FALSE,
217-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/8,,case-66,,,3,3,3,1,1,1,1024,2736,8192,0,0,0,0,0,1,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,131072,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 2 0 3 0 0 0 1024 8192 2736 256 256 128 384 384 0 16842754 1 1 1 1 0 0,FALSE,217+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/8,,case-66,,,3,3,3,1,1,1,1024,2736,8192,0,0,0,0,0,1,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,131088,1024 8192 2736 384 384 0 16777472 128 0 65537 65537 0 50332160 65794,FALSE,
218Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/9,,case-67,,,3,3,3,1,1,1,1,32,64,0,1,1,1,1,1,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,TRUE,4,773,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 1 64 0 0 0 3 0 0 0 0 0 0 0 0 4 1 64 32 32 1 64 32 32 64 32 1 32 1 1 1 0 0 0 0 0 0 0 0 0 0 1 16 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 4 1 1 0 0,FALSE,218Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/9,,case-67,,,3,3,3,1,1,1,1,32,64,0,1,1,1,1,1,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,TRUE,4,773,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 1 64 0 0 0 3 0 0 0 0 0 0 0 0 4 1 64 32 32 1 64 32 32 64 32 1 32 1 1 1 0 0 0 0 0 0 0 0 0 0 1 16 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 4 1 1 0 0,FALSE,
219Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/10,,empty-tensor,,,3,3,3,1,1,1,0,32,64,0,1,1,1,1,1,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,FALSE,30,773,,FALSE,219Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/10,,empty-tensor,,,3,3,3,1,1,1,0,32,64,0,1,1,1,1,1,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,FALSE,30,773,,FALSE,
220Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/11,,empty-tensor,,,3,3,3,1,1,1,1,32,0,0,1,1,1,1,1,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,FALSE,30,773,,FALSE,220Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/11,,empty-tensor,,,3,3,3,1,1,1,1,32,0,0,1,1,1,1,1,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,FALSE,30,773,,FALSE,
@@ -227,12 +227,12 @@ Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/19,,invalidInputDt
227Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/20,,invalidScaleDtype,,,3,3,3,1,1,1,13,320,952,0,0,1,0,1,0,INT8,INT8,INT8,FLOAT,INT32,INT8,ND,ND,FALSE,32,4,,FALSE,227Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/20,,invalidScaleDtype,,,3,3,3,1,1,1,13,320,952,0,0,1,0,1,0,INT8,INT8,INT8,FLOAT,INT32,INT8,ND,ND,FALSE,32,4,,FALSE,
228Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/21,,invalidBiasDtype,,,3,3,3,1,1,1,13,320,952,0,0,1,0,1,0,INT8,INT8,UINT64,FLOAT,FLOAT,INT8,ND,ND,FALSE,32,4,,FALSE,228Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/21,,invalidBiasDtype,,,3,3,3,1,1,1,13,320,952,0,0,1,0,1,0,INT8,INT8,UINT64,FLOAT,FLOAT,INT8,ND,ND,FALSE,32,4,,FALSE,
229Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/22,,invalidOffset,,,3,3,3,1,1,1,13,320,952,1,0,1,0,1,0,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,ND,FALSE,32,4,,FALSE,229Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/22,,invalidOffset,,,3,3,3,1,1,1,13,320,952,1,0,1,0,1,0,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,ND,FALSE,32,4,,FALSE,
230-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/25,,mxfp4-pergroup-quanliang,,,3,3,3,1,1,1,5344,1260,1976,0,1,1,0,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,TRUE,32,131092,5344 1976 1260 512 512 1536 16777472 65792 2097153 131074 65537 0 67592 65795 0 0,FALSE,230+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/25,,mxfp4-pergroup-quanliang,,,3,3,3,1,1,1,5344,1260,1976,0,1,1,0,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,TRUE,32,131092,5344 1976 1260 512 512 1536 16777472 65792 2097153 131074 65537 0 67592 65795,FALSE,
231-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/27,,mxfp4-pergroup-zengliang,,,3,3,3,1,1,1,1,14336,5120,0,1,0,0,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,TRUE,32,131092,1 5120 14336 1024 1024 14336 10485776 65792 2097153 65537 65537 0 50333704 516 0 0,FALSE,231+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/27,,mxfp4-pergroup-zengliang,,,3,3,3,1,1,1,1,14336,5120,0,1,0,0,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,TRUE,32,131092,1 5120 14336 1024 1024 14336 10485776 65792 2097153 65537 65537 0 50333704 516,FALSE,
232-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/28,,mxfp4-pergroup-kNotAlign64-NnotAlign16,,,3,3,3,1,1,1,192,4066,255,0,1,0,0,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,TRUE,32,131092,192 255 4066 5120 5120 5120 2097200 66816 2097153 65537 65537 0 50333704 66050 0 0,FALSE,232+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/28,,mxfp4-pergroup-kNotAlign64-NnotAlign16,,,3,3,3,1,1,1,192,4066,255,0,1,0,0,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,TRUE,32,131092,192 255 4066 5120 5120 5120 2097200 66816 2097153 65537 65537 0 50333704 66050,FALSE,
233-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/29,,mxfp4-pergroup-kNotAlign256,,,3,3,3,1,1,1,4096,7104,2048,0,1,0,0,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,TRUE,32,131092,4096 2048 7104 512 512 7168 16777472 65792 2097153 65537 65537 0 50333704 65794 0 0,FALSE,233+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/29,,mxfp4-pergroup-kNotAlign256,,,3,3,3,1,1,1,4096,7104,2048,0,1,0,0,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,TRUE,32,131092,4096 2048 7104 512 512 7168 16777472 65792 2097153 65537 65537 0 50333704 65794,FALSE,
234-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/30,,mxfp4-pergroup-kLess64-NnotAlign16,,,3,3,3,1,1,1,4097,62,3,0,1,0,0,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,TRUE,29,131092,4097 3 62 256 256 256 1048720 65792 2097153 65537 65537 0 50333704 66052 0 0,FALSE,234+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/30,,mxfp4-pergroup-kLess64-NnotAlign16,,,3,3,3,1,1,1,4097,62,3,0,1,0,0,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,TRUE,29,131092,4097 3 62 256 256 256 1048720 65792 2097153 65537 65537 0 50333704 66052,FALSE,
235-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/31,,mxfp4-pergroup-MnotAlign16,,,3,3,3,1,1,1,1023,382,2048,0,1,0,0,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,TRUE,32,131092,1023 2048 382 512 512 512 16777472 65792 2097153 65537 65537 0 50333704 65794 0 0,FALSE,235+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/31,,mxfp4-pergroup-MnotAlign16,,,3,3,3,1,1,1,1023,382,2048,0,1,0,0,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,TRUE,32,131092,1023 2048 382 512 512 512 16777472 65792 2097153 65537 65537 0 50333704 65794,FALSE,
236Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/32,,mxfp4-pergroup-inputDtypeError,,,3,3,3,1,1,1,1023,382,2048,0,1,0,0,1,2,FLOAT4-E2M1,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT4-E2M1,ND,ND,FALSE,32,4,,FALSE,236Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/32,,mxfp4-pergroup-inputDtypeError,,,3,3,3,1,1,1,1023,382,2048,0,1,0,0,1,2,FLOAT4-E2M1,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT4-E2M1,ND,ND,FALSE,32,4,,FALSE,
237Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/33,,mxfp4-pergroup-scaleDtypeError,,,3,3,3,1,1,1,1023,382,2048,0,1,0,0,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT,FLOAT8-E8M0,FLOAT,FLOAT4-E2M1,ND,ND,FALSE,32,4,,FALSE,237Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/33,,mxfp4-pergroup-scaleDtypeError,,,3,3,3,1,1,1,1023,382,2048,0,1,0,0,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT,FLOAT8-E8M0,FLOAT,FLOAT4-E2M1,ND,ND,FALSE,32,4,,FALSE,
238Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/34,,mxfp4-pergroup-outDtypeError,,,3,3,3,1,1,1,1023,382,2048,0,1,0,0,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT4-E2M1,ND,ND,FALSE,32,4,,FALSE,238Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/34,,mxfp4-pergroup-outDtypeError,,,3,3,3,1,1,1,1023,382,2048,0,1,0,0,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT4-E2M1,ND,ND,FALSE,32,4,,FALSE,
@@ -258,8 +258,8 @@ Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/412,,fp8-doublesca
258Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/413,,fp8-doublescale-weightnz-unsupported,,,2,2,2,0,0,0,256,8192,256,0,1,0,0,0,6,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,FLOAT16,ND,NZ,FALSE,32,0,,FALSE,Weight-NZ FP8 double per-tensor scale remains unsupported258Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/413,,fp8-doublescale-weightnz-unsupported,,,2,2,2,0,0,0,256,8192,256,0,1,0,0,0,6,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,FLOAT16,ND,NZ,FALSE,32,0,,FALSE,Weight-NZ FP8 double per-tensor scale remains unsupported
259Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/414,,hif8-doublescale-weightnz-unsupported,,,2,2,2,0,0,0,256,8192,256,0,1,0,0,0,6,HIFLOAT8,HIFLOAT8,FLOAT,FLOAT,FLOAT,FLOAT,ND,NZ,FALSE,32,0,,FALSE,Weight-NZ HIFLOAT8 double per-tensor scale remains unsupported259Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/414,,hif8-doublescale-weightnz-unsupported,,,2,2,2,0,0,0,256,8192,256,0,1,0,0,0,6,HIFLOAT8,HIFLOAT8,FLOAT,FLOAT,FLOAT,FLOAT,ND,NZ,FALSE,32,0,,FALSE,Weight-NZ HIFLOAT8 double per-tensor scale remains unsupported
260Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/415,,int8-encoded-scale-int32-bias-streamk,,,2,2,2,0,0,0,256,8192,256,0,0,1,0,0,0,INT8,INT8,UINT64,FLOAT,INT32,BF16,ND,ND,TRUE,32,133904,0,FALSE,INT32 bias is accumulated by MMAD260Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/415,,int8-encoded-scale-int32-bias-streamk,,,2,2,2,0,0,0,256,8192,256,0,0,1,0,0,0,INT8,INT8,UINT64,FLOAT,INT32,BF16,ND,ND,TRUE,32,133904,0,FALSE,INT32 bias is accumulated by MMAD
261-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/43,,hi8-llama2-0010,,,3,3,3,1,1,1,4,8192,1024,0,0,1,0,1,0,HIFLOAT8,HIFLOAT8,UINT64,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,32,131076,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 0 0 0 0 4 1024 8192 16 32 1024 6144 3072 0 131330 1 1 1 1 0 0,FALSE,261+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/43,,hi8-llama2-0010,,,3,3,3,1,1,1,4,8192,1024,0,0,1,0,1,0,HIFLOAT8,HIFLOAT8,UINT64,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,32,131092,4 1024 8192 6144 3072 0 2097168 1024 0 65537 65537 0 65792 514,FALSE,
262-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/44,,mxfp4-llama2-0001,,,3,3,3,1,1,1,4096,8192,128,0,1,1,0,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT16,ND,ND,TRUE,32,131092,4096 128 8192 1024 1024 8192 8388736 66048 2097153 65537 65537 0 67592 66050 0 0,FALSE,262+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/44,,mxfp4-llama2-0001,,,3,3,3,1,1,1,4096,8192,128,0,1,1,0,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT16,ND,ND,TRUE,32,131092,4096 128 8192 1024 1024 8192 8388736 66048 2097153 65537 65537 0 67592 66050,FALSE,
263Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/45,,Key-llama2-case29,,,3,3,3,1,1,1,256,6656,4992,0,1,0,0,1,1,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,516,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 127 160 0 0 0 3 0 0 0 0 0 0 0 0 32 256 4992 6656 6656 256 160 6656 256 160 128 6 12 1 1 0 0 0 0 0 0 0 0 0 0 0 3 6 0 0 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,263Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/45,,Key-llama2-case29,,,3,3,3,1,1,1,256,6656,4992,0,1,0,0,1,1,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,516,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 127 160 0 0 0 3 0 0 0 0 0 0 0 0 32 256 4992 6656 6656 256 160 6656 256 160 128 6 12 1 1 0 0 0 0 0 0 0 0 0 0 0 3 6 0 0 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,
264Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/46,,Key-llama2-case35,,,3,3,3,1,1,1,192,6656,4480,0,1,0,0,1,1,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,516,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 96 144 0 0 0 3 0 0 0 0 0 0 0 0 32 192 4480 6656 6656 192 144 6656 192 144 128 10 10 1 1 0 0 0 0 0 0 0 0 0 0 0 5 5 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,264Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/46,,Key-llama2-case35,,,3,3,3,1,1,1,192,6656,4480,0,1,0,0,1,1,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,516,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 96 144 0 0 0 3 0 0 0 0 0 0 0 0 32 192 4480 6656 6656 192 144 6656 192 144 128 10 10 1 1 0 0 0 0 0 0 0 0 0 0 0 5 5 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,
265Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/47,,mxfp8-pergroup-inputDtypeError,,,3,3,3,1,1,1,1023,382,2048,0,1,0,0,1,2,FLOAT4-E2M1,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,FALSE,32,4,,FALSE,265Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/47,,mxfp8-pergroup-inputDtypeError,,,3,3,3,1,1,1,1023,382,2048,0,1,0,0,1,2,FLOAT4-E2M1,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,FALSE,32,4,,FALSE,
@@ -268,27 +268,27 @@ Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/49,,mxfp8-pergroup
268Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/50,,mxfp8-pergroup-AttrError,,,3,3,3,1,1,1,1023,382,2048,0,1,0,1,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,FALSE,32,4,,FALSE,268Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/50,,mxfp8-pergroup-AttrError,,,3,3,3,1,1,1,1023,382,2048,0,1,0,1,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,FALSE,32,4,,FALSE,
269Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/51,,mxfp8-pergroup-ScaleInnerNotEven,,,3,3,3,1,1,1,1023,32,2048,0,1,0,0,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,TRUE,32,131076,,TRUE,269Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/51,,mxfp8-pergroup-ScaleInnerNotEven,,,3,3,3,1,1,1,1023,32,2048,0,1,0,0,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,TRUE,32,131076,,TRUE,
270Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/52,,mxfp8-pergroup-perTokenNull,,,3,3,3,1,1,1,1900,1706,4096,0,0,1,0,1,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,FALSE,32,4,,FALSE,270Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/52,,mxfp8-pergroup-perTokenNull,,,3,3,3,1,1,1,1900,1706,4096,0,0,1,0,1,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,FALSE,32,4,,FALSE,
271-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/53,,mxfp8-pergroup-AB-large-scaleInit,,,2,2,2,0,0,0,1206,8512,1048,0,1,1,0,1,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,TRUE,30,131092,1206 1048 8512 256 256 8704 14680272 65664 2097153 65537 65537 0 67592 65794 0 0,FALSE,271+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/53,,mxfp8-pergroup-AB-large-scaleInit,,,2,2,2,0,0,0,1206,8512,1048,0,1,1,0,1,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,TRUE,30,131092,1206 1048 8512 256 256 8704 14680272 65664 2097153 65537 65537 0 67592 65794,FALSE,
272-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/54,,mxfp8-pergroup-AB-less-scaleInit,,,2,2,2,0,0,0,1420,4096,1560,0,1,1,0,1,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,TRUE,32,131092,1420 1560 4096 256 256 4096 14680224 65664 2097153 65537 65537 0 67592 65796 0 0,FALSE,272+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/54,,mxfp8-pergroup-AB-less-scaleInit,,,2,2,2,0,0,0,1420,4096,1560,0,1,1,0,1,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,TRUE,32,131092,1420 1560 4096 256 256 4096 14680224 65664 2097153 65537 65537 0 67592 65796,FALSE,
273Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/55,,Al1fullload-mcnt1-pertoken,,,3,3,3,1,1,1,16,6656,8192,0,1,1,0,1,1,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,772,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 8 256 0 0 0 3 0 0 0 0 0 0 0 0 32 16 8192 6656 6656 16 256 6656 16 256 128 52 4 1 1 1 0 0 0 0 0 0 0 0 0 0 52 2 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,273Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/55,,Al1fullload-mcnt1-pertoken,,,3,3,3,1,1,1,16,6656,8192,0,1,1,0,1,1,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,772,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 8 256 0 0 0 3 0 0 0 0 0 0 0 0 32 16 8192 6656 6656 16 256 6656 16 256 128 52 4 1 1 1 0 0 0 0 0 0 0 0 0 0 52 2 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,
274Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/56,,Al1fullload-mcnt2-pertoken,,,3,3,3,1,1,1,426,1024,8192,0,1,1,1,0,1,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,769,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 79 256 0 0 0 3 0 0 0 0 0 0 0 0 32 426 8192 1024 1024 256 256 1024 256 256 128 8 4 1 1 1 0 0 0 0 0 0 0 0 0 0 8 2 0 0 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,274Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/56,,Al1fullload-mcnt2-pertoken,,,3,3,3,1,1,1,426,1024,8192,0,1,1,1,0,1,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,769,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 79 256 0 0 0 3 0 0 0 0 0 0 0 0 32 426 8192 1024 1024 256 256 1024 256 256 128 8 4 1 1 1 0 0 0 0 0 0 0 0 0 0 8 2 0 0 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,
275Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/57,,Al1fullload-mcnt4-pertoken,,,3,3,3,1,1,1,128,3072,1024,0,1,1,0,0,1,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,768,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 16 128 0 0 0 3 0 0 0 0 0 0 0 0 32 128 1024 3072 3072 32 128 3072 32 128 256 12 4 1 1 1 0 0 0 0 0 0 0 0 0 0 12 2 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,275Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/57,,Al1fullload-mcnt4-pertoken,,,3,3,3,1,1,1,128,3072,1024,0,1,1,0,0,1,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,768,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 16 128 0 0 0 3 0 0 0 0 0 0 0 0 32 128 1024 3072 3072 32 128 3072 32 128 256 12 4 1 1 1 0 0 0 0 0 0 0 0 0 0 12 2 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,
276Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/58,,Al1fullload-mcntless32-pertokenn,,,3,3,3,1,1,1,16,1024,256,0,1,1,1,1,1,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,TRUE,16,773,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 8 256 0 0 0 3 0 0 0 0 0 0 0 0 16 16 256 1024 1024 16 256 1024 32 256 128 8 4 1 1 1 0 0 0 0 0 0 0 0 0 0 8 2 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 16 1 1 0 0,FALSE,276Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/58,,Al1fullload-mcntless32-pertokenn,,,3,3,3,1,1,1,16,1024,256,0,1,1,1,1,1,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,TRUE,16,773,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 8 256 0 0 0 3 0 0 0 0 0 0 0 0 16 16 256 1024 1024 16 256 1024 32 256 128 8 4 1 1 1 0 0 0 0 0 0 0 0 0 0 8 2 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 16 1 1 0 0,FALSE,
277-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/59,,Al1fullload-mcnt1-HIF8-nopertoken,,,3,3,3,1,1,1,15,1024,8192,0,0,0,0,0,0,HIFLOAT8,HIFLOAT8,UINT64,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,32,131072,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 3 0 0 0 15 8192 1024 16 256 128 1024 512 0 131074 1 1 1 1 0 0,FALSE,277+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/59,,Al1fullload-mcnt1-HIF8-nopertoken,,,3,3,3,1,1,1,15,1024,8192,0,0,0,0,0,0,HIFLOAT8,HIFLOAT8,UINT64,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,32,131088,15 8192 1024 1024 512 0 16777232 128 0 65537 65537 0 50331904 514,FALSE,
278-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/60,,Al1fullload-mcnt4-A8W8-10-nopertoken,,,3,3,3,1,1,1,512,320,1048,0,0,0,1,0,0,FLOAT8-E4M3,FLOAT8-E4M3,UINT64,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,20,131073,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 3 0 0 0 512 1048 320 128 256 128 384 384 0 16908290 1 1 1 1 0 0,FALSE,278+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/60,,Al1fullload-mcnt4-A8W8-10-nopertoken,,,3,3,3,1,1,1,512,320,1048,0,0,0,1,0,0,FLOAT8-E4M3,FLOAT8-E4M3,UINT64,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,20,131089,512 1048 320 384 384 0 16777344 128 0 65537 65537 0 50331904 66050,FALSE,
279-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/61,,Al1fullload-mcnt4-A8W8-01-nopertoken,,,3,3,3,1,1,1,512,320,1048,0,0,0,0,1,0,FLOAT8-E4M3,FLOAT8-E4M3,UINT64,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,32,131076,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 3 0 0 0 512 1048 320 128 144 128 384 384 0 16908292 1 1 1 1 0 0,FALSE,279+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/61,,Al1fullload-mcnt4-A8W8-01-nopertoken,,,3,3,3,1,1,1,512,320,1048,0,0,0,0,1,0,FLOAT8-E4M3,FLOAT8-E4M3,UINT64,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,32,131092,512 1048 320 384 384 0 9437312 128 0 65537 65537 0 50331904 66052,FALSE,
280-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/62,,Al1fullload-mcnt4-A8W8-11-nopertoken,,,3,3,3,1,1,1,512,320,1048,0,0,0,1,1,0,FLOAT8-E4M3,FLOAT8-E4M3,UINT64,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,32,131077,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 3 0 0 0 512 1048 320 128 144 128 384 384 0 16908292 1 1 1 1 0 0,FALSE,280+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/62,,Al1fullload-mcnt4-A8W8-11-nopertoken,,,3,3,3,1,1,1,512,320,1048,0,0,0,1,1,0,FLOAT8-E4M3,FLOAT8-E4M3,UINT64,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,32,131093,512 1048 320 384 384 0 9437312 128 0 65537 65537 0 50331904 66052,FALSE,
281-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/67,,Al1fullload-mcnt4-mxfp8,,,3,3,3,1,1,1,512,512,1024,0,1,1,0,1,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,TRUE,32,131092,512 1024 512 512 512 512 8388736 65792 2097153 65537 65537 0 67592 66050 0 0,FALSE,281+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/67,,Al1fullload-mcnt4-mxfp8,,,3,3,3,1,1,1,512,512,1024,0,1,1,0,1,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,TRUE,32,131092,512 1024 512 512 512 512 8388736 65792 2097153 65537 65537 0 67592 66050,FALSE,
282-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/68,,Al1fullload-mcnt2-with-tail-mxfp8,,,3,3,3,1,1,1,88,1600,9120,0,1,1,0,1,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,TRUE,32,131348,88 9120 1600 256 256 1792 16777312 65664 2097153 524289 65537 0 67592 66052 0 0,FALSE,282+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/68,,Al1fullload-mcnt2-with-tail-mxfp8,,,3,3,3,1,1,1,88,1600,9120,0,1,1,0,1,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,TRUE,32,131348,88 9120 1600 256 256 1792 16777312 65664 2097153 524289 65537 0 67592 66052,FALSE,
283-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/69,,Al1fullload-mcnt1-mxfp8,,,3,3,3,1,1,1,8,3072,1536,0,1,1,0,1,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,TRUE,32,131092,8 1536 3072 2560 2560 5120 3145744 66176 2097153 65537 65537 0 67592 514 0 0,FALSE,283+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/69,,Al1fullload-mcnt1-mxfp8,,,3,3,3,1,1,1,8,3072,1536,0,1,1,0,1,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,TRUE,32,131092,8 1536 3072 2560 2560 5120 3145744 66176 2097153 65537 65537 0 67592 514,FALSE,
284-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/70,,Al1fullload-mncntless32-mxfp8,,,3,3,3,1,1,1,16,384,592,0,1,1,0,1,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,TRUE,19,131092,16 592 384 384 384 384 2097168 65920 2097153 65537 65537 0 67592 516 0 0,FALSE,284+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/70,,Al1fullload-mncntless32-mxfp8,,,3,3,3,1,1,1,16,384,592,0,1,1,0,1,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,TRUE,19,131092,16 592 384 384 384 384 2097168 65920 2097153 65537 65537 0 67592 516,FALSE,
285-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/72,,1971Compate-scale-bf16-bias-int32,,,2,2,2,0,0,0,103,9680,7672,0,0,1,0,1,0,INT8,INT8,BF16,FLOAT,INT32,BF16,ND,ND,TRUE,32,131076,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 3 0 0 0 103 7672 9680 112 240 128 1024 512 0 16908546 1 1 1 1 0 0,FALSE,285+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/72,,1971Compate-scale-bf16-bias-int32,,,2,2,2,0,0,0,103,9680,7672,0,0,1,0,1,0,INT8,INT8,BF16,FLOAT,INT32,BF16,ND,ND,TRUE,32,131092,103 7672 9680 1024 512 0 15728752 128 0 65537 65537 0 50397440 66050,FALSE,
286Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/73,,1971Compate-scale-bf16-bias-fp32,,,2,2,2,0,0,0,590,9696,4256,0,0,1,1,1,1,INT8,INT8,BF16,FLOAT,FLOAT,BF16,ND,ND,TRUE,32,517,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 32 590 4256 9696 9696 256 256 9696 256 256 128 6 6 1 1 1 0 0 0 0 0 0 0 0 0 0 3 3 0 0 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,286Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/73,,1971Compate-scale-bf16-bias-fp32,,,2,2,2,0,0,0,590,9696,4256,0,0,1,1,1,1,INT8,INT8,BF16,FLOAT,FLOAT,BF16,ND,ND,TRUE,32,517,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 32 590 4256 9696 9696 256 256 9696 256 256 128 6 6 1 1 1 0 0 0 0 0 0 0 0 0 0 3 3 0 0 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,
287Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/74,,1971Compate-scale-bf16-bias-bf16,,,2,2,2,0,0,0,798,9728,9032,0,0,1,1,0,0,INT8,INT8,BF16,FLOAT,BF16,BF16,ND,ND,TRUE,32,513,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 27 0 0 0 0 0 0 0 0 32 798 9032 9728 9728 256 256 9728 256 256 128 6 6 1 1 1 0 0 0 0 0 0 0 0 0 0 3 3 0 0 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 1 0 0,FALSE,287Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/74,,1971Compate-scale-bf16-bias-bf16,,,2,2,2,0,0,0,798,9728,9032,0,0,1,1,0,0,INT8,INT8,BF16,FLOAT,BF16,BF16,ND,ND,TRUE,32,513,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 27 0 0 0 0 0 0 0 0 32 798 9032 9728 9728 256 256 9728 256 256 128 6 6 1 1 1 0 0 0 0 0 0 0 0 0 0 3 3 0 0 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 1 0 0,FALSE,
288Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/75,,1971Compate-scale-fp32-bias-bf16,,,2,2,2,0,0,0,360,6992,1384,0,0,1,0,1,0,INT8,INT8,FLOAT,FLOAT,BF16,BF16,ND,ND,TRUE,32,516,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 27 0 0 0 0 0 0 0 0 32 360 1384 6992 6992 96 176 6992 96 176 128 20 10 1 1 1 0 0 0 0 0 0 0 0 0 0 10 5 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,288Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/75,,1971Compate-scale-fp32-bias-bf16,,,2,2,2,0,0,0,360,6992,1384,0,0,1,0,1,0,INT8,INT8,FLOAT,FLOAT,BF16,BF16,ND,ND,TRUE,32,516,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 27 0 0 0 0 0 0 0 0 32 360 1384 6992 6992 96 176 6992 96 176 128 20 10 1 1 1 0 0 0 0 0 0 0 0 0 0 10 5 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,
289Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/76,,1971Compate-scale-fp32-bias-int32,,,2,2,2,0,0,0,1029,3376,1536,0,0,1,0,0,1,INT8,INT8,FLOAT,FLOAT,INT32,BF16,ND,ND,TRUE,30,512,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 30 1029 1536 3376 3376 208 256 3376 208 256 128 6 6 1 1 1 0 0 0 0 0 0 0 0 0 0 3 3 0 0 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,289Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/76,,1971Compate-scale-fp32-bias-int32,,,2,2,2,0,0,0,1029,3376,1536,0,0,1,0,0,1,INT8,INT8,FLOAT,FLOAT,INT32,BF16,ND,ND,TRUE,30,512,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 30 1029 1536 3376 3376 208 256 3376 208 256 128 6 6 1 1 1 0 0 0 0 0 0 0 0 0 0 3 3 0 0 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,
290Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/77,,1971Compate-scale-bf16-bias-int32,,,2,2,2,0,0,0,1789,2784,1056,0,0,1,1,1,1,INT8,INT8,BF16,FLOAT,INT32,BF16,ND,ND,TRUE,32,517,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 32 1789 1056 2784 2784 256 256 2784 256 256 128 6 6 1 1 1 0 0 0 0 0 0 0 0 0 0 3 3 0 0 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 3 1 1 0 0,FALSE,290Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/77,,1971Compate-scale-bf16-bias-int32,,,2,2,2,0,0,0,1789,2784,1056,0,0,1,1,1,1,INT8,INT8,BF16,FLOAT,INT32,BF16,ND,ND,TRUE,32,517,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 32 1789 1056 2784 2784 256 256 2784 256 256 128 6 6 1 1 1 0 0 0 0 0 0 0 0 0 0 3 3 0 0 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 3 1 1 0 0,FALSE,
291-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/78,,1971Compate-scale-fp32-bias-int32,,,2,2,2,0,0,0,1260,816,1224,0,0,1,1,1,0,INT8,INT8,FLOAT,FLOAT,INT32,BF16,ND,ND,TRUE,30,131077,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 3 0 0 0 1260 1224 816 256 208 128 384 384 0 16843010 1 1 1 1 0 0,FALSE,291+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/78,,1971Compate-scale-fp32-bias-int32,,,2,2,2,0,0,0,1260,816,1224,0,0,1,1,1,0,INT8,INT8,FLOAT,FLOAT,INT32,BF16,ND,ND,TRUE,30,131093,1260 1224 816 384 384 0 13631744 128 0 65537 65537 0 50397440 65794,FALSE,
292Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/79,,1971Compate-scale-fp32-bias-fp32,,,2,2,2,0,0,0,2852,1520,2256,0,0,1,1,0,0,INT8,INT8,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,32,513,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 32 2852 2256 1520 1520 256 256 1520 256 256 128 6 6 1 1 1 0 0 0 0 0 0 0 0 0 0 3 3 0 0 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 1 0 0,FALSE,292Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/79,,1971Compate-scale-fp32-bias-fp32,,,2,2,2,0,0,0,2852,1520,2256,0,0,1,1,0,0,INT8,INT8,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,32,513,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 32 2852 2256 1520 1520 256 256 1520 256 256 128 6 6 1 1 1 0 0 0 0 0 0 0 0 0 0 3 3 0 0 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 1 0 0,FALSE,
293Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/80,,fp8-pertoken-perchannel-fp32,,,3,3,3,1,1,1,27,240,40,0,1,1,0,1,1,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,FLOAT,ND,ND,TRUE,6,772,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 8 16 0 0 0 0 0 0 0 0 0 0 0 0 6 27 40 240 240 16 16 240 16 16 256 1 16 1 1 1 0 0 0 0 0 0 0 0 0 0 1 8 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,293Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/80,,fp8-pertoken-perchannel-fp32,,,3,3,3,1,1,1,27,240,40,0,1,1,0,1,1,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,FLOAT,ND,ND,TRUE,6,772,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 8 16 0 0 0 0 0 0 0 0 0 0 0 0 6 27 40 240 240 16 16 240 16 16 256 1 16 1 1 1 0 0 0 0 0 0 0 0 0 0 1 8 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,
294Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/81,,hifloat8-pertoken-perchannel-fp16,,,3,3,3,1,1,1,1,263,1010,0,1,0,1,1,1,HIFLOAT8,HIFLOAT8,FLOAT,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,32,773,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 32 1 1010 263 263 1 32 263 128 32 256 2 8 1 1 0 0 0 0 0 0 0 0 0 0 0 2 4 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,294Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/81,,hifloat8-pertoken-perchannel-fp16,,,3,3,3,1,1,1,1,263,1010,0,1,0,1,1,1,HIFLOAT8,HIFLOAT8,FLOAT,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,32,773,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 32 1 1010 263 263 1 32 263 128 32 256 2 8 1 1 0 0 0 0 0 0 0 0 0 0 0 2 4 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,
@@ -296,9 +296,9 @@ Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/82,,fp8-pertoken-p
296Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/83,,fp8-pertoken-pertensor-batch-bf16,,,3,3,3,28,1,28,129,328,178,0,1,1,1,1,0,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,30,517,28 1 28 1 1 1 28 1 1 1 1 1 1 1 28 0 1 1 0 0 65 192 0 0 0 0 0 0 0 0 0 0 0 0 30 129 178 328 328 129 178 328 160 192 128 6 6 1 1 1 0 0 0 0 0 0 0 0 0 0 3 3 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 6 1 1 0 0,FALSE,296Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/83,,fp8-pertoken-pertensor-batch-bf16,,,3,3,3,28,1,28,129,328,178,0,1,1,1,1,0,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,30,517,28 1 28 1 1 1 28 1 1 1 1 1 1 1 28 0 1 1 0 0 65 192 0 0 0 0 0 0 0 0 0 0 0 0 30 129 178 328 328 129 178 328 160 192 128 6 6 1 1 1 0 0 0 0 0 0 0 0 0 0 3 3 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 6 1 1 0 0,FALSE,
297Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/84,,hifloat8-pertoken-pertensor-bf16,,,3,3,3,1,1,1,1220,948,788,0,1,1,0,1,0,HIFLOAT8,HIFLOAT8,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,32,516,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 80 208 0 0 0 0 0 0 0 0 0 0 0 0 32 1220 788 948 948 160 208 948 160 208 128 8 8 1 1 1 0 0 0 0 0 0 0 0 0 0 4 4 0 0 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,297Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/84,,hifloat8-pertoken-pertensor-bf16,,,3,3,3,1,1,1,1220,948,788,0,1,1,0,1,0,HIFLOAT8,HIFLOAT8,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,32,516,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 80 208 0 0 0 0 0 0 0 0 0 0 0 0 32 1220 788 948 948 160 208 948 160 208 128 8 8 1 1 1 0 0 0 0 0 0 0 0 0 0 4 4 0 0 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,
298Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/85,,fp8-pertoken-pertensor-fp16,,,3,3,3,1,1,1,127,69,158,0,1,1,0,0,0,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,10,768,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 64 160 0 0 0 0 0 0 0 0 0 0 0 0 10 127 158 69 69 127 158 69 128 160 96 1 6 1 1 1 0 0 0 0 0 0 0 0 0 0 1 3 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 10 1 1 0 0,FALSE,298Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/85,,fp8-pertoken-pertensor-fp16,,,3,3,3,1,1,1,127,69,158,0,1,1,0,0,0,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,10,768,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 64 160 0 0 0 0 0 0 0 0 0 0 0 0 10 127 158 69 69 127 158 69 128 160 96 1 6 1 1 1 0 0 0 0 0 0 0 0 0 0 1 3 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 10 1 1 0 0,FALSE,
299-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/87,,hifloat8-perchannel-fp32,,,3,3,3,1,1,1,1031,528,2048,0,0,1,0,0,1,HIFLOAT8,HIFLOAT8,UINT64,FLOAT,FLOAT,FLOAT,ND,ND,TRUE,32,131072,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 2 0 0 0 0 0 1031 2048 528 256 256 128 384 384 0 16843010 2 2 1 1 0 0,FALSE,299+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/87,,hifloat8-perchannel-fp32,,,3,3,3,1,1,1,1031,528,2048,0,0,1,0,0,1,HIFLOAT8,HIFLOAT8,UINT64,FLOAT,FLOAT,FLOAT,ND,ND,TRUE,32,131088,1031 2048 528 384 384 0 16777472 128 0 131074 65537 0 66048 65794,FALSE,
300-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/88,,fp8-perchannel-bf16,,,3,3,3,1,1,1,1062,1104,3208,0,0,1,0,1,1,FLOAT8-E4M3,FLOAT8-E5M2,UINT64,FLOAT,FLOAT,BF16,ND,ND,TRUE,32,131076,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 2 0 0 0 0 0 1062 3208 1104 256 256 128 384 384 0 16843010 5 6 1 7 0 240,FALSE,300+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/88,,fp8-perchannel-bf16,,,3,3,3,1,1,1,1062,1104,3208,0,0,1,0,1,1,FLOAT8-E4M3,FLOAT8-E5M2,UINT64,FLOAT,FLOAT,BF16,ND,ND,TRUE,32,131092,1062 3208 1104 384 384 0 16777472 128 0 393221 458753 15728640 66048 65794,FALSE,
301-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/90,,fp8-perchannel-fp16,,,3,3,3,1,1,1,224,64,8360,0,0,1,0,0,1,FLOAT8-E5M2,FLOAT8-E5M2,UINT64,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,32,131328,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 2 0 0 0 0 0 224 8360 64 224 256 64 64 64 0 16843012 1 16 1 1 0 0,FALSE,301+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/90,,fp8-perchannel-fp16,,,3,3,3,1,1,1,224,64,8360,0,0,1,0,0,1,FLOAT8-E5M2,FLOAT8-E5M2,UINT64,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,32,131344,224 8360 64 64 64 0 16777440 64 0 1048577 65537 0 66048 65796,FALSE,
302Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/91,,fp8-pertoken-perchannel-scale-dtype-error,,,3,3,3,1,1,1,16,62,16,0,1,0,0,1,1,FLOAT8-E4M3,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT,FLOAT,FLOAT16,ND,ND,FALSE,32,772,,FALSE,302Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/91,,fp8-pertoken-perchannel-scale-dtype-error,,,3,3,3,1,1,1,16,62,16,0,1,0,0,1,1,FLOAT8-E4M3,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT,FLOAT,FLOAT16,ND,ND,FALSE,32,772,,FALSE,
303Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/92,,hifloat8-pertoken-pertensor-bias-dtype-error,,,3,3,3,1,1,1,16,62,16,0,1,1,1,1,0,HIFLOAT8,HIFLOAT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,FALSE,32,773,,FALSE,303Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/92,,hifloat8-pertoken-pertensor-bias-dtype-error,,,3,3,3,1,1,1,16,62,16,0,1,1,1,1,0,HIFLOAT8,HIFLOAT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,FALSE,32,773,,FALSE,
304Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/93,,fp8-pertoken-perchannel-output-dtype-error,,,3,3,3,1,1,1,16,62,16,0,1,0,1,0,1,FLOAT8-E4M3,FLOAT8-E5M2,FLOAT,FLOAT,FLOAT,INT8,ND,ND,FALSE,32,769,,FALSE,304Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/93,,fp8-pertoken-perchannel-output-dtype-error,,,3,3,3,1,1,1,16,62,16,0,1,0,1,0,1,FLOAT8-E4M3,FLOAT8-E5M2,FLOAT,FLOAT,FLOAT,INT8,ND,ND,FALSE,32,769,,FALSE,
@@ -311,10 +311,10 @@ Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/100,,1971CompatePe
311Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/101,,1971CompatePertoken-scale-fp32-bias-fp32,,,2,2,2,0,0,0,2852,1520,2256,0,1,1,1,0,0,INT8,INT8,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,32,513,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 79 256 0 0 0 0 0 0 0 0 0 0 0 0 32 2852 2256 1520 1520 256 256 1520 256 256 128 6 6 1 1 1 0 0 0 0 0 0 0 0 0 0 3 3 0 0 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 1 0 0,FALSE,311Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/101,,1971CompatePertoken-scale-fp32-bias-fp32,,,2,2,2,0,0,0,2852,1520,2256,0,1,1,1,0,0,INT8,INT8,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,32,513,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 79 256 0 0 0 0 0 0 0 0 0 0 0 0 32 2852 2256 1520 1520 256 256 1520 256 256 128 6 6 1 1 1 0 0 0 0 0 0 0 0 0 0 3 3 0 0 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 1 0 0,FALSE,
312Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/102,,1971CompatePertokenfp16-scale-fp32-bias-fp16,,,2,2,2,0,0,0,360,6992,1384,0,1,1,0,1,0,INT8,INT8,FLOAT,FLOAT,FLOAT16,FLOAT16,ND,ND,TRUE,32,516,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 48 176 0 0 0 1 0 0 0 0 0 0 0 0 32 360 1384 6992 6992 96 176 6992 96 176 128 20 10 1 1 1 0 0 0 0 0 0 0 0 0 0 10 5 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,312Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/102,,1971CompatePertokenfp16-scale-fp32-bias-fp16,,,2,2,2,0,0,0,360,6992,1384,0,1,1,0,1,0,INT8,INT8,FLOAT,FLOAT,FLOAT16,FLOAT16,ND,ND,TRUE,32,516,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 48 176 0 0 0 1 0 0 0 0 0 0 0 0 32 360 1384 6992 6992 96 176 6992 96 176 128 20 10 1 1 1 0 0 0 0 0 0 0 0 0 0 10 5 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,
313Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/103,,1971CompatePertokenfp16-scale-fp32-bias-fp32,,,2,2,2,0,0,0,2852,1520,2256,0,1,1,1,0,1,INT8,INT8,FLOAT,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,32,513,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 79 256 0 0 0 0 0 0 0 0 0 0 0 0 32 2852 2256 1520 1520 256 256 1520 256 256 128 6 6 1 1 1 0 0 0 0 0 0 0 0 0 0 3 3 0 0 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 1 0 0,FALSE,313Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/103,,1971CompatePertokenfp16-scale-fp32-bias-fp32,,,2,2,2,0,0,0,2852,1520,2256,0,1,1,1,0,1,INT8,INT8,FLOAT,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,32,513,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 79 256 0 0 0 0 0 0 0 0 0 0 0 0 32 2852 2256 1520 1520 256 256 1520 256 256 128 6 6 1 1 1 0 0 0 0 0 0 0 0 0 0 3 3 0 0 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 1 0 0,FALSE,
314-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/104,,mxfp8-pergroup-A_batch-B_no_batch,,,3,2,3,2,0,2,1206,8512,1048,0,1,1,0,1,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,TRUE,32,131092,2412 1048 8512 256 256 8704 11534592 65664 2097153 65537 65542 240 67592 65794 0 0,FALSE,314+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/104,,mxfp8-pergroup-A_batch-B_no_batch,,,3,2,3,2,0,2,1206,8512,1048,0,1,1,0,1,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,TRUE,32,131092,2412 1048 8512 256 256 8704 11534592 65664 2097153 65537 65542 240 67592 65794,FALSE,
315-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/105,,int8_int8_int32,,,2,2,2,0,0,0,2906,128,1744,0,0,0,0,0,0,INT8,INT8,BF16,FLOAT,INT32,INT32,ND,ND,TRUE,32,131072,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 3 0 0 0 2906 1744 128 256 256 128 128 128 0 16842756 1 1 8 1 240 0,FALSE,315+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/105,,int8_int8_int32,,,2,2,2,0,0,0,2906,128,1744,0,0,0,0,0,0,INT8,INT8,BF16,FLOAT,INT32,INT32,ND,ND,TRUE,32,131088,2906 1744 128 128 128 0 16777472 128 0 65537 65544 240 50331904 65796,FALSE,
316-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/106,,mxfp8-pergroup-k-1024,,,2,2,2,0,0,0,10240,1024,2624,0,1,0,0,1,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,TRUE,32,133396,10240 2624 1024 256 256 1024 16777472 65664 2097153 65537 65537 0 50333704 65794 0 0,FALSE,2-buffer MXFP8 ND cube-bound after theoretical estimate316+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/106,,mxfp8-pergroup-k-1024,,,2,2,2,0,0,0,10240,1024,2624,0,1,0,0,1,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,TRUE,32,133396,10240 2624 1024 256 256 1024 16777472 65664 2097153 65537 65537 0 50333704 65794,FALSE,2-buffer MXFP8 ND cube-bound after theoretical estimate
317-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/107,,mxfp8-true-false-afullload-tailsplit,,,2,2,2,0,0,0,332,496,5320,0,1,0,1,0,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,TRUE,32,131089,332 5320 496 512 512 512 16777344 65664 2097153 65537 65537 0 50333704 66050 0 0,FALSE,317+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/107,,mxfp8-true-false-afullload-tailsplit,,,2,2,2,0,0,0,332,496,5320,0,1,0,1,0,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,TRUE,32,131089,332 5320 496 512 512 512 16777344 65664 2097153 65537 65537 0 50333704 66050,FALSE,
318Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/0,,fanhua,,,2,2,2,0,0,0,52,4632,7360,0,0,1,0,0,1,INT8,INT8,BF16,BF16,BF16,BF16,ND,ND,TRUE,29,512,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 27 0 0 0 0 0 0 0 0 29 52 7360 4632 4632 52 256 4632 64 256 128 30 6 1 1 1 0 0 0 0 0 0 0 0 0 0 15 3 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,318Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/0,,fanhua,,,2,2,2,0,0,0,52,4632,7360,0,0,1,0,0,1,INT8,INT8,BF16,BF16,BF16,BF16,ND,ND,TRUE,29,512,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 27 0 0 0 0 0 0 0 0 29 52 7360 4632 4632 52 256 4632 64 256 128 30 6 1 1 1 0 0 0 0 0 0 0 0 0 0 15 3 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,
319Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/1,,fanhua,,,2,2,2,0,0,0,52,4632,7360,0,0,1,0,1,1,INT8,INT8,BF16,BF16,BF16,BF16,ND,ND,TRUE,31,516,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 27 0 0 0 0 0 0 0 0 31 52 7360 4632 4632 52 240 4632 64 240 128 24 8 1 1 1 0 0 0 0 0 0 0 0 0 0 12 4 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,319Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/1,,fanhua,,,2,2,2,0,0,0,52,4632,7360,0,0,1,0,1,1,INT8,INT8,BF16,BF16,BF16,BF16,ND,ND,TRUE,31,516,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 27 0 0 0 0 0 0 0 0 31 52 7360 4632 4632 52 240 4632 64 240 128 24 8 1 1 1 0 0 0 0 0 0 0 0 0 0 12 4 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,
320Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/2,,fanhua,,,2,2,2,0,0,0,52,4632,7360,0,0,1,1,1,1,INT8,INT8,BF16,BF16,BF16,BF16,ND,ND,TRUE,31,517,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 27 0 0 0 0 0 0 0 0 31 52 7360 4632 4632 52 240 4632 128 240 128 8 8 1 1 1 0 0 0 0 0 0 0 0 0 0 4 4 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,320Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/2,,fanhua,,,2,2,2,0,0,0,52,4632,7360,0,0,1,1,1,1,INT8,INT8,BF16,BF16,BF16,BF16,ND,ND,TRUE,31,517,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 27 0 0 0 0 0 0 0 0 31 52 7360 4632 4632 52 240 4632 128 240 128 8 8 1 1 1 0 0 0 0 0 0 0 0 0 0 4 4 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,
@@ -323,7 +323,7 @@ Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/6,,fanhua,,,2,2,2,0
323Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/7,,fanhua,,,2,2,2,0,0,0,16,592,328,0,1,0,0,1,1,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,FALSE,32,260,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 32 0 0 19 16 592 384 384 16 32 384 16 32 384 1 6 1 1 0 0 0 0 0 0 0 0 0 0 0 1 3 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 16843009 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,323Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/7,,fanhua,,,2,2,2,0,0,0,16,592,328,0,1,0,0,1,1,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,FALSE,32,260,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 32 0 0 19 16 592 384 384 16 32 384 16 32 384 1 6 1 1 0 0 0 0 0 0 0 0 0 0 0 1 3 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 16843009 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,
324Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/9,,fanhua,,,2,2,2,0,0,0,256,256,128,0,1,0,1,0,3,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,2,66561,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 0 3 128 128 128 256 128 256 128 128 128 256 256 0 16908292 1 1 1 1 0 0,FALSE,324Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/9,,fanhua,,,2,2,2,0,0,0,256,256,128,0,1,0,1,0,3,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,2,66561,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 0 3 128 128 128 256 128 256 128 128 128 256 256 0 16908292 1 1 1 1 0 0,FALSE,
325Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/10,,fanhua,,,2,2,2,0,0,0,1,128,8080,0,1,0,0,1,3,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,32,66564,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 0 3 128 128 128 1 8080 128 128 128 128 128 128 0 131076 1 1 1 1 0 0,FALSE,325Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/10,,fanhua,,,2,2,2,0,0,0,1,128,8080,0,1,0,0,1,3,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,32,66564,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 0 3 128 128 128 1 8080 128 128 128 128 128 128 0 131076 1 1 1 1 0 0,FALSE,
326-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/10,quant_batch_matmul_v3,kernel,,,2,2,2,0,0,0,128,256,1,0,0,0,0,0,1,INT8,INT8,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,8,131072,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 3 0 0 0 128 1 256 128 32 128 256 256 0 16908292 8 1 1 1 0 0,FALSE,326+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/10,quant_batch_matmul_v3,kernel,,,2,2,2,0,0,0,128,256,1,0,0,0,0,0,1,INT8,INT8,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,8,131088,128 1 256 256 256 0 2097280 128 0 65544 65537 0 50331904 66052,FALSE,
327Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/11,quant_batch_matmul_v3,kernel,,,2,2,2,0,0,0,185,1240,464,0,0,0,1,1,1,INT8,INT8,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,30,773,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 30 185 464 1240 1240 128 32 1240 128 32 256 5 8 1 1 0 0 0 0 0 0 0 0 0 0 0 5 4 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,327Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/11,quant_batch_matmul_v3,kernel,,,2,2,2,0,0,0,185,1240,464,0,0,0,1,1,1,INT8,INT8,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,30,773,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 30 185 464 1240 1240 128 32 1240 128 32 256 5 8 1 1 0 0 0 0 0 0 0 0 0 0 0 5 4 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,
328Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/12,,fanhua,,,2,2,2,0,0,0,256,128,256,0,1,1,0,0,0,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,512,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 8 128 0 0 0 3 0 0 0 0 0 0 0 0 32 256 256 128 128 16 128 128 16 128 128 2 2 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,328Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/12,,fanhua,,,2,2,2,0,0,0,256,128,256,0,1,1,0,0,0,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,512,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 8 128 0 0 0 3 0 0 0 0 0 0 0 0 32 256 256 128 128 16 128 128 16 128 128 2 2 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,
329Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/13,,fanhua,,,2,2,2,0,0,0,256,128,256,0,1,1,0,0,1,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,512,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 8 128 0 0 0 3 0 0 0 0 0 0 0 0 32 256 256 128 128 16 128 128 16 128 128 2 2 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,329Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/13,,fanhua,,,2,2,2,0,0,0,256,128,256,0,1,1,0,0,1,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,512,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 8 128 0 0 0 3 0 0 0 0 0 0 0 0 32 256 256 128 128 16 128 128 16 128 128 2 2 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,
@@ -338,10 +338,10 @@ Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/21,,fanhua,,,2,2,2,
338Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/22,,fanhua,,,2,2,2,0,0,0,1,203,1010,0,1,0,1,1,1,HIFLOAT8,HIFLOAT8,FLOAT,FLOAT,FLOAT,FLOAT,ND,ND,TRUE,32,773,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 32 1 1010 203 203 1 32 203 128 32 256 1 8 1 1 0 0 0 0 0 0 0 0 0 0 0 1 4 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,338Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/22,,fanhua,,,2,2,2,0,0,0,1,203,1010,0,1,0,1,1,1,HIFLOAT8,HIFLOAT8,FLOAT,FLOAT,FLOAT,FLOAT,ND,ND,TRUE,32,773,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 32 1 1010 203 203 1 32 203 128 32 256 1 8 1 1 0 0 0 0 0 0 0 0 0 0 0 1 4 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,
339Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/23,,fanhua,,,2,2,2,0,0,0,75,68,71,0,1,1,0,1,1,HIFLOAT8,HIFLOAT8,FLOAT,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,25,772,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 8 16 0 0 0 0 0 0 0 0 0 0 0 0 25 75 71 68 68 16 16 68 16 16 128 1 32 1 1 1 0 0 0 0 0 0 0 0 0 0 1 16 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,339Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/23,,fanhua,,,2,2,2,0,0,0,75,68,71,0,1,1,0,1,1,HIFLOAT8,HIFLOAT8,FLOAT,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,25,772,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 8 16 0 0 0 0 0 0 0 0 0 0 0 0 25 75 71 68 68 16 16 68 16 16 128 1 32 1 1 1 0 0 0 0 0 0 0 0 0 0 1 16 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,
340Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/24,,fanhua,,,2,2,2,0,0,0,242,62,79,0,1,1,1,0,1,HIFLOAT8,HIFLOAT8,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,6,769,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 121 96 0 0 0 0 0 0 0 0 0 0 0 0 6 242 79 62 62 242 79 62 256 96 64 1 12 1 1 1 0 0 0 0 0 0 0 0 0 0 1 6 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 6 1 1 0 0,FALSE,340Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/24,,fanhua,,,2,2,2,0,0,0,242,62,79,0,1,1,1,0,1,HIFLOAT8,HIFLOAT8,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,6,769,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 121 96 0 0 0 0 0 0 0 0 0 0 0 0 6 242 79 62 62 242 79 62 256 96 64 1 12 1 1 1 0 0 0 0 0 0 0 0 0 0 1 6 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 6 1 1 0 0,FALSE,
341-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/25,,fanhua,,,2,2,2,0,0,0,1031,528,2048,0,0,1,0,0,1,HIFLOAT8,HIFLOAT8,UINT64,FLOAT,FLOAT,FLOAT,ND,ND,TRUE,32,131072,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 2 0 0 0 0 0 1031 2048 528 256 256 128 384 384 0 16843010 2 2 1 1 0 0,FALSE,341+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/25,,fanhua,,,2,2,2,0,0,0,1031,528,2048,0,0,1,0,0,1,HIFLOAT8,HIFLOAT8,UINT64,FLOAT,FLOAT,FLOAT,ND,ND,TRUE,32,131088,1031 2048 528 384 384 0 16777472 128 0 131074 65537 0 66048 65794,FALSE,
342-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/27,,fanhua,,,2,2,2,0,0,0,256,128,256,0,0,1,1,0,1,FLOAT8-E5M2,FLOAT8-E4M3,UINT64,FLOAT,FLOAT,FLOAT,ND,ND,TRUE,16,131073,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 2 0 0 0 0 0 256 256 128 256 256 128 128 128 0 65796 4 4 1 1 0 0,FALSE,342+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/27,,fanhua,,,2,2,2,0,0,0,256,128,256,0,0,1,1,0,1,FLOAT8-E5M2,FLOAT8-E4M3,UINT64,FLOAT,FLOAT,FLOAT,ND,ND,TRUE,16,131089,256 256 128 128 128 0 16777472 128 0 262148 65537 0 66048 260,FALSE,
343-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/28,,fanhua,,,2,2,2,0,0,0,256,128,256,0,0,1,1,1,1,FLOAT8-E4M3,FLOAT8-E5M2,UINT64,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,32,131077,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 2 0 0 0 0 0 256 256 128 128 16 128 128 128 0 16908548 1 1 1 1 0 0,FALSE,343+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/28,,fanhua,,,2,2,2,0,0,0,256,128,256,0,0,1,1,1,1,FLOAT8-E4M3,FLOAT8-E5M2,UINT64,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,32,131093,256 256 128 128 128 0 1048704 128 0 65537 65537 0 66048 66052,FALSE,
344-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/29,,fanhua,,,2,2,2,0,0,0,1249,704,1249,0,0,1,1,1,1,FLOAT8-E4M3,FLOAT8-E5M2,UINT64,FLOAT,FLOAT,FLOAT,ND,ND,TRUE,30,131077,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 2 0 0 0 0 0 1249 1249 704 256 224 128 384 384 0 16843010 1 1 1 1 0 0,FALSE,344+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/29,,fanhua,,,2,2,2,0,0,0,1249,704,1249,0,0,1,1,1,1,FLOAT8-E4M3,FLOAT8-E5M2,UINT64,FLOAT,FLOAT,FLOAT,ND,ND,TRUE,30,131093,1249 1249 704 384 384 0 14680320 128 0 65537 65537 0 66048 65794,FALSE,
345Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/30,,unalign,,,3,2,3,1,0,1,1,15,1,0,1,0,1,1,3,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,1,66565,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 0 3 128 128 128 1 1 15 128 128 128 128 128 0 16908292 1 1 1 1 0 0,FALSE,345Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/30,,unalign,,,3,2,3,1,0,1,1,15,1,0,1,0,1,1,3,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,1,66565,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 0 3 128 128 128 1 1 15 128 128 128 128 128 0 16908292 1 1 1 1 0 0,FALSE,
346Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/31,,unalign,,,3,3,3,1,1,1,1,17,24,0,1,0,1,1,3,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,2,66565,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 0 3 128 128 128 1 24 17 128 128 128 128 128 0 16908292 1 2 1 1 0 0,FALSE,346Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/31,,unalign,,,3,3,3,1,1,1,1,17,24,0,1,0,1,1,3,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,2,66565,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 0 3 128 128 128 1 24 17 128 128 128 128 128 0 16908292 1 2 1 1 0 0,FALSE,
347Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/32,,unalign,,,3,3,3,1,1,1,7,19,132,0,1,0,0,1,3,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,16,66564,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 0 3 128 128 128 7 132 19 128 128 128 128 128 0 16908292 1 8 1 1 0 0,FALSE,347Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/32,,unalign,,,3,3,3,1,1,1,7,19,132,0,1,0,0,1,3,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,16,66564,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 0 3 128 128 128 7 132 19 128 128 128 128 128 0 16908292 1 8 1 1 0 0,FALSE,
@@ -371,11 +371,11 @@ Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/55,,unalign,,,2,2,2
371Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/56,quant_batch_matmul_v3_perblock,unalign,,,3,2,3,17,0,17,81,690,109,0,1,0,0,0,3,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,17,66560,17 1 17 1 1 1 17 1 1 1 1 1 1 1 17 16 16 0 3 128 128 128 81 109 690 128 128 128 512 512 0 16908292 1 1 1 1 0 0,FALSE,371Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/56,quant_batch_matmul_v3_perblock,unalign,,,3,2,3,17,0,17,81,690,109,0,1,0,0,0,3,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,17,66560,17 1 17 1 1 1 17 1 1 1 1 1 1 1 17 16 16 0 3 128 128 128 81 109 690 128 128 128 512 512 0 16908292 1 1 1 1 0 0,FALSE,
372Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/perblock_pertile_m314_28core,,pertile-base-block-limit,28,56,2,2,2,0,0,0,314,7168,2048,0,1,0,0,0,4,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,24,66560,0,FALSE,Keep per-tile baseM within 256 on 28 AICs,372Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/perblock_pertile_m314_28core,,pertile-base-block-limit,28,56,2,2,2,0,0,0,314,7168,2048,0,1,0,0,0,4,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,24,66560,0,FALSE,Keep per-tile baseM within 256 on 28 AICs,
373Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/57,quant_batch_matmul_v3_perblock_dtype_error,quant_batch_matmul_v3_perblock_dtype_error,,,3,2,3,17,0,17,81,690,109,0,1,0,0,0,3,INT8,INT8,FLOAT,FLOAT,FLOAT,BF16,ND,ND,FALSE,16,1024,,FALSE,373Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/57,quant_batch_matmul_v3_perblock_dtype_error,quant_batch_matmul_v3_perblock_dtype_error,,,3,2,3,17,0,17,81,690,109,0,1,0,0,0,3,INT8,INT8,FLOAT,FLOAT,FLOAT,BF16,ND,ND,FALSE,16,1024,,FALSE,
374-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/58,,unalign,,,2,2,2,0,0,0,6,74,9,0,1,1,0,1,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,TRUE,1,131092,6 9 74 128 128 128 1048592 65664 2097153 65537 65537 0 67592 66052 0 0,FALSE,374+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/58,,unalign,,,2,2,2,0,0,0,6,74,9,0,1,1,0,1,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,TRUE,1,131092,6 9 74 128 128 128 1048592 65664 2097153 65537 65537 0 67592 66052,FALSE,
375-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/59,,mxfp8-false-false,,,2,2,2,0,0,0,122,192,16,0,1,1,0,0,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,TRUE,8,131088,122 16 192 256 256 256 2097168 65664 2097153 65537 65537 0 67592 66052 0 0,FALSE,375+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/59,,mxfp8-false-false,,,2,2,2,0,0,0,122,192,16,0,1,1,0,0,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,TRUE,8,131088,122 16 192 256 256 256 2097168 65664 2097153 65537 65537 0 67592 66052,FALSE,
376-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/60,,mxfp8-true-true,,,2,2,2,0,0,0,254,64,640,0,1,1,1,1,2,FLOAT8-E4M3,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,TRUE,28,131093,254 640 64 64 64 64 3145856 65600 2097153 65537 65537 0 67592 66052 0 0,FALSE,376+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/60,,mxfp8-true-true,,,2,2,2,0,0,0,254,64,640,0,1,1,1,1,2,FLOAT8-E4M3,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,TRUE,28,131093,254 640 64 64 64 64 3145856 65600 2097153 65537 65537 0 67592 66052,FALSE,
377-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/61,,mxfp8-true-false,,,2,2,2,0,0,0,26,32,7232,0,1,1,1,0,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,TRUE,29,131089,26 7232 32 64 64 64 16777344 65600 2097153 65537 65537 0 67592 66052 0 0,FALSE,377+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/61,,mxfp8-true-false,,,2,2,2,0,0,0,26,32,7232,0,1,1,1,0,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,TRUE,29,131089,26 7232 32 64 64 64 16777344 65600 2097153 65537 65537 0 67592 66052,FALSE,
378-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/62,,950_coreNum_check_32_60_pass,32,60,2,2,2,0,0,0,26,32,7232,0,1,1,1,0,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,TRUE,29,131089,26 7232 32 64 64 64 16777344 65600 2097153 65537 65537 0 67592 66052 0 0,FALSE,378+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/62,,950_coreNum_check_32_60_pass,32,60,2,2,2,0,0,0,26,32,7232,0,1,1,1,0,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,TRUE,29,131089,26 7232 32 64 64 64 16777344 65600 2097153 65537 65537 0 67592 66052,FALSE,
379Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/63,,950_coreNum_check_32_60_fail,32,60,3,2,3,17,0,17,81,690,109,0,1,0,0,0,3,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,BF16,ND,ND,FALSE,17,1024,17 1 17 1 1 1 17 1 1 1 1 1 1 1 17 16 16 0 3 128 128 128 81 109 690 128 128 128 512 512 0 16908290 1 1 1 1 0 0,FALSE,379Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/63,,950_coreNum_check_32_60_fail,32,60,3,2,3,17,0,17,81,690,109,0,1,0,0,0,3,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,BF16,ND,ND,FALSE,17,1024,17 1 17 1 1 1 17 1 1 1 1 1 1 1 17 16 16 0 3 128 128 128 81 109 690 128 128 128 512 512 0 16908290 1 1 1 1 0 0,FALSE,
380Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/64,,950_coreNum_check_32_60_fail,32,60,3,3,3,1,1,1,127,69,158,0,1,1,0,0,0,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,FLOAT16,ND,ND,FALSE,10,768,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 64 160 0 0 0 0 0 0 0 0 0 0 0 0 10 127 158 69 69 127 158 69 128 160 96 1 6 1 1 1 0 0 0 0 0 0 0 0 0 0 1 3 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 10 1 1 0 0,FALSE,380Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/64,,950_coreNum_check_32_60_fail,32,60,3,3,3,1,1,1,127,69,158,0,1,1,0,0,0,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,FLOAT16,ND,ND,FALSE,10,768,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 64 160 0 0 0 0 0 0 0 0 0 0 0 0 10 127 158 69 69 127 158 69 128 160 96 1 6 1 1 1 0 0 0 0 0 0 0 0 0 0 1 3 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 10 1 1 0 0,FALSE,
381Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/65,,950_coreNum_check_32_60_fail,32,60,2,2,2,0,0,0,256,128,256,0,1,1,0,0,1,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,FALSE,32,512,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 8 128 0 0 0 3 0 0 0 0 0 0 0 0 32 256 256 128 128 16 128 128 16 128 128 2 2 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,381Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.kernelTest/65,,950_coreNum_check_32_60_fail,32,60,2,2,2,0,0,0,256,128,256,0,1,1,0,0,1,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,FALSE,32,512,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 8 128 0 0 0 3 0 0 0 0 0 0 0 0 32 256 256 128 128 16 128 128 16 128 128 2 2 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,
@@ -386,16 +386,16 @@ Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/69,,qbmm_int4_pert
386Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/70,,qbmm_int4_pertoken_perchannel_ut_function_cases_2,,,2,2,2,0,0,0,128,64,32,0,1,1,0,1,0,INT4,INT4,FLOAT32,FLOAT32,FLOAT16,FLOAT16,ND,ND,TRUE,16,516,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 8 16 0 0 0 1 0 0 0 0 0 0 0 0 16 128 32 64 64 16 16 64 16 16 128 2 2 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,386Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/70,,qbmm_int4_pertoken_perchannel_ut_function_cases_2,,,2,2,2,0,0,0,128,64,32,0,1,1,0,1,0,INT4,INT4,FLOAT32,FLOAT32,FLOAT16,FLOAT16,ND,ND,TRUE,16,516,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 8 16 0 0 0 1 0 0 0 0 0 0 0 0 16 128 32 64 64 16 16 64 16 16 128 2 2 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,
387Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/71,,qbmm_int4_pertoken_perchannel_ut_function_cases_3,,,2,2,2,0,0,0,128,64,32,0,1,1,0,1,0,INT4,INT4,FLOAT32,FLOAT32,FLOAT32,FLOAT16,ND,ND,TRUE,16,516,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 8 16 0 0 0 0 0 0 0 0 0 0 0 0 16 128 32 64 64 16 16 64 16 16 128 2 2 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,387Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/71,,qbmm_int4_pertoken_perchannel_ut_function_cases_3,,,2,2,2,0,0,0,128,64,32,0,1,1,0,1,0,INT4,INT4,FLOAT32,FLOAT32,FLOAT32,FLOAT16,ND,ND,TRUE,16,516,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 8 16 0 0 0 0 0 0 0 0 0 0 0 0 16 128 32 64 64 16 16 64 16 16 128 2 2 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,
388Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/72,,qbmm_int4_pertoken_perchannel_ut_illegal_cases,,,2,2,2,0,0,0,128,64,32,0,1,1,0,0,0,INT4,INT4,FLOAT16,FLOAT32,FLOAT16,FLOAT16,ND,ND,FALSE,2,768,,FALSE,388Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/72,,qbmm_int4_pertoken_perchannel_ut_illegal_cases,,,2,2,2,0,0,0,128,64,32,0,1,1,0,0,0,INT4,INT4,FLOAT16,FLOAT32,FLOAT16,FLOAT16,ND,ND,FALSE,2,768,,FALSE,
389-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/108,,full_load_tail_balance_qbmm_TT_tail_case0100,,,2,2,2,0,0,0,403,256,15616,0,0,0,0,1,0,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,131332,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 3 0 0 0 403 15616 256 208 256 128 256 256 0 16842756 1 1 1 1 0 0,FALSE,389+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/108,,full_load_tail_balance_qbmm_TT_tail_case0100,,,2,2,2,0,0,0,403,256,15616,0,0,0,0,1,0,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,131348,403 15616 256 256 256 0 16777424 128 0 65537 65537 0 50331904 65796,FALSE,
390Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/109,,full_load_tail_balance_qbmm_KC_tail_case0050,,,2,2,2,0,0,0,339,256,10496,0,1,0,0,1,1,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,772,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 79 256 0 0 0 3 0 0 0 0 0 0 0 0 32 339 10496 256 256 176 256 256 176 256 128 2 4 1 1 0 0 0 0 0 0 0 0 0 0 0 2 2 0 0 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,390Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/109,,full_load_tail_balance_qbmm_KC_tail_case0050,,,2,2,2,0,0,0,339,256,10496,0,1,0,0,1,1,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,772,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 79 256 0 0 0 3 0 0 0 0 0 0 0 0 32 339 10496 256 256 176 256 256 176 256 128 2 4 1 1 0 0 0 0 0 0 0 0 0 0 0 2 2 0 0 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,
391Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/110,,full_load_tail_balance_qbmm_KT_tail_case0120,,,2,2,2,0,0,0,431,512,14336,0,1,0,0,1,0,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,772,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 79 256 0 0 0 3 0 0 0 0 0 0 0 0 32 431 14336 512 512 224 256 512 224 256 128 4 4 1 1 0 0 0 0 0 0 0 0 0 0 0 4 2 0 0 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 1 0 0,FALSE,391Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/110,,full_load_tail_balance_qbmm_KT_tail_case0120,,,2,2,2,0,0,0,431,512,14336,0,1,0,0,1,0,INT8,INT8,FLOAT,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,772,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 79 256 0 0 0 3 0 0 0 0 0 0 0 0 32 431 14336 512 512 224 256 512 224 256 128 4 4 1 1 0 0 0 0 0 0 0 0 0 0 0 4 2 0 0 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 1 0 0,FALSE,
392-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/111,,full_load_tail_balance_qbmm_MXFP8_tail_case0073,,,2,2,2,0,0,0,366,512,13312,0,1,0,0,1,2,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT16,ND,ND,TRUE,32,131348,366 13312 512 256 256 512 16777408 65664 2097153 262145 65537 0 50333704 65796 0 0,FALSE,392+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/111,,full_load_tail_balance_qbmm_MXFP8_tail_case0073,,,2,2,2,0,0,0,366,512,13312,0,1,0,0,1,2,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT16,ND,ND,TRUE,32,131348,366 13312 512 256 256 512 16777408 65664 2097153 262145 65537 0 50333704 65796,FALSE,
393-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/112,,full_load_tail_balance_qbmm_MXFP4_tail_case0100,,,2,2,2,0,0,0,404,1024,13824,0,1,0,0,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,TRUE,32,131348,404 13824 1024 512 512 1024 16777424 65792 2097153 131073 65537 0 50333704 65796 0 0,FALSE,393+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/112,,full_load_tail_balance_qbmm_MXFP4_tail_case0100,,,2,2,2,0,0,0,404,1024,13824,0,1,0,0,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT,ND,ND,TRUE,32,131348,404 13824 1024 512 512 1024 16777424 65792 2097153 131073 65537 0 50333704 65796,FALSE,
394-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/113,,nd_k_not_128_qbmm_nd_TT_case0025,,,2,2,2,0,0,0,1817,257,1024,0,0,0,0,1,0,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,131076,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 3 0 0 0 1817 1024 257 256 256 128 384 384 0 16842754 1 1 4 1 208 0,FALSE,394+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/113,,nd_k_not_128_qbmm_nd_TT_case0025,,,2,2,2,0,0,0,1817,257,1024,0,0,0,0,1,0,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,131092,1817 1024 257 384 384 0 16777472 128 0 65537 65540 208 50331904 65794,FALSE,
395-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/114,,nd_k_not_128_qbmm_nd_TC_case0025,,,2,2,2,0,0,0,1817,319,2304,0,0,0,0,1,1,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,131076,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 2 0 3 0 0 0 1817 2304 319 256 256 128 384 384 0 16842754 2 2 4 1 208 0,FALSE,395+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/114,,nd_k_not_128_qbmm_nd_TC_case0025,,,2,2,2,0,0,0,1817,319,2304,0,0,0,0,1,1,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,131092,1817 2304 319 384 384 0 16777472 128 0 131074 65540 208 50332160 65794,FALSE,
396-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/115,,nd_k_not_128_qbmm_nd_MXFP8_case0026,,,2,2,2,0,0,0,1818,447,3840,0,1,0,0,1,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT16,ND,ND,TRUE,32,131092,1818 3840 447 256 256 512 16777472 65664 2097153 65537 65540 208 50333704 65794 0 0,FALSE,396+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/115,,nd_k_not_128_qbmm_nd_MXFP8_case0026,,,2,2,2,0,0,0,1818,447,3840,0,1,0,0,1,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT16,ND,ND,TRUE,32,131092,1818 3840 447 256 256 512 16777472 65664 2097153 65537 65540 208 50333704 65794,FALSE,
397-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/116,,nd_k_not_128_qbmm_nd_MXFP8_case0027,,,2,2,2,0,0,0,1819,510,4096,0,1,0,0,1,2,FLOAT8-E4M3,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT16,ND,ND,TRUE,32,131092,1819 4096 510 256 256 512 16777472 65664 2097153 65537 65540 208 50333704 65794 0 0,FALSE,397+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/116,,nd_k_not_128_qbmm_nd_MXFP8_case0027,,,2,2,2,0,0,0,1819,510,4096,0,1,0,0,1,2,FLOAT8-E4M3,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT16,ND,ND,TRUE,32,131092,1819 4096 510 256 256 512 16777472 65664 2097153 65537 65540 208 50333704 65794,FALSE,
398-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/117,,nd_k_not_128_qbmm_nd_MXFP8_case0028,,,2,2,2,0,0,0,1820,575,4352,0,1,0,0,1,2,FLOAT8-E5M2,FLOAT8-E4M3,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT16,ND,ND,TRUE,32,131092,1820 4352 575 256 256 768 16777472 65664 2097153 131074 65540 208 50333704 65795 0 0,FALSE,398+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/117,,nd_k_not_128_qbmm_nd_MXFP8_case0028,,,2,2,2,0,0,0,1820,575,4352,0,1,0,0,1,2,FLOAT8-E5M2,FLOAT8-E4M3,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT16,ND,ND,TRUE,32,131092,1820 4352 575 256 256 768 16777472 65664 2097153 131074 65540 208 50333704 65795,FALSE,
399Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/118,,fp8-kc-fp32-scale-bias-fp32,,,3,3,3,1,1,1,27,240,40,0,1,1,0,1,1,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,FLOAT,ND,ND,TRUE,6,772,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 8 16 0 0 0 0 0 0 0 0 0 0 0 0 6 27 40 240 240 16 16 240 16 16 256 1 16 1 1 1 0 0 0 0 0 0 0 0 0 0 1 8 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,399Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/118,,fp8-kc-fp32-scale-bias-fp32,,,3,3,3,1,1,1,27,240,40,0,1,1,0,1,1,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,FLOAT,ND,ND,TRUE,6,772,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 8 16 0 0 0 0 0 0 0 0 0 0 0 0 6 27 40 240 240 16 16 240 16 16 256 1 16 1 1 1 0 0 0 0 0 0 0 0 0 0 1 8 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,
400Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/119,,fp8-kt-fp32-scale-bias-fp32,,,3,3,3,1,1,1,127,69,158,0,1,1,0,0,0,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,10,768,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 64 160 0 0 0 0 0 0 0 0 0 0 0 0 10 127 158 69 69 127 158 69 128 160 96 1 6 1 1 1 0 0 0 0 0 0 0 0 0 0 1 3 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 10 1 1 0 0,FALSE,400Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/119,,fp8-kt-fp32-scale-bias-fp32,,,3,3,3,1,1,1,127,69,158,0,1,1,0,0,0,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,10,768,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 64 160 0 0 0 0 0 0 0 0 0 0 0 0 10 127 158 69 69 127 158 69 128 160 96 1 6 1 1 1 0 0 0 0 0 0 0 0 0 0 1 3 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 10 1 1 0 0,FALSE,
401Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/120,,hifloat8-kc-fp32-scale-bias-fp32,,,3,3,3,1,1,1,10,112,104,0,1,1,0,1,1,HIFLOAT8,HIFLOAT8,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,7,772,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 5 16 0 0 0 0 0 0 0 0 0 0 0 0 7 10 104 112 112 10 16 112 16 16 128 1 32 1 1 1 0 0 0 0 0 0 0 0 0 0 1 16 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,401Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/120,,hifloat8-kc-fp32-scale-bias-fp32,,,3,3,3,1,1,1,10,112,104,0,1,1,0,1,1,HIFLOAT8,HIFLOAT8,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,7,772,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 5 16 0 0 0 0 0 0 0 0 0 0 0 0 7 10 104 112 112 10 16 112 16 16 128 1 32 1 1 1 0 0 0 0 0 0 0 0 0 0 1 16 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0,FALSE,
@@ -403,33 +403,33 @@ Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/121,,hifloat8-kt-f
403Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/150,,fp8e4m3-dynamic-tc-fp32-scale-bias-fp32,,,2,2,2,0,0,0,16,32,16,0,1,1,0,0,5,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,2,768,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 16 16 32 32 16 16 32 16 32 32 1 64 1 1 1 0 0 0 0 0 0 0 0 0 0 1 32 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 1 0 0,FALSE,dynamic T-C x1Scale[1] x2Scale[n] bias fp32403Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/150,,fp8e4m3-dynamic-tc-fp32-scale-bias-fp32,,,2,2,2,0,0,0,16,32,16,0,1,1,0,0,5,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,2,768,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 16 16 32 32 16 16 32 16 32 32 1 64 1 1 1 0 0 0 0 0 0 0 0 0 0 1 32 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 1 0 0,FALSE,dynamic T-C x1Scale[1] x2Scale[n] bias fp32
404Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/151,,fp8e5m2-dynamic-tc-fp32-scale-bias-fp32,,,2,2,2,0,0,0,16,32,16,0,1,1,0,0,5,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,2,768,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 16 16 32 32 16 16 32 16 32 32 1 64 1 1 1 0 0 0 0 0 0 0 0 0 0 1 32 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 1 0 0,FALSE,dynamic T-C x1Scale[1] x2Scale[n] bias fp32404Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/151,,fp8e5m2-dynamic-tc-fp32-scale-bias-fp32,,,2,2,2,0,0,0,16,32,16,0,1,1,0,0,5,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT,FLOAT,FLOAT,BF16,ND,ND,TRUE,2,768,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 16 16 32 32 16 16 32 16 32 32 1 64 1 1 1 0 0 0 0 0 0 0 0 0 0 1 32 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 1 0 0,FALSE,dynamic T-C x1Scale[1] x2Scale[n] bias fp32
405Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/152,,hifloat8-dynamic-tc-fp32-scale-bias-fp32,,,2,2,2,0,0,0,16,32,16,0,1,1,0,0,5,HIFLOAT8,HIFLOAT8,FLOAT,FLOAT,FLOAT,FLOAT,ND,ND,TRUE,2,768,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 16 16 32 32 16 16 32 16 32 32 1 64 1 1 1 0 0 0 0 0 0 0 0 0 0 1 32 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 1 0 0,FALSE,dynamic T-C x1Scale[1] x2Scale[n] bias fp32405Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/152,,hifloat8-dynamic-tc-fp32-scale-bias-fp32,,,2,2,2,0,0,0,16,32,16,0,1,1,0,0,5,HIFLOAT8,HIFLOAT8,FLOAT,FLOAT,FLOAT,FLOAT,ND,ND,TRUE,2,768,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 16 16 32 32 16 16 32 16 32 32 1 64 1 1 1 0 0 0 0 0 0 0 0 0 0 1 32 0 0 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 1 0 0,FALSE,dynamic T-C x1Scale[1] x2Scale[n] bias fp32
406-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/122,,hifloat8-weightnz-tc-uint64-bias-fp32-ft,,,3,3,3,1,1,1,4,8192,1024,0,0,1,0,1,1,HIFLOAT8,HIFLOAT8,UINT64,FLOAT,FLOAT,FLOAT16,ND,NZ,TRUE,32,131076,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 2 0 0 0 0 0 4 1024 8192 16 32 1024 6144 3072 0 131330 1 1 1 1 0 0,FALSE,hifloat8 weightnz KC UINT64 scale406+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/122,,hifloat8-weightnz-tc-uint64-bias-fp32-ft,,,3,3,3,1,1,1,4,8192,1024,0,0,1,0,1,1,HIFLOAT8,HIFLOAT8,UINT64,FLOAT,FLOAT,FLOAT16,ND,NZ,TRUE,32,131092,4 1024 8192 6144 3072 0 2097168 1024 0 65537 65537 0 66048 514,FALSE,hifloat8 weightnz KC UINT64 scale
407-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/123,,hifloat8-weightnz-tt-uint64-bias-bf16-ff,,,3,3,3,1,1,1,10,112,104,0,0,1,0,0,0,HIFLOAT8,HIFLOAT8,UINT64,FLOAT,FLOAT,BF16,ND,NZ,TRUE,4,131072,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 0 0 0 0 10 104 112 16 128 128 128 128 0 16908548 1 4 1 1 0 0,FALSE,hifloat8 weightnz KT UINT64 scale407+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/123,,hifloat8-weightnz-tt-uint64-bias-bf16-ff,,,3,3,3,1,1,1,10,112,104,0,0,1,0,0,0,HIFLOAT8,HIFLOAT8,UINT64,FLOAT,FLOAT,BF16,ND,NZ,TRUE,4,131088,10 104 112 128 128 0 8388624 128 0 262145 65537 0 65792 66052,FALSE,hifloat8 weightnz KT UINT64 scale
408-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/124,,fp8e4m3-weightnz-tt-uint64-bias-fp16-ff,,,3,3,3,1,1,1,127,69,158,0,0,1,0,0,1,FLOAT8-E4M3,FLOAT8-E4M3,UINT64,FLOAT,FLOAT,FLOAT16,ND,NZ,TRUE,30,131072,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 2 0 0 0 0 0 127 158 69 128 160 96 96 96 0 16908548 6 5 1 1 0 0,FALSE,fp8 e4m3 weightnz static UINT64 scale408+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/124,,fp8e4m3-weightnz-tt-uint64-bias-fp16-ff,,,3,3,3,1,1,1,127,69,158,0,0,1,0,0,1,FLOAT8-E4M3,FLOAT8-E4M3,UINT64,FLOAT,FLOAT,FLOAT16,ND,NZ,TRUE,30,131088,127 158 69 96 96 0 10485888 96 0 327686 65537 0 66048 66052,FALSE,fp8 e4m3 weightnz static UINT64 scale
409-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/125,,fp8e4m3-weightnz-tc-uint64-bias-fp16-ff,,,3,3,3,1,1,1,127,69,158,0,0,1,0,0,0,FLOAT8-E4M3,FLOAT8-E4M3,UINT64,FLOAT,FLOAT,FLOAT16,ND,NZ,TRUE,30,131072,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 0 0 0 0 127 158 69 128 160 96 96 96 0 16908548 6 5 1 1 0 0,FALSE,fp8 e4m3 weightnz static UINT64 scale409+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/125,,fp8e4m3-weightnz-tc-uint64-bias-fp16-ff,,,3,3,3,1,1,1,127,69,158,0,0,1,0,0,0,FLOAT8-E4M3,FLOAT8-E4M3,UINT64,FLOAT,FLOAT,FLOAT16,ND,NZ,TRUE,30,131088,127 158 69 96 96 0 10485888 96 0 327686 65537 0 65792 66052,FALSE,fp8 e4m3 weightnz static UINT64 scale
410-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/126,,fp8e4m3-weightnz-tc-uint64-bias-fp16-tf,,,3,3,3,1,1,1,127,69,158,0,0,1,1,0,0,FLOAT8-E4M3,FLOAT8-E4M3,UINT64,FLOAT,FLOAT,FLOAT16,ND,NZ,TRUE,5,131073,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 0 0 0 0 127 158 69 128 160 96 96 96 0 16908548 1 5 1 1 0 0,FALSE,fp8 e4m3 weightnz static UINT64 scale410+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/126,,fp8e4m3-weightnz-tc-uint64-bias-fp16-tf,,,3,3,3,1,1,1,127,69,158,0,0,1,1,0,0,FLOAT8-E4M3,FLOAT8-E4M3,UINT64,FLOAT,FLOAT,FLOAT16,ND,NZ,TRUE,5,131089,127 158 69 96 96 0 10485888 96 0 327681 65537 0 65792 66052,FALSE,fp8 e4m3 weightnz static UINT64 scale
411-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/127,,fp8e4m3-weightnz-tc-uint64-bias-fp16-tt,,,3,3,3,1,1,1,127,69,158,0,0,1,1,1,0,FLOAT8-E4M3,FLOAT8-E4M3,UINT64,FLOAT,FLOAT,FLOAT16,ND,NZ,TRUE,5,131077,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 0 0 0 0 127 158 69 128 160 96 96 96 0 16908548 1 5 1 1 0 0,FALSE,fp8 e4m3 weightnz static UINT64 scale411+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/127,,fp8e4m3-weightnz-tc-uint64-bias-fp16-tt,,,3,3,3,1,1,1,127,69,158,0,0,1,1,1,0,FLOAT8-E4M3,FLOAT8-E4M3,UINT64,FLOAT,FLOAT,FLOAT16,ND,NZ,TRUE,5,131093,127 158 69 96 96 0 10485888 96 0 327681 65537 0 65792 66052,FALSE,fp8 e4m3 weightnz static UINT64 scale
412Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/128,,hifloat8-weightnz-dtype-error-pertoken,,,3,3,3,1,1,1,10,112,104,0,1,1,0,1,0,HIFLOAT8,HIFLOAT8,UINT64,FLOAT,FLOAT,BF16,ND,NZ,FALSE,32,0,,FALSE,hifloat8 weightnz pertoken must be null412Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/128,,hifloat8-weightnz-dtype-error-pertoken,,,3,3,3,1,1,1,10,112,104,0,1,1,0,1,0,HIFLOAT8,HIFLOAT8,UINT64,FLOAT,FLOAT,BF16,ND,NZ,FALSE,32,0,,FALSE,hifloat8 weightnz pertoken must be null
413Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/129,,hifloat8-weightnz-dtype-error-scale-float,,,3,3,3,1,1,1,10,112,104,0,0,1,0,1,0,HIFLOAT8,HIFLOAT8,FLOAT,FLOAT,FLOAT,BF16,ND,NZ,FALSE,32,0,,FALSE,hifloat8 weightnz scale must be UINT64/INT64413Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/129,,hifloat8-weightnz-dtype-error-scale-float,,,3,3,3,1,1,1,10,112,104,0,0,1,0,1,0,HIFLOAT8,HIFLOAT8,FLOAT,FLOAT,FLOAT,BF16,ND,NZ,FALSE,32,0,,FALSE,hifloat8 weightnz scale must be UINT64/INT64
414Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/130,,fp8e4m3-weightnz-dtype-error-static-float-scale,,,3,3,3,1,1,1,127,69,158,0,0,1,0,0,0,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,FLOAT16,ND,NZ,FALSE,32,0,,FALSE,fp8 e4m3 weightnz static scale must be UINT64/INT64 or mx E8M0 pair414Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/130,,fp8e4m3-weightnz-dtype-error-static-float-scale,,,3,3,3,1,1,1,127,69,158,0,0,1,0,0,0,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,FLOAT16,ND,NZ,FALSE,32,0,,FALSE,fp8 e4m3 weightnz static scale must be UINT64/INT64 or mx E8M0 pair
415Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/131,,fp8e4m3-weightnz-dtype-error-mx-invalid-scale,,,2,2,2,0,0,0,122,192,16,0,0,1,0,0,2,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT8-E8M0,FLOAT,FLOAT,FLOAT16,ND,NZ,FALSE,32,0,,FALSE,fp8 e4m3 weightnz mx requires both scales E8M0415Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/131,,fp8e4m3-weightnz-dtype-error-mx-invalid-scale,,,2,2,2,0,0,0,122,192,16,0,0,1,0,0,2,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT8-E8M0,FLOAT,FLOAT,FLOAT16,ND,NZ,FALSE,32,0,,FALSE,fp8 e4m3 weightnz mx requires both scales E8M0
416-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/132,,opt_base_tail_load_balance,,,2,2,2,0,0,0,403,256,15616,0,0,0,0,1,0,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,131332,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 3 0 0 0 403 15616 256 208 256 128 256 256 0 16842756 1 1 1 1 0 0,FALSE,opt base block load balance tail416+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/132,,opt_base_tail_load_balance,,,2,2,2,0,0,0,403,256,15616,0,0,0,0,1,0,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,ND,TRUE,32,131348,403 15616 256 256 256 0 16777424 128 0 65537 65537 0 50331904 65796,FALSE,opt base block load balance tail
417-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/133,,opt_mx_afull_l1_estimate,,,3,3,3,1,1,1,88,1600,9120,0,1,1,0,1,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,TRUE,32,131348,88 9120 1600 256 256 1792 16777312 65664 2097153 524289 65537 0 67592 66052 0 0,FALSE,opt MX A full load L1 estimate417+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/133,,opt_mx_afull_l1_estimate,,,3,3,3,1,1,1,88,1600,9120,0,1,1,0,1,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,TRUE,32,131348,88 9120 1600 256 256 1792 16777312 65664 2097153 524289 65537 0 67592 66052,FALSE,opt MX A full load L1 estimate
418-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/134,,opt_mx_full_cover_scaleK,,,2,2,2,0,0,0,10240,1024,2624,0,1,0,0,1,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,TRUE,32,133396,10240 2624 1024 256 256 1024 16777472 65664 2097153 65537 65537 0 50333704 65794 0 0,FALSE,opt MX full cover scaleKL1; 2-buffer cube-bound418+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/134,,opt_mx_full_cover_scaleK,,,2,2,2,0,0,0,10240,1024,2624,0,1,0,0,1,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,TRUE,32,133396,10240 2624 1024 256 256 1024 16777472 65664 2097153 65537 65537 0 50333704 65794,FALSE,opt MX full cover scaleKL1; 2-buffer cube-bound
419-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/135,,opt_mx_halfk_scaleKL1,,,3,3,3,1,1,1,8,3072,1536,0,1,1,0,1,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,TRUE,32,131092,8 1536 3072 2560 2560 5120 3145744 66176 2097153 65537 65537 0 67592 514 0 0,FALSE,opt MX halfK fallback scaleKL1419+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/135,,opt_mx_halfk_scaleKL1,,,3,3,3,1,1,1,8,3072,1536,0,1,1,0,1,2,FLOAT8-E5M2,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,TRUE,32,131092,8 1536 3072 2560 2560 5120 3145744 66176 2097153 65537 65537 0 67592 514,FALSE,opt MX halfK fallback scaleKL1
420-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/136,,opt_mx_stepk2_four_buffer,,,2,2,2,0,0,0,366,512,13312,0,1,0,0,1,2,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT16,ND,ND,TRUE,32,131348,366 13312 512 256 256 512 16777408 65664 2097153 262145 65537 0 50333704 65796 0 0,FALSE,opt MX stepK2 four buffer fallback420+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/136,,opt_mx_stepk2_four_buffer,,,2,2,2,0,0,0,366,512,13312,0,1,0,0,1,2,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT16,ND,ND,TRUE,32,131348,366 13312 512 256 256 512 16777408 65664 2097153 262145 65537 0 50333704 65796,FALSE,opt MX stepK2 four buffer fallback
421-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/3BUF_01,,mx_3buf_fp4_large_irregular,,,3,3,3,1,1,1,5344,1248,1976,0,1,1,0,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,TRUE,32,131092,5344 1976 1248 512 512 1536 16777472 65792 2097153 131074 65537 0 67592 65795 0 0,FALSE,3-buffer MXFP4 ND large irregular MKN421+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/3BUF_01,,mx_3buf_fp4_large_irregular,,,3,3,3,1,1,1,5344,1248,1976,0,1,1,0,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,TRUE,32,131092,5344 1976 1248 512 512 1536 16777472 65792 2097153 131074 65537 0 67592 65795,FALSE,3-buffer MXFP4 ND large irregular MKN
422-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/3BUF_03,,mx_3buf_fp4_large_k_small_n,,,3,3,3,1,1,1,4096,8192,128,0,1,0,0,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT16,ND,ND,TRUE,32,131092,4096 128 8192 1024 1024 8192 8388736 66048 2097153 65537 65537 0 50333704 66051 0 0,FALSE,3-buffer MXFP4 ND exact L1 boundary422+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/3BUF_03,,mx_3buf_fp4_large_k_small_n,,,3,3,3,1,1,1,4096,8192,128,0,1,0,0,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT16,ND,ND,TRUE,32,131092,4096 128 8192 1024 1024 8192 8388736 66048 2097153 65537 65537 0 50333704 66051,FALSE,3-buffer MXFP4 ND exact L1 boundary
423-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/3BUF_MTE2_BOUND_INNER_UNALIGNED_02,,mx_3buf_fp8_weightnz_nn_inner_unaligned,,,2,2,2,0,0,0,10240,1024,2624,0,1,0,0,0,2,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,NZ,TRUE,32,131088,10240 2624 1024 256 256 1024 16777472 65664 2097153 65537 65537 0 50333704 65795 0 0,FALSE,3-buffer MXFP8 weightNz transA0 transB0 with unaligned B inner axis423+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/3BUF_MTE2_BOUND_INNER_UNALIGNED_02,,mx_3buf_fp8_weightnz_nn_inner_unaligned,,,2,2,2,0,0,0,10240,1024,2624,0,1,0,0,0,2,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,NZ,TRUE,32,131088,10240 2624 1024 256 256 1024 16777472 65664 2097153 65537 65537 0 50333704 65795,FALSE,3-buffer MXFP8 weightNz transA0 transB0 with unaligned B inner axis
424-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/3BUF_MTE2_BOUND_INNER_UNALIGNED_03,,mx_3buf_fp8_weightnz_tn_inner_unaligned,,,2,2,2,0,0,0,10240,1024,2624,0,1,0,1,0,2,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,NZ,TRUE,32,131089,10240 2624 1024 256 256 1024 16777472 65664 2097153 65537 65537 0 50333704 65795 0 0,FALSE,3-buffer MXFP8 weightNz transA1 transB0 with unaligned B inner axis424+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/3BUF_MTE2_BOUND_INNER_UNALIGNED_03,,mx_3buf_fp8_weightnz_tn_inner_unaligned,,,2,2,2,0,0,0,10240,1024,2624,0,1,0,1,0,2,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,NZ,TRUE,32,131089,10240 2624 1024 256 256 1024 16777472 65664 2097153 65537 65537 0 50333704 65795,FALSE,3-buffer MXFP8 weightNz transA1 transB0 with unaligned B inner axis
425-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/3BUF_10,,mx_3buf_fp8_nd_mixed_dtype,,,2,2,2,0,0,0,1820,576,4352,0,1,0,0,1,2,FLOAT8-E5M2,FLOAT8-E4M3,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT16,ND,ND,TRUE,32,131092,1820 4352 576 256 256 768 16777472 65664 2097153 131074 65540 208 50333704 65795 0 0,FALSE,3-buffer MXFP8 ND mixed E5M2 E4M3425+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/3BUF_10,,mx_3buf_fp8_nd_mixed_dtype,,,2,2,2,0,0,0,1820,576,4352,0,1,0,0,1,2,FLOAT8-E5M2,FLOAT8-E4M3,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT16,ND,ND,TRUE,32,131092,1820 4352 576 256 256 768 16777472 65664 2097153 131074 65540 208 50333704 65795,FALSE,3-buffer MXFP8 ND mixed E5M2 E4M3
426-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/3BUF_MTE2_BOUND_01,,mx_3buf_fp4_nd_mte2_bound,,,2,2,2,0,0,0,4096,8192,128,0,1,0,0,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT16,ND,ND,TRUE,32,131092,4096 128 8192 1024 1024 8192 8388736 66048 2097153 65537 65537 0 50333704 66051 0 0,FALSE,3-buffer MXFP4 ND aligned 2D MTE2-bound control426+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/3BUF_MTE2_BOUND_01,,mx_3buf_fp4_nd_mte2_bound,,,2,2,2,0,0,0,4096,8192,128,0,1,0,0,1,2,FLOAT4-E2M1,FLOAT4-E2M1,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT16,ND,ND,TRUE,32,131092,4096 128 8192 1024 1024 8192 8388736 66048 2097153 65537 65537 0 50333704 66051,FALSE,3-buffer MXFP4 ND aligned 2D MTE2-bound control
427-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/137,,mix_nz,,,3,3,3,1,1,1,128,256,4096,0,1,1,0,0,1,INT8,INT8,FLOAT,FLOAT,FLOAT,BF16,ND,NZ,TRUE,32,131600,128 4096 256 256 256 0 8388736 256 0 65537 65537 0 66052 516 0 0,FALSE,MIX NZ A full load candidate: M small427+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/137,,mix_nz,,,3,3,3,1,1,1,128,256,4096,0,1,1,0,0,1,INT8,INT8,FLOAT,FLOAT,FLOAT,BF16,ND,NZ,TRUE,32,131600,128 4096 256 256 256 0 8388736 256 0 65537 65537 0 66052 516,FALSE,MIX NZ A full load candidate: M small
428-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/138,,mix_nz,,,3,3,3,1,1,1,128,256,4096,0,1,1,0,1,1,INT8,INT8,FLOAT,FLOAT,FLOAT,BF16,ND,NZ,TRUE,32,131604,128 4096 256 256 256 0 8388736 256 0 65537 65537 0 66052 516 0 0,FALSE,A full load candidate: M small428+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/138,,mix_nz,,,3,3,3,1,1,1,128,256,4096,0,1,1,0,1,1,INT8,INT8,FLOAT,FLOAT,FLOAT,BF16,ND,NZ,TRUE,32,131604,128 4096 256 256 256 0 8388736 256 0 65537 65537 0 66052 516,FALSE,A full load candidate: M small
429Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/139,,mix_nz,,,3,3,3,2,2,2,128,256,4096,0,1,1,0,1,1,INT8,INT8,FLOAT,FLOAT,FLOAT,BF16,ND,NZ,TRUE,32,131588,2 2 2 1 1 1 2 1 1 1 2 1 1 1 2 4 2 0 0 0 0 0 128 4096 256 128 256 128 256 256 0 131332 1 1 1 1 0 0,FALSE,MIX NZ A full load candidate: M small429Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/139,,mix_nz,,,3,3,3,2,2,2,128,256,4096,0,1,1,0,1,1,INT8,INT8,FLOAT,FLOAT,FLOAT,BF16,ND,NZ,TRUE,32,131588,2 2 2 1 1 1 2 1 1 1 2 1 1 1 2 4 2 0 0 0 0 0 128 4096 256 128 256 128 256 256 0 131332 1 1 1 1 0 0,FALSE,MIX NZ A full load candidate: M small
430Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/140,,mix_nz,,,3,3,3,14,14,14,401,7549,1034,0,0,1,0,0,1,INT8,INT8,FLOAT,FLOAT,FLOAT,BF16,ND,NZ,TRUE,32,131584,14 14 14 1 1 1 14 1 1 1 14 1 1 1 14 0 2 0 0 0 0 0 401 1034 7549 208 256 128 384 384 0 16843010 2 1 1 1 0 0,FALSE,MIX NZ430Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/140,,mix_nz,,,3,3,3,14,14,14,401,7549,1034,0,0,1,0,0,1,INT8,INT8,FLOAT,FLOAT,FLOAT,BF16,ND,NZ,TRUE,32,131584,14 14 14 1 1 1 14 1 1 1 14 1 1 1 14 0 2 0 0 0 0 0 401 1034 7549 208 256 128 384 384 0 16843010 2 1 1 1 0 0,FALSE,MIX NZ
431-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/141,,mix_nz,,,3,3,3,1,1,1,128,128,16384,0,1,1,0,0,1,INT8,INT8,FLOAT,FLOAT,FLOAT,BF16,ND,NZ,TRUE,32,131856,128 16384 128 128 128 0 16777344 128 0 65537 65537 0 66052 516 0 0,FALSE,MIX NZ A full load candidate: M small431+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/141,,mix_nz,,,3,3,3,1,1,1,128,128,16384,0,1,1,0,0,1,INT8,INT8,FLOAT,FLOAT,FLOAT,BF16,ND,NZ,TRUE,32,131856,128 16384 128 128 128 0 16777344 128 0 65537 65537 0 66052 516,FALSE,MIX NZ A full load candidate: M small
432-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/142,,mix_nz,,,3,3,3,1,1,1,128,128,16384,0,1,1,0,1,1,INT8,INT8,FLOAT,FLOAT,FLOAT,BF16,ND,NZ,TRUE,32,131860,128 16384 128 128 128 0 16777344 128 0 65537 65537 0 66052 516 0 0,FALSE,MIX NZ A full load candidate: M small432+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/142,,mix_nz,,,3,3,3,1,1,1,128,128,16384,0,1,1,0,1,1,INT8,INT8,FLOAT,FLOAT,FLOAT,BF16,ND,NZ,TRUE,32,131860,128 16384 128 128 128 0 16777344 128 0 65537 65537 0 66052 516,FALSE,MIX NZ A full load candidate: M small
433Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/143,,mix_negative_nz,,,3,3,3,1,12,12,14,4668,2925,0,1,1,0,1,1,INT8,INT8,FLOAT,FLOAT,FLOAT,FLOAT,ND,NZ,FALSE,31,131844,,FALSE,MIX NZ A full load candidate: M small433Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/143,,mix_negative_nz,,,3,3,3,1,12,12,14,4668,2925,0,1,1,0,1,1,INT8,INT8,FLOAT,FLOAT,FLOAT,FLOAT,ND,NZ,FALSE,31,131844,,FALSE,MIX NZ A full load candidate: M small
434Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/144,,mix_negative_nz,,,3,3,3,1,12,12,14,4668,2925,0,1,1,0,0,1,INT8,INT8,FLOAT16,FLOAT,FLOAT,FLOAT,ND,NZ,FALSE,24,131840,128 16384 128 65536 1 0 16777344 128 65536 65537 1 33816576 33816577 0 0 0,FALSE,MIX NZ A full load candidate: M small434Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/144,,mix_negative_nz,,,3,3,3,1,12,12,14,4668,2925,0,1,1,0,0,1,INT8,INT8,FLOAT16,FLOAT,FLOAT,FLOAT,ND,NZ,FALSE,24,131840,128 16384 128 65536 1 0 16777344 128 65536 65537 1 33816576 33816577 0 0 0,FALSE,MIX NZ A full load candidate: M small
435Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/145,,mix_negative_nz,,,3,3,3,1,12,12,14,4668,2925,0,1,0,0,1,1,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT16,FLOAT,FLOAT16,FLOAT,ND,NZ,FALSE,31,772,,FALSE,MIX NZ A full load candidate: M small435Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/145,,mix_negative_nz,,,3,3,3,1,12,12,14,4668,2925,0,1,0,0,1,1,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT16,FLOAT,FLOAT16,FLOAT,ND,NZ,FALSE,31,772,,FALSE,MIX NZ A full load candidate: M small
@@ -438,8 +438,8 @@ Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/147,,mix_negative_
438Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/148,,mix_negative_nz,,,3,3,3,1,12,12,14,4668,2925,0,1,0,0,1,1,HIFLOAT8,HIFLOAT8,FLOAT16,FLOAT,FLOAT,FLOAT,ND,NZ,FALSE,31,131844,,FALSE,MIX NZ A full load candidate: M small438Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/148,,mix_negative_nz,,,3,3,3,1,12,12,14,4668,2925,0,1,0,0,1,1,HIFLOAT8,HIFLOAT8,FLOAT16,FLOAT,FLOAT,FLOAT,ND,NZ,FALSE,31,131844,,FALSE,MIX NZ A full load candidate: M small
439Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/149,,mix_negative_nz,,,3,3,3,1,12,12,14,4668,2925,0,1,0,0,0,1,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT16,FLOAT,FLOAT,FLOAT,ND,NZ,FALSE,31,131844,,FALSE,MIX NZ A full load candidate: M small439Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/149,,mix_negative_nz,,,3,3,3,1,12,12,14,4668,2925,0,1,0,0,0,1,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT16,FLOAT,FLOAT,FLOAT,ND,NZ,FALSE,31,131844,,FALSE,MIX NZ A full load candidate: M small
440Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/150,,mix_nz_invalid_aiv_num,32,32,3,3,3,1,1,1,128,256,4096,0,1,1,0,0,1,INT8,INT8,FLOAT,FLOAT,FLOAT,BF16,ND,NZ,FALSE,32,131600,,FALSE,440Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/150,,mix_nz_invalid_aiv_num,32,32,3,3,3,1,1,1,128,256,4096,0,1,1,0,0,1,INT8,INT8,FLOAT,FLOAT,FLOAT,BF16,ND,NZ,FALSE,32,131600,,FALSE,
441-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/151,,mix_nz_small_shape,,,2,2,2,0,0,0,176,9536,3072,0,1,1,0,0,1,INT8,INT8,FLOAT,FLOAT,BF16,BF16,ND,NZ,TRUE,24,131600,176 3072 9536 640 640 0 8388784 128 0 65537 65537 0 453050884 514 0 0,FALSE,441+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/151,,mix_nz_small_shape,,,2,2,2,0,0,0,176,9536,3072,0,1,1,0,0,1,INT8,INT8,FLOAT,FLOAT,BF16,BF16,ND,NZ,TRUE,24,131600,176 3072 9536 640 640 0 8388784 128 0 65537 65537 0 453050884 514,FALSE,
442-Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/152,,mx_2buf_large_shape,,,2,2,2,0,0,0,2154,4117,828,0,1,0,1,1,2,FLOAT8-E4M3,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT16,ND,ND,TRUE,32,131093,2154 828 4117 256 256 4352 16777472 65664 2097153 131076 65537 0 50333704 65794 0 0,FALSE,442+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/152,,mx_2buf_large_shape,,,2,2,2,0,0,0,2154,4117,828,0,1,0,1,1,2,FLOAT8-E4M3,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT16,ND,ND,TRUE,32,131093,2154 828 4117 256 256 4352 16777472 65664 2097153 131076 65537 0 50333704 65794,FALSE,
443Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/153,,perblock_invalid_determinstic_level,,,3,3,3,1,1,1,128,128,128,0,1,0,0,0,3,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,FLOAT16,ND,NZ,TRUE,8,66560,,FALSE,,2443Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/153,,perblock_invalid_determinstic_level,,,3,3,3,1,1,1,128,128,128,0,1,0,0,0,3,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT,FLOAT,FLOAT,FLOAT16,ND,NZ,TRUE,8,66560,,FALSE,,2
444Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/154,,mxfp8_streamk,,,2,2,2,0,0,0,3613,4344,145,0,1,1,0,0,2,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,TRUE,32,133904,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 8 8 0 0 1 1 32 3613 145 4344 240 160 128 512 512 2048 16843010 2304 512 0 0 1 1 1 1 0 0,FALSE,444Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/154,,mxfp8_streamk,,,2,2,2,0,0,0,3613,4344,145,0,1,1,0,0,2,FLOAT8-E4M3,FLOAT8-E4M3,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,BF16,ND,ND,TRUE,32,133904,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 8 8 0 0 1 1 32 3613 145 4344 240 160 128 512 512 2048 16843010 2304 512 0 0 1 1 1 1 0 0,FALSE,
445Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/155,,mxfp8_streamk,,,2,2,2,0,0,0,109,7168,2048,0,1,1,1,1,2,FLOAT8-E4M3,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT16,ND,ND,TRUE,32,133909,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 8 8 0 0 1 1 32 109 2048 7168 128 256 128 512 512 1536 131330 1792 512 0 0 1 1 1 1 0 0,FALSE,445Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/155,,mxfp8_streamk,,,2,2,2,0,0,0,109,7168,2048,0,1,1,1,1,2,FLOAT8-E4M3,FLOAT8-E5M2,FLOAT8-E8M0,FLOAT8-E8M0,FLOAT,FLOAT16,ND,ND,TRUE,32,133909,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 8 8 0 0 1 1 32 109 2048 7168 128 256 128 512 512 1536 131330 1792 512 0 0 1 1 1 1 0 0,FALSE,
@@ -529,4 +529,12 @@ Ascend950,tiling_err_950_doublescale_invalid,,error_cov,,,2,2,2,0,0,0,128,128,12
529Ascend950,tiling_err_950_hif8_doublescale_invalid,,error_cov,,,2,2,2,0,0,0,128,128,128,0,1,0,0,0,6,HIFLOAT8,HIFLOAT8,FLOAT,FLOAT,FLOAT,FLOAT16,ND,ND,FALSE,32,0,,FALSE,950 HIF8 double scale invalid,529Ascend950,tiling_err_950_hif8_doublescale_invalid,,error_cov,,,2,2,2,0,0,0,128,128,128,0,1,0,0,0,6,HIFLOAT8,HIFLOAT8,FLOAT,FLOAT,FLOAT,FLOAT16,ND,ND,FALSE,32,0,,FALSE,950 HIF8 double scale invalid,
530Ascend310P3,tiling_err_310p_k0,,error_cov,,,3,3,3,1,1,1,128,0,128,0,0,1,0,1,1,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,NZ,FALSE,8,0,,FALSE,310P k=0,530Ascend310P3,tiling_err_310p_k0,,error_cov,,,3,3,3,1,1,1,128,0,128,0,0,1,0,1,1,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,NZ,FALSE,8,0,,FALSE,310P k=0,
531Ascend310P3,tiling_err_310p_n0,,error_cov,,,3,3,3,1,1,1,128,128,0,0,0,1,0,1,1,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,NZ,FALSE,8,0,,FALSE,310P n=0,531Ascend310P3,tiling_err_310p_n0,,error_cov,,,3,3,3,1,1,1,128,128,0,0,0,1,0,1,1,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,NZ,FALSE,8,0,,FALSE,310P n=0,
532-Ascend310P3,tiling_err_310p_batch_mismatch,,error_cov,,,3,3,3,2,3,1,128,128,128,0,0,1,0,1,1,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,NZ,FALSE,8,0,,FALSE,310P batch mismatch,532+Ascend310P3,tiling_err_310p_batch_mismatch,,error_cov,,,3,3,3,2,3,1,128,128,128,0,0,1,0,1,1,INT8,INT8,UINT64,FLOAT,INT32,FLOAT16,ND,NZ,FALSE,8,0,,FALSE,310P batch mismatch,
533+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/asym_l1_ff_short_burst,,asym_l1_buffer_regression,,,2,2,2,0,0,0,8,7168,1536,0,0,0,0,0,0,FLOAT8-E4M3,FLOAT8-E4M3,UINT64,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,24,131072,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 3 0 0 0 8 1536 7168 16 64 128 7168 512 0 131074 1 1 1 1 0 0,FALSE,Normalize to physical N=64 while retaining the pre-normalization asymmetric traversal
534+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/asym_l1_ft_long_burst,,asym_l1_buffer_regression,,,2,2,2,0,0,0,8,7168,1536,0,0,0,0,1,0,FLOAT8-E4M3,FLOAT8-E4M3,UINT64,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,32,131076,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 3 0 0 0 8 1536 7168 16 48 640 1280 1280 0 131076 1 1 1 1 0 0,FALSE,Keep four buffers for transposed B with a long contiguous K burst
535+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/asym_l1_tf_short_burst,,asym_l1_buffer_regression,,,2,2,2,0,0,0,8,7168,1536,0,0,0,1,0,0,FLOAT8-E4M3,FLOAT8-E4M3,UINT64,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,24,131073,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 3 0 0 0 8 1536 7168 32 64 128 4096 512 0 131074 1 1 1 1 0 0,FALSE,Retain the asymmetric traversal for the repeatedly streamed short-N-burst B copy
536+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/asym_l1_tt_long_burst,,asym_l1_buffer_regression,,,2,2,2,0,0,0,8,7168,1536,0,0,0,1,1,0,FLOAT8-E4M3,FLOAT8-E4M3,UINT64,FLOAT,FLOAT,FLOAT16,ND,ND,TRUE,32,131077,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 3 0 0 0 8 1536 7168 128 48 256 512 512 0 131076 1 1 1 1 0 0,FALSE,Keep the symmetric four-buffer traversal when normalization does not coarsen K
537+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/l1_three_buffer_effective_pipeline,,l1_buffer_pipeline_regression,,,2,2,2,0,0,0,8,16384,3072,0,0,0,0,1,1,FLOAT8-E5M2,FLOAT8-E5M2,INT64,INT8,INT8,FLOAT,ND,ND,TRUE,32,131076,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 2 0 3 0 0 0 8 3072 16384 16 96 256 1280 1280 0 131075 1 1 1 1 0 0,FALSE,Use three buffers only when aligned 256-byte bursts and the recurring three-stage payload can sustain the pipeline
538+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/weight_nz_keeps_physical_large_k,,l1_buffer_pipeline_regression,,,2,2,2,0,0,0,64,4096,256,0,0,0,0,0,1,FLOAT8-E4M3,FLOAT8-E4M3,UINT64,INT8,INT8,FLOAT,ND,NZ,TRUE,32,131072,1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 2 0 3 0 0 0 64 256 4096 16 32 128 3968 3968 0 16908290 1 1 1 1 0 0,FALSE,Do not restore a legacy four-buffer K tile when FRACTAL_NZ already provides an efficient physical copy
539+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/weight_nz_short_k_pipeline,,l1_buffer_pipeline_regression,,,3,3,3,2,2,2,128,8192,512,0,0,0,0,1,0,INT8,INT8,INT64,INT8,INT8,BF16,ND,NZ,TRUE,32,131076,2 2 2 1 1 1 2 1 1 1 2 1 1 1 2 0 1 0 3 0 0 0 128 512 8192 64 64 512 2048 2048 0 16908290 1 1 1 1 0 0,FALSE,Keep stepK four with two buffers when halving stepK only doubles a four-tile K loop without increasing in-flight K
540+Ascend950,QUANTMM950/TestQuantBatchMatmulV3Tiling.generalTest/cube_roofline_ff_1041x8193x1697,,cube_base_roofline_regression,,,2,2,2,0,0,0,1041,8193,1697,1,0,0,0,0,1,INT8,INT8,UINT64,FLOAT,INT8,INT8,ND,ND,TRUE,32,131088,,TRUE,FF cube-bound origin regression with UINT64 per-channel scale plus offset plus INT8 requant output
@@ -749,13 +749,13 @@ void QuantBatchMatmulV3TilingTestParam::InvokeTilingFunc(QuantBatchMatmulV3Compi
749 }749 }
750 750 
751 size_t actualTilingDataSize = tilingContext->GetRawTilingData()->GetDataSize();751 size_t actualTilingDataSize = tilingContext->GetRawTilingData()->GetDataSize();
752- bool isMxWithoutBatchTilingData = tensorApiCapable && (isMxfp8 || isMxfp4) &&752+ bool useWithoutBatchTilingData = tensorApiCapable &&
753- actualTilingDataSize ==753+ actualTilingDataSize ==
754- sizeof(DequantBmm::QuantBatchMatmulV3TensorAPIWithoutBatchTilingData);754+ sizeof(DequantBmm::QuantBatchMatmulV3TensorAPIWithoutBatchTilingData);
755 bool useBasicApiTilingData = actualTilingDataSize == sizeof(DequantBmm::QuantBatchMatmulV3BasicAPITilingData);755 bool useBasicApiTilingData = actualTilingDataSize == sizeof(DequantBmm::QuantBatchMatmulV3BasicAPITilingData);
756 bool useStreamKBasicApiTilingData = actualTilingDataSize ==756 bool useStreamKBasicApiTilingData = actualTilingDataSize ==
757 sizeof(DequantBmm::QuantBatchMatmulV3StreamKBasicAPITilingData);757 sizeof(DequantBmm::QuantBatchMatmulV3StreamKBasicAPITilingData);
758- if (isMxWithoutBatchTilingData) {758+ if (useWithoutBatchTilingData) {
759 DequantBmm::QuantBatchMatmulV3TensorAPIWithoutBatchTilingData&759 DequantBmm::QuantBatchMatmulV3TensorAPIWithoutBatchTilingData&
760 actualTilingData = *reinterpret_cast<DequantBmm::QuantBatchMatmulV3TensorAPIWithoutBatchTilingData*>(760 actualTilingData = *reinterpret_cast<DequantBmm::QuantBatchMatmulV3TensorAPIWithoutBatchTilingData*>(
761 tilingContext->GetRawTilingData()->GetData());761 tilingContext->GetRawTilingData()->GetData());
@@ -964,6 +964,141 @@ static BaseBlockRes ComputeStreamKBaseBlock(bool isMxPerGroup, bool transA, bool
964 return calculator.GetOutput();964 return calculator.GetOutput();
965}965}
966 966 
967+static BaseBlockRes ComputeCubeBasicBaseBlock(bool transA, bool transB, uint64_t mSize, uint64_t nSize, uint64_t kSize)
968+{
969+ QuantBatchMatmulInfo inputParams{};
970+ inputParams.opName = "QuantBatchMatmulV3CubeBasicBaseBlockUt";
971+ inputParams.mSize = mSize;
972+ inputParams.nSize = nSize;
973+ inputParams.kSize = kSize;
974+ inputParams.batchC = 1UL;
975+ inputParams.transA = transA;
976+ inputParams.transB = transB;
977+ inputParams.aDtype = ge::DT_INT8;
978+ inputParams.bDtype = ge::DT_INT8;
979+ inputParams.isPerChannel = true;
980+ 
981+ QuantBatchMatmulV3CompileInfo compileInfo{};
982+ compileInfo.aicNum = 32U;
983+ compileInfo.l0aSize = 65536UL;
984+ compileInfo.l0bSize = 65536UL;
985+ compileInfo.npuArch = NpuArch::DAV_3510;
986+ 
987+ BaseBlockCalculator calculator(inputParams, compileInfo);
988+ EXPECT_TRUE(calculator.Compute(BaseBlockMode::CUBE_BASIC));
989+ return calculator.GetOutput();
990+}
991+ 
992+static BaseBlockRes ComputeMxBaseBlock(bool transA, bool transB, uint64_t mSize, uint64_t nSize, uint64_t kSize)
993+{
994+ QuantBatchMatmulInfo inputParams{};
995+ inputParams.opName = "QuantBatchMatmulV3MxBaseBlockUt";
996+ inputParams.mSize = mSize;
997+ inputParams.nSize = nSize;
998+ inputParams.kSize = kSize;
999+ inputParams.batchC = 1UL;
1000+ inputParams.transA = transA;
1001+ inputParams.transB = transB;
1002+ inputParams.aDtype = ge::DT_FLOAT8_E4M3FN;
1003+ inputParams.bDtype = ge::DT_FLOAT8_E4M3FN;
1004+ inputParams.isMxPerGroup = true;
1005+ 
1006+ QuantBatchMatmulV3CompileInfo compileInfo{};
1007+ compileInfo.aicNum = 32U;
1008+ compileInfo.l0aSize = 65536UL;
1009+ compileInfo.l0bSize = 65536UL;
1010+ compileInfo.npuArch = NpuArch::DAV_3510;
1011+ 
1012+ BaseBlockCalculator calculator(inputParams, compileInfo);
1013+ EXPECT_TRUE(calculator.Compute(BaseBlockMode::DEFAULT));
1014+ return calculator.GetOutput();
1015+}
1016+ 
1017+TEST(QuantBatchMatmulV3CubeBasicBaseBlock, RejectsZeroShapeBeforeBaseBlockScoring)
1018+{
1019+ QuantBatchMatmulInfo inputParams{};
1020+ inputParams.opName = "QuantBatchMatmulV3CubeBasicZeroShapeUt";
1021+ inputParams.mSize = 0UL;
1022+ inputParams.nSize = 128UL;
1023+ inputParams.kSize = 128UL;
1024+ inputParams.batchC = 1UL;
1025+ inputParams.aDtype = ge::DT_INT8;
1026+ inputParams.bDtype = ge::DT_INT8;
1027+ 
1028+ QuantBatchMatmulV3CompileInfo compileInfo{};
1029+ compileInfo.aicNum = 32U;
1030+ compileInfo.l0aSize = 65536UL;
1031+ compileInfo.l0bSize = 65536UL;
1032+ compileInfo.npuArch = NpuArch::DAV_3510;
1033+ 
1034+ BaseBlockCalculator calculator(inputParams, compileInfo);
1035+ EXPECT_FALSE(calculator.Compute(BaseBlockMode::CUBE_BASIC));
1036+}
1037+ 
1038+TEST(QuantBatchMatmulV3CubeBasicBaseBlock, SearchesBeyondThreeRoundsWhenTailCoreUseImproves)
1039+{
1040+ // 15 x 7 logical blocks take four rounds and leave nine blocks in the final round. A 224-wide M base changes
1041+ // the grid to 18 x 7 without adding a round, allowing 30 rather than 27 tail-split cores to do useful work.
1042+ const auto result = ComputeCubeBasicBaseBlock(false, false, 3840UL, 1792UL, 4096UL);
1043+ 
1044+ EXPECT_EQ(result.baseM, 224UL);
1045+ EXPECT_EQ(result.baseN, 256UL);
1046+}
1047+ 
1048+TEST(QuantBatchMatmulV3CubeBasicBaseBlock, KeepsExactTailSplitWhenMoreLogicalBlocksDoNotAddCoreUse)
1049+{
1050+ // The 7 x 16 grid already splits its 16-block tail exactly across 32 cores. Reducing baseM would only replace
1051+ // those split tiles with more full tiles, so the memory/compute tie-breaker must retain the original base.
1052+ const auto result = ComputeCubeBasicBaseBlock(false, false, 1792UL, 4096UL, 1024UL);
1053+ 
1054+ EXPECT_EQ(result.baseM, 256UL);
1055+ EXPECT_EQ(result.baseN, 256UL);
1056+}
1057+ 
1058+TEST(QuantBatchMatmulV3CubeBasicBaseBlock, RejectsMarginalMultiRoundGainThatLosesNAlignment)
1059+{
1060+ // Changing N from 256 to 240 fills the last wave, but its geometry-only gain is just 6.67%. Beyond three waves
1061+ // that is insufficient headroom for the unmodeled N-path and L1-pipeline costs of losing 128-wide alignment.
1062+ const auto result = ComputeCubeBasicBaseBlock(false, true, 4608UL, 3840UL, 4096UL);
1063+ 
1064+ EXPECT_EQ(result.baseM, 256UL);
1065+ EXPECT_EQ(result.baseN, 256UL);
1066+}
1067+ 
1068+TEST(QuantBatchMatmulV3MxBaseBlock, ScoresOversizedSearchPointAsAppliedBlock)
1069+{
1070+ // The L2-aligned virtual candidate is 192 x 128, but N=65 makes the applied block 192 x 96. Scoring the
1071+ // virtual N=128 would spuriously replace the original 256 x 96 block even though the applied geometry does not
1072+ // improve final-wave utilization.
1073+ const auto result = ComputeMxBaseBlock(false, false, 12288UL, 65UL, 8192UL);
1074+ 
1075+ EXPECT_EQ(result.baseM, 256UL);
1076+ EXPECT_EQ(result.baseN, 96UL);
1077+}
1078+ 
1079+TEST(QuantBatchMatmulV3MxBaseBlock, KeepsOriginForSmallKUnalignedNCandidate)
1080+{
1081+ // The same 160 x 224 load-balance candidate is legal for large K, while the common small-K alignment rule keeps
1082+ // the original 256 x 256 block when N-path fixed costs dominate.
1083+ const auto smallKResult = ComputeMxBaseBlock(false, true, 320UL, 7168UL, 1024UL);
1084+ const auto largeKResult = ComputeMxBaseBlock(false, true, 320UL, 7168UL, 8192UL);
1085+ 
1086+ EXPECT_EQ(smallKResult.baseM, 256UL);
1087+ EXPECT_EQ(smallKResult.baseN, 256UL);
1088+ EXPECT_EQ(largeKResult.baseM, 160UL);
1089+ EXPECT_EQ(largeKResult.baseN, 224UL);
1090+}
1091+ 
1092+TEST(QuantBatchMatmulV3MxBaseBlock, RejectsMarginalExtendedSearchGainThatLosesNAlignment)
1093+{
1094+ // The original grid needs nine waves. N=240 fills the final wave but improves modeled balance by only 6.67%,
1095+ // so the common extended-search guard retains the 128-aligned N base.
1096+ const auto result = ComputeMxBaseBlock(false, true, 4608UL, 3840UL, 4096UL);
1097+ 
1098+ EXPECT_EQ(result.baseM, 256UL);
1099+ EXPECT_EQ(result.baseN, 256UL);
1100+}
1101+ 
967TEST(QuantBatchMatmulV3StreamKSingleCoreKAlign, CubeStreamKAlignsEveryTransposeTo256Bytes)1102TEST(QuantBatchMatmulV3StreamKSingleCoreKAlign, CubeStreamKAlignsEveryTransposeTo256Bytes)
968{1103{
969 for (bool transA : {false, true}) {1104 for (bool transA : {false, true}) {
@@ -1,5 +1,5 @@
1/**1/**
2- * Copyright (c) 2025 Huawei Technologies Co., Ltd.2+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
3 * This program is free software, you can redistribute it and/or modify it under the terms and conditions of3 * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4 * CANN Open Software License Agreement Version 2.0 (the "License").4 * CANN Open Software License Agreement Version 2.0 (the "License").
5 * Please refer to the License for details. You may not use this file except in compliance with the License.5 * Please refer to the License for details. You may not use this file except in compliance with the License.
@@ -12,9 +12,10 @@
12 * \file test_aclnn_quant_matmul_reduce_sum_weight_nz.cpp12 * \file test_aclnn_quant_matmul_reduce_sum_weight_nz.cpp
13 * \brief13 * \brief
14 */14 */
15+#include <cmath>
15#include <cstdint>16#include <cstdint>
16-#include <cstring>
17#include <iostream>17#include <iostream>
18+#include <limits>
18#include <memory>19#include <memory>
19#include <vector>20#include <vector>
20 21 
@@ -53,11 +54,26 @@ int64_t GetShapeSize(const std::vector<int64_t>& shape)
53 54 
54float Bfloat16ToFloat(uint16_t value)55float Bfloat16ToFloat(uint16_t value)
55{56{
56- // BF16是FP32的高16位,低16位补0后即可得到对应的FP32位表示。57+ constexpr uint16_t SIGN_MASK = 0x8000U;
57- const uint32_t bits = static_cast<uint32_t>(value) << 16U;58+ constexpr uint16_t EXPONENT_MASK = 0x7F80U;
59+ constexpr uint16_t MANTISSA_MASK = 0x007FU;
60+ constexpr int32_t EXPONENT_BIAS = 127;
61+ constexpr int32_t MANTISSA_BITS = 7;
62+ 
63+ const bool isNegative = (value & SIGN_MASK) != 0U;
64+ const uint16_t exponent = (value & EXPONENT_MASK) >> MANTISSA_BITS;
65+ const uint16_t mantissa = value & MANTISSA_MASK;
58 float result = 0.0F;66 float result = 0.0F;
59- std::memcpy(&result, &bits, sizeof(result));67+ if (exponent == 0xFFU) {
60- return result;68+ result = mantissa == 0U ? std::numeric_limits<float>::infinity() : std::numeric_limits<float>::quiet_NaN();
69+ } else if (exponent == 0U) {
70+ // BF16 subnormal: mantissa * 2^(1 - bias - mantissa_bits).
71+ result = std::ldexp(static_cast<float>(mantissa), 1 - EXPONENT_BIAS - MANTISSA_BITS);
72+ } else {
73+ const float significand = 1.0F + static_cast<float>(mantissa) / (1U << MANTISSA_BITS);
74+ result = std::ldexp(significand, static_cast<int32_t>(exponent) - EXPONENT_BIAS);
75+ }
76+ return isNegative ? -result : result;
61}77}
62 78 
63int Init(int32_t deviceId, aclrtStream* stream)79int Init(int32_t deviceId, aclrtStream* stream)