已合并
fix(dequant_swiglu_quant): 修复arch35 tmpBuffer stride不匹配导致VEC越界AIC Error #8561
caorenlei创建于 8月11日
fix(dequant_swiglu_quant): 修复arch35 tmpBuffer stride不匹配导致VEC越界AIC Error #8561
已合并
caorenlei创建于 8月11日
共 1 个文件变更+4-4
@@ -506,7 +506,7 @@ __aicore__ inline void DequantSwigluQuantBase<TActScale, TQuantScale, TGroup, TB
506 // x的数据类型变换之后,对齐点变化了,应该用xTypeUb参数506 // x的数据类型变换之后,对齐点变化了,应该用xTypeUb参数
507 auto x1Addr = x1Ptr + i * xTypeUbAlignB32_ + j * sizePerRepeat;507 auto x1Addr = x1Ptr + i * xTypeUbAlignB32_ + j * sizePerRepeat;
508 auto x2Addr = x2Ptr + i * xTypeUbAlignB32_ + j * sizePerRepeat;508 auto x2Addr = x2Ptr + i * xTypeUbAlignB32_ + j * sizePerRepeat;
509- auto dstAddr = tmpXPtr + i * xTypeUbAlignB32_ + j * sizePerRepeat;509+ auto dstAddr = tmpXPtr + i * xUbAlignB32_ + j * sizePerRepeat;
510 510 
511 // vreg0 -> x1, vreg10 -> x2511 // vreg0 -> x1, vreg10 -> x2
512 if constexpr (ifXFloat16Index_) {512 if constexpr (ifXFloat16Index_) {
@@ -664,7 +664,7 @@ __aicore__ inline void DequantSwigluQuantBase<TActScale, TQuantScale, TGroup, TB
664 664 
665 // 先处理尾块665 // 先处理尾块
666 uint16_t j = repeatTimes - 1;666 uint16_t j = repeatTimes - 1;
667- auto tmpXAddr = tmpXPtr + i * xTypeUbAlignB32_ + j * sizePerRepeat;667+ auto tmpXAddr = tmpXPtr + i * xUbAlignB32_ + j * sizePerRepeat;
668 AscendC::MicroAPI::LoadAlign(vreg0, tmpXAddr);668 AscendC::MicroAPI::LoadAlign(vreg0, tmpXAddr);
669 669 
670 // x * quant_scale670 // x * quant_scale
@@ -681,7 +681,7 @@ __aicore__ inline void DequantSwigluQuantBase<TActScale, TQuantScale, TGroup, TB
681 681 
682 // 整块处理682 // 整块处理
683 for (uint16_t j = 0; j < static_cast<uint16_t>(repeatTimes - 1); j++) {683 for (uint16_t j = 0; j < static_cast<uint16_t>(repeatTimes - 1); j++) {
684- auto tmpXAddr = tmpXPtr + i * xTypeUbAlignB32_ + j * sizePerRepeat;684+ auto tmpXAddr = tmpXPtr + i * xUbAlignB32_ + j * sizePerRepeat;
685 AscendC::MicroAPI::LoadAlign(vreg0, tmpXAddr);685 AscendC::MicroAPI::LoadAlign(vreg0, tmpXAddr);
686 686 
687 // x * quant_scale687 // x * quant_scale
@@ -748,7 +748,7 @@ __aicore__ inline void DequantSwigluQuantBase<TActScale, TQuantScale, TGroup, TB
748 for (uint16_t j = 0; j < repeatTimes; j++) {748 for (uint16_t j = 0; j < repeatTimes; j++) {
749 mask = AscendC::MicroAPI::UpdateMask<uint32_t>(width);749 mask = AscendC::MicroAPI::UpdateMask<uint32_t>(width);
750 750 
751- auto tmpXAddr = tmpXPtr + i * xTypeUbAlignB32_ + j * sizePerRepeat;751+ auto tmpXAddr = tmpXPtr + i * xUbAlignB32_ + j * sizePerRepeat;
752 auto yAddr = yPtr + i * yUbAlignB8_ + j * sizePerRepeat;752 auto yAddr = yPtr + i * yUbAlignB8_ + j * sizePerRepeat;
753 auto yFp4Addr = yFp4Ptr + i * yUbAlignB4_ + (j * sizePerRepeat / 2);753 auto yFp4Addr = yFp4Ptr + i * yUbAlignB4_ + (j * sizePerRepeat / 2);
754 754