已合并
[bugfix] 修复opbase的log问题 #817
justsheldon创建于 9月3日
[bugfix] 修复opbase的log问题 #817
已合并
共 17 个文件变更+46-37
| @@ -114,7 +114,7 @@ public: | |||
| 114 | allocatedTensorList_.push_back(tensor); | 114 | allocatedTensorList_.push_back(tensor); |
| 115 | return tensor; | 115 | return tensor; |
| 116 | } catch (...) { | 116 | } catch (...) { |
| 117 | - OP_LOGE(ACLNN_ERR_INNER, "aclOpExecutor::ConvertToTensor fail."); | 117 | + OP_LOGE(ACLNN_ERR_INNER, "aclOpExecutor::ConvertToTensor failed."); |
| 118 | delete tensor; | 118 | delete tensor; |
| 119 | return nullptr; | 119 | return nullptr; |
| 120 | } | 120 | } |
| @@ -181,7 +181,7 @@ public: | |||
| 181 | if (uniqueExecutor_.get() != nullptr) { | 181 | if (uniqueExecutor_.get() != nullptr) { |
| 182 | uniqueExecutor_.get()->DeleteCache(); | 182 | uniqueExecutor_.get()->DeleteCache(); |
| 183 | OP_LOGE_WITHOUT_REPORT(ACLNN_ERR_INNER_NOT_TRANS_EXECUTOR, | 183 | OP_LOGE_WITHOUT_REPORT(ACLNN_ERR_INNER_NOT_TRANS_EXECUTOR, |
| 184 | - "When %s do success, ReleaseTo(executor) should be called before return.", | 184 | + "When %s succeeds, ReleaseTo(executor) should be called before return.", |
| 185 | funcName_); | 185 | funcName_); |
| 186 | } | 186 | } |
| 187 | } | 187 | } |
| @@ -376,7 +376,7 @@ private: | |||
| 376 | } | 376 | } |
| 377 | 377 | ||
| 378 | if (index < 0 || index >= BlockPool::MAX_STORE) { | 378 | if (index < 0 || index >= BlockPool::MAX_STORE) { |
| 379 | - OP_LOGE(ACLNN_ERR_INNER, "invalid cache to alloc, idx %d size %lu", index, size); | 379 | + OP_LOGE(ACLNN_ERR_INNER, "invalid cache to alloc, idx %d size %lu B", index, size); |
| 380 | return nullptr; | 380 | return nullptr; |
| 381 | } | 381 | } |
| 382 | 382 | ||
| @@ -274,7 +274,7 @@ private: | |||
| 274 | devArgNum_++; | 274 | devArgNum_++; |
| 275 | tensorNum_++; | 275 | tensorNum_++; |
| 276 | #ifdef DEBUG | 276 | #ifdef DEBUG |
| 277 | - OP_LOGD("Append Launch DEVICE aclTensor. dims: %zu, dtype: %d, aclTensor: %p, addr: %p, tensor size: %zu", | 277 | + OP_LOGD("Append Launch DEVICE aclTensor. dims: %zu, dtype: %d, aclTensor: %p, addr: %p, tensor size: %zu B", |
| 278 | arg->GetStorageShape().GetDimNum(), arg->GetDataType(), arg, arg->GetData(), | 278 | arg->GetStorageShape().GetDimNum(), arg->GetDataType(), arg, arg->GetData(), |
| 279 | arg->GetTensor()->GetSize()); | 279 | arg->GetTensor()->GetSize()); |
| 280 | const auto& shape = arg->GetStorageShape(); | 280 | const auto& shape = arg->GetStorageShape(); |
| @@ -288,7 +288,7 @@ private: | |||
| 288 | hostArgNum_++; | 288 | hostArgNum_++; |
| 289 | tensorNum_++; | 289 | tensorNum_++; |
| 290 | #ifdef DEBUG | 290 | #ifdef DEBUG |
| 291 | - OP_LOGD("Append Launch HOST aclTensor. dims: %zu, dtype: %d, %p, calc size: %zu, tensor size: %zu", | 291 | + OP_LOGD("Append Launch HOST aclTensor. dims: %zu, dtype: %d, %p, calc size: %zu B, tensor size: %zu B", |
| 292 | arg->GetStorageShape().GetDimNum(), arg->GetDataType(), arg, size, arg->GetTensor()->GetSize()); | 292 | arg->GetStorageShape().GetDimNum(), arg->GetDataType(), arg, size, arg->GetTensor()->GetSize()); |
| 293 | const auto& shape = arg->GetStorageShape(); | 293 | const auto& shape = arg->GetStorageShape(); |
| 294 | for (size_t i = 0; i < shape.GetDimNum(); i++) { | 294 | for (size_t i = 0; i < shape.GetDimNum(); i++) { |
| @@ -318,7 +318,7 @@ private: | |||
| 318 | tensorNum_ += arg->Size() + 1; | 318 | tensorNum_ += arg->Size() + 1; |
| 319 | dfxInfoDumpElemCount_++; | 319 | dfxInfoDumpElemCount_++; |
| 320 | #ifdef DEBUG | 320 | #ifdef DEBUG |
| 321 | - OP_LOGD("Append input DEVICE ptr: size %lu, dataSize %zu", arg->Size(), dataSize); | 321 | + OP_LOGD("Append input DEVICE ptr: tensor num: %lu, dataSize: %zu B", arg->Size(), dataSize); |
| 322 | #endif | 322 | #endif |
| 323 | return; | 323 | return; |
| 324 | } | 324 | } |
| @@ -347,7 +347,7 @@ private: | |||
| 347 | tensorNum_++; | 347 | tensorNum_++; |
| 348 | dfxInfoDumpElemCount_ += CalAdumpDFXInfoElemCount(arg); | 348 | dfxInfoDumpElemCount_ += CalAdumpDFXInfoElemCount(arg); |
| 349 | #ifdef DEBUG | 349 | #ifdef DEBUG |
| 350 | - OP_LOGD("Append Launch aclTensor. dims: %zu, dtype: %d, data:%p, tensor size: %zu", | 350 | + OP_LOGD("Append Launch aclTensor. dims: %zu, dtype: %d, data:%p, tensor size: %zu B", |
| 351 | arg->GetStorageShape().GetDimNum(), arg->GetDataType(), arg->GetData(), arg->GetTensor()->GetSize()); | 351 | arg->GetStorageShape().GetDimNum(), arg->GetDataType(), arg->GetData(), arg->GetTensor()->GetSize()); |
| 352 | const auto& shape = arg->GetStorageShape(); | 352 | const auto& shape = arg->GetStorageShape(); |
| 353 | for (size_t i = 0; i < shape.GetDimNum(); i++) { | 353 | for (size_t i = 0; i < shape.GetDimNum(); i++) { |
| @@ -374,7 +374,7 @@ private: | |||
| 374 | tensorNum_ += arg->Size() + 1; | 374 | tensorNum_ += arg->Size() + 1; |
| 375 | dfxInfoDumpElemCount_++; | 375 | dfxInfoDumpElemCount_++; |
| 376 | #ifdef DEBUG | 376 | #ifdef DEBUG |
| 377 | - OP_LOGD("Append output DEVICE ptr: size %ld, dataSize %ld", arg->Size(), dataSize); | 377 | + OP_LOGD("Append output DEVICE ptr: tensor num: %lu, dataSize: %zu B", arg->Size(), dataSize); |
| 378 | #endif | 378 | #endif |
| 379 | return; | 379 | return; |
| 380 | } | 380 | } |
| @@ -993,7 +993,7 @@ void* OpExecCache::AddLaunchData(size_t dataLen) | |||
| 993 | // if cache buf not enough, abandon cache. | 993 | // if cache buf not enough, abandon cache. |
| 994 | if (cacheOffset_ + dataLen > cacheCap_) { | 994 | if (cacheOffset_ + dataLen > cacheCap_) { |
| 995 | MarkOpCacheInvalid(); | 995 | MarkOpCacheInvalid(); |
| 996 | - OP_LOGW("cache buf has full, abandon current cache."); | 996 | + OP_LOGW("cache buf is full, abandon current cache."); |
| 997 | if (dataLen > cacheCap_) { | 997 | if (dataLen > cacheCap_) { |
| 998 | OP_LOGW("cache buf cap is not enough for once cache data!"); | 998 | OP_LOGW("cache buf cap is not enough for once cache data!"); |
| 999 | } | 999 | } |
| @@ -123,7 +123,7 @@ aclnnStatus InitPcieThroughInfo() | |||
| 123 | g_pcieThroughEnabled = false; | 123 | g_pcieThroughEnabled = false; |
| 124 | NpuArch npuArch = GetCurrentPlatformInfo().GetCurNpuArch(); | 124 | NpuArch npuArch = GetCurrentPlatformInfo().GetCurNpuArch(); |
| 125 | if (npuArch != NpuArch::DAV_3510 && npuArch != NpuArch::DAV_9201 && npuArch != NpuArch::DAV_9202) { | 125 | if (npuArch != NpuArch::DAV_3510 && npuArch != NpuArch::DAV_9201 && npuArch != NpuArch::DAV_9202) { |
| 126 | - OP_LOGI("Current NPU arch [%u] not support PCIe through.", static_cast<uint32_t>(npuArch)); | 126 | + OP_LOGI("Current NPU arch [%u] does not support PCIe through.", static_cast<uint32_t>(npuArch)); |
| 127 | return; | 127 | return; |
| 128 | } | 128 | } |
| 129 | 129 | ||
| @@ -43,7 +43,8 @@ protected: | |||
| 43 | 43 | ||
| 44 | aclnnStatus VisitOutputArgs(OpArgList& argList) | 44 | aclnnStatus VisitOutputArgs(OpArgList& argList) |
| 45 | { | 45 | { |
| 46 | - CHECK_COND(argList.count == DSA_TASK_OUTPUT_NUM, ACLNN_ERR_INNER, "output arg num must be 1."); | 46 | + CHECK_COND(argList.count == DSA_TASK_OUTPUT_NUM, ACLNN_ERR_INNER, "output arg num must be 1, but got %zu.", |
| 47 | + argList.count); | ||
| 47 | return VisitOutputArg(reinterpret_cast<aclTensor*>(argList[0]->pointer)); | 48 | return VisitOutputArg(reinterpret_cast<aclTensor*>(argList[0]->pointer)); |
| 48 | } | 49 | } |
| 49 | 50 | ||
| @@ -186,7 +187,7 @@ private: | |||
| 186 | } else if (idx == idxStd) { | 187 | } else if (idx == idxStd) { |
| 187 | const auto rc = memcpy_s(&workspaceHolder_[IDX_PARAM1], sizeof(uint64_t), arg->GetData(), arg->Size()); | 188 | const auto rc = memcpy_s(&workspaceHolder_[IDX_PARAM1], sizeof(uint64_t), arg->GetData(), arg->Size()); |
| 188 | if (rc != EOK) { | 189 | if (rc != EOK) { |
| 189 | - OP_LOGE(ACLNN_ERR_INNER, "memcpy first input arg fail."); | 190 | + OP_LOGE(ACLNN_ERR_INNER, "memcpy second input arg (std) failed."); |
| 190 | return ACLNN_ERR_INNER; | 191 | return ACLNN_ERR_INNER; |
| 191 | } | 192 | } |
| 192 | 193 | ||
| @@ -217,7 +218,7 @@ private: | |||
| 217 | aclnnStatus VisitInputArgs(OpArgList& argList) | 218 | aclnnStatus VisitInputArgs(OpArgList& argList) |
| 218 | { | 219 | { |
| 219 | CHECK_COND(argList.count == DSA_TASK_INPUT_NUM, ACLNN_ERR_INNER, | 220 | CHECK_COND(argList.count == DSA_TASK_INPUT_NUM, ACLNN_ERR_INNER, |
| 220 | - "DSARandomNormal or DSARandomTruncatedNormal input arg num must be 5."); | 221 | + "DSARandomNormal or DSARandomTruncatedNormal input arg num must be 5, but got %zu.", argList.count); |
| 221 | return argList.VisitBy([this](size_t idx, OpArg& arg) -> aclnnStatus { return VisitInputArg(idx, arg); }); | 222 | return argList.VisitBy([this](size_t idx, OpArg& arg) -> aclnnStatus { return VisitInputArg(idx, arg); }); |
| 222 | } | 223 | } |
| 223 | }; | 224 | }; |
| @@ -324,7 +325,7 @@ private: | |||
| 324 | } else if (idx == idxMax) { | 325 | } else if (idx == idxMax) { |
| 325 | const auto rc = memcpy_s(&workspaceHolder_[IDX_PARAM1], sizeof(uint64_t), arg->GetData(), arg->Size()); | 326 | const auto rc = memcpy_s(&workspaceHolder_[IDX_PARAM1], sizeof(uint64_t), arg->GetData(), arg->Size()); |
| 326 | if (rc != EOK) { | 327 | if (rc != EOK) { |
| 327 | - OP_LOGE(ACLNN_ERR_INNER, "memcpy first input arg fail."); | 328 | + OP_LOGE(ACLNN_ERR_INNER, "memcpy second input arg (max) failed."); |
| 328 | return ACLNN_ERR_INNER; | 329 | return ACLNN_ERR_INNER; |
| 329 | } | 330 | } |
| 330 | memcpy_s(randomNumTaskInfo_.randomNumFuncParaInfo.paramInfo.uniformDisInfo.max.valueOrAddr, arg->Size(), | 331 | memcpy_s(randomNumTaskInfo_.randomNumFuncParaInfo.paramInfo.uniformDisInfo.max.valueOrAddr, arg->Size(), |
| @@ -355,7 +356,7 @@ private: | |||
| 355 | aclnnStatus VisitInputArgs(OpArgList& argList) | 356 | aclnnStatus VisitInputArgs(OpArgList& argList) |
| 356 | { | 357 | { |
| 357 | CHECK_COND(argList.count == DSA_TASK_INPUT_NUM, ACLNN_ERR_INNER, | 358 | CHECK_COND(argList.count == DSA_TASK_INPUT_NUM, ACLNN_ERR_INNER, |
| 358 | - "DSARandomUniformTask input arg num must be 5."); | 359 | + "DSARandomUniformTask input arg num must be 5, but got %zu.", argList.count); |
| 359 | return argList.VisitBy([this](size_t idx, OpArg& arg) -> aclnnStatus { return VisitInputArg(idx, arg); }); | 360 | return argList.VisitBy([this](size_t idx, OpArg& arg) -> aclnnStatus { return VisitInputArg(idx, arg); }); |
| 360 | } | 361 | } |
| 361 | }; | 362 | }; |
| @@ -468,7 +469,7 @@ private: | |||
| 468 | aclnnStatus VisitInputArgs(OpArgList& argList) | 469 | aclnnStatus VisitInputArgs(OpArgList& argList) |
| 469 | { | 470 | { |
| 470 | CHECK_COND(argList.count == DSA_GENBIT_TASK_INPUT_NUM, ACLNN_ERR_INNER, | 471 | CHECK_COND(argList.count == DSA_GENBIT_TASK_INPUT_NUM, ACLNN_ERR_INNER, |
| 471 | - "DSARandomUniformTask input arg num must be 4."); | 472 | + "DSAGenBitMaskTask input arg num must be 4, but got %zu.", argList.count); |
| 472 | return argList.VisitBy([this](size_t idx, OpArg& arg) -> aclnnStatus { return VisitInputArg(idx, arg); }); | 473 | return argList.VisitBy([this](size_t idx, OpArg& arg) -> aclnnStatus { return VisitInputArg(idx, arg); }); |
| 473 | } | 474 | } |
| 474 | 475 | ||
| @@ -480,7 +481,8 @@ private: | |||
| 480 | 481 | ||
| 481 | aclnnStatus VisitOutputArgs(OpArgList& argList) | 482 | aclnnStatus VisitOutputArgs(OpArgList& argList) |
| 482 | { | 483 | { |
| 483 | - CHECK_COND(argList.count == DSA_TASK_OUTPUT_NUM, ACLNN_ERR_INNER, "output arg num must be 1."); | 484 | + CHECK_COND(argList.count == DSA_TASK_OUTPUT_NUM, ACLNN_ERR_INNER, "output arg num must be 1, but got %zu.", |
| 485 | + argList.count); | ||
| 484 | return VisitOutputArg(reinterpret_cast<aclTensor*>(argList[0]->pointer)); | 486 | return VisitOutputArg(reinterpret_cast<aclTensor*>(argList[0]->pointer)); |
| 485 | } | 487 | } |
| 486 | }; | 488 | }; |
| @@ -52,7 +52,7 @@ public: | |||
| 52 | CHECK_RET_CODE(input.VisitBy([this](size_t idx, OpArg& arg) { return UpdateInputArg(idx, arg); }), | 52 | CHECK_RET_CODE(input.VisitBy([this](size_t idx, OpArg& arg) { return UpdateInputArg(idx, arg); }), |
| 53 | "UpdateInputArg failed."); | 53 | "UpdateInputArg failed."); |
| 54 | CHECK_RET_CODE(output.VisitBy([this](size_t idx, OpArg& arg) { return UpdateOutputArg(idx, arg); }), | 54 | CHECK_RET_CODE(output.VisitBy([this](size_t idx, OpArg& arg) { return UpdateOutputArg(idx, arg); }), |
| 55 | - "UpdateInputArg failed."); | 55 | + "UpdateOutputArg failed."); |
| 56 | FinalizeComputeNodeInfo(attr.count); | 56 | FinalizeComputeNodeInfo(attr.count); |
| 57 | void* attrPtr = attrDataStart_; | 57 | void* attrPtr = attrDataStart_; |
| 58 | CHECK_RET_CODE( | 58 | CHECK_RET_CODE( |
| @@ -99,7 +99,8 @@ aclnnStatus KernelMgr::LoadStaticBinJson() | |||
| 99 | staticBinAndJsonDir_.append(STATIC_BIN_AND_JSON_DIR_PATH); | 99 | staticBinAndJsonDir_.append(STATIC_BIN_AND_JSON_DIR_PATH); |
| 100 | std::string realConfigJsonPath = RealPath(configJsonPath); | 100 | std::string realConfigJsonPath = RealPath(configJsonPath); |
| 101 | OP_CHECK(!realConfigJsonPath.empty(), | 101 | OP_CHECK(!realConfigJsonPath.empty(), |
| 102 | - OP_LOGW("static kernel config json is not exist, path: %s", configJsonPath.c_str()), return ACLNN_SUCCESS); | 102 | + OP_LOGW("static kernel config json does not exist, path: %s", configJsonPath.c_str()), |
| 103 | + return ACLNN_SUCCESS); | ||
| 103 | ifstream f(realConfigJsonPath); | 104 | ifstream f(realConfigJsonPath); |
| 104 | try { | 105 | try { |
| 105 | staticConfigJson_ = nlohmann::json::parse(f); | 106 | staticConfigJson_ = nlohmann::json::parse(f); |
| @@ -93,7 +93,7 @@ public: | |||
| 93 | OP_CHECK(ret == ACL_SUCCESS, OP_LOGW("failed to call aclrtMallocWithCfg, ret %d", ret), return ACLNN_ERR_INNER); | 93 | OP_CHECK(ret == ACL_SUCCESS, OP_LOGW("failed to call aclrtMallocWithCfg, ret %d", ret), return ACLNN_ERR_INNER); |
| 94 | 94 | ||
| 95 | workspaceTensor->SetStorageAddr(wsAddr); | 95 | workspaceTensor->SetStorageAddr(wsAddr); |
| 96 | - OP_LOGD("create non finite check op workspace size %zu", workspaceSize[0]); | 96 | + OP_LOGD("create non finite check op workspace size %zu bytes", workspaceSize[0]); |
| 97 | return ACLNN_SUCCESS; | 97 | return ACLNN_SUCCESS; |
| 98 | } | 98 | } |
| 99 | 99 | ||
| @@ -184,7 +184,7 @@ struct NonFiniteCheckTensorList { | |||
| 184 | OP_LOGD("tensor dimNum %zu", dimNum); | 184 | OP_LOGD("tensor dimNum %zu", dimNum); |
| 185 | size_ += sizeof(int64_t); // ptr | 185 | size_ += sizeof(int64_t); // ptr |
| 186 | } | 186 | } |
| 187 | - OP_LOGD("size %zu ptrOffset %zu", size_, ptrOffset_); | 187 | + OP_LOGD("size %zu bytes, ptrOffset %zu bytes", size_, ptrOffset_); |
| 188 | } | 188 | } |
| 189 | 189 | ||
| 190 | aclnnStatus Init(std::vector<aclTensor*>& checkTensors) | 190 | aclnnStatus Init(std::vector<aclTensor*>& checkTensors) |
| @@ -274,11 +274,11 @@ public: | |||
| 274 | return ret); | 274 | return ret); |
| 275 | 275 | ||
| 276 | auto rc = aclrtSynchronizeStream(nonFiniteCheckOpCtx.stream_); | 276 | auto rc = aclrtSynchronizeStream(nonFiniteCheckOpCtx.stream_); |
| 277 | - OP_CHECK(rc == ACL_SUCCESS, OP_LOGW("aclrtSynchronizeStream failed, ret %d", ret), return ACLNN_ERR_INNER); | 277 | + OP_CHECK(rc == ACL_SUCCESS, OP_LOGW("aclrtSynchronizeStream failed, ret %d", rc), return ACLNN_ERR_INNER); |
| 278 | 278 | ||
| 279 | float status = 0; | 279 | float status = 0; |
| 280 | rc = aclrtMemcpy(&status, sizeof(float), outputAddr, sizeof(float), ACL_MEMCPY_DEVICE_TO_HOST); | 280 | rc = aclrtMemcpy(&status, sizeof(float), outputAddr, sizeof(float), ACL_MEMCPY_DEVICE_TO_HOST); |
| 281 | - OP_CHECK(rc == ACL_SUCCESS, OP_LOGW("aclrtMemcpy failed, ret %d", ret), return ACLNN_ERR_INNER); | 281 | + OP_CHECK(rc == ACL_SUCCESS, OP_LOGW("aclrtMemcpy failed, ret %d", rc), return ACLNN_ERR_INNER); |
| 282 | OP_LOGD("non finite check status %f", status); | 282 | OP_LOGD("non finite check status %f", status); |
| 283 | if (static_cast<int>(status) == 1) { | 283 | if (static_cast<int>(status) == 1) { |
| 284 | dump = true; | 284 | dump = true; |
| @@ -1185,7 +1185,7 @@ static bool IsSaturationOverflow(aclrtStream stream) | |||
| 1185 | CHECK_COND(ret == ACL_SUCCESS, false, "aclrtNpuGetFloatOverFlowStatus failed, ret %d", ret); | 1185 | CHECK_COND(ret == ACL_SUCCESS, false, "aclrtNpuGetFloatOverFlowStatus failed, ret %d", ret); |
| 1186 | 1186 | ||
| 1187 | auto rc = aclrtSynchronizeStream(stream); | 1187 | auto rc = aclrtSynchronizeStream(stream); |
| 1188 | - OP_CHECK(rc == ACL_SUCCESS, OP_LOGW("aclrtSynchronizeStream failed, ret %d", ret), return ACLNN_ERR_INNER); | 1188 | + OP_CHECK(rc == ACL_SUCCESS, OP_LOGW("aclrtSynchronizeStream failed, ret %d", rc), return ACLNN_ERR_INNER); |
| 1189 | 1189 | ||
| 1190 | uint8_t status = 0; | 1190 | uint8_t status = 0; |
| 1191 | ret = aclrtMemcpy(&status, sizeof(uint8_t), ValueToPtr(realAddr), sizeof(uint8_t), ACL_MEMCPY_DEVICE_TO_HOST); | 1191 | ret = aclrtMemcpy(&status, sizeof(uint8_t), ValueToPtr(realAddr), sizeof(uint8_t), ACL_MEMCPY_DEVICE_TO_HOST); |
| @@ -703,7 +703,9 @@ aclTensor* aclOpExecutor::CreateView(const aclTensor* tensor, const op::Shape& o | |||
| 703 | } | 703 | } |
| 704 | int64_t actualShapeLen = storageSize - offset; | 704 | int64_t actualShapeLen = storageSize - offset; |
| 705 | OP_CHECK((actualShapeLen >= 0 && actualShapeLen <= storageSize), | 705 | OP_CHECK((actualShapeLen >= 0 && actualShapeLen <= storageSize), |
| 706 | - OP_LOGE(ACLNN_ERR_INNER, "The tensor's offset is invalid with the specified storageShape"), | 706 | + OP_LOGE(ACLNN_ERR_INNER, |
| 707 | + "The tensor's offset %ld is invalid, storage size is %ld, offset must be in [0, %ld].", | ||
| 708 | + offset, storageSize, storageSize), | ||
| 707 | return nullptr;); | 709 | return nullptr;); |
| 708 | // 在非连续场景下,传入tiling的storageshape会被oom用来计算合法内存大小,aclnn在下发时会将gm地址加上offset偏移,此时算子合法内存大小应为原始内存大小减offset | 710 | // 在非连续场景下,传入tiling的storageshape会被oom用来计算合法内存大小,aclnn在下发时会将gm地址加上offset偏移,此时算子合法内存大小应为原始内存大小减offset |
| 709 | storageShapeCorrect.SetDim(0, actualShapeLen); | 711 | storageShapeCorrect.SetDim(0, actualShapeLen); |
| @@ -892,7 +894,7 @@ uint64_t aclOpExecutor::GetMagicNumber() { return magicNumber_; } | |||
| 892 | UniqueExecutor::UniqueExecutor(const char* funcName) : funcName_(funcName), uniqueExecutor_(new aclOpExecutor()) | 894 | UniqueExecutor::UniqueExecutor(const char* funcName) : funcName_(funcName), uniqueExecutor_(new aclOpExecutor()) |
| 893 | { | 895 | { |
| 894 | OP_LOGI("Create executor: %p", uniqueExecutor_.get()); | 896 | OP_LOGI("Create executor: %p", uniqueExecutor_.get()); |
| 895 | - OP_CHECK(uniqueExecutor_ != nullptr, OP_LOGE(ACLNN_ERR_INNER, "executor constructed failed."), | 897 | + OP_CHECK(uniqueExecutor_ != nullptr, OP_LOGE(ACLNN_ERR_INNER, "failed to construct executor."), |
| 896 | throw std::bad_alloc()); | 898 | throw std::bad_alloc()); |
| 897 | auto& threadLocalCtx = op::internal::GetThreadLocalContext(); | 899 | auto& threadLocalCtx = op::internal::GetThreadLocalContext(); |
| 898 | uniqueExecutor_->SetLogInfo(threadLocalCtx.logInfo_); | 900 | uniqueExecutor_->SetLogInfo(threadLocalCtx.logInfo_); |
| @@ -1143,7 +1143,8 @@ aclnnStatus OpKernel::HashAndInsert(const string& binAndJsonDir, const string& b | |||
| 1143 | auto binsIter = bins_.find(hash); | 1143 | auto binsIter = bins_.find(hash); |
| 1144 | if (binsIter != bins_.end()) { | 1144 | if (binsIter != bins_.end()) { |
| 1145 | if (key.key != binsIter->second->GetKeyAndDetail().key) { | 1145 | if (key.key != binsIter->second->GetKeyAndDetail().key) { |
| 1146 | - OP_LOGE(ACLNN_ERR_INNER, "Two bin [%s & %s] has same hash but their integral key is diff[%s, %s].", | 1146 | + OP_LOGE(ACLNN_ERR_INNER, |
| 1147 | + "Two bins [%s & %s] have the same hash but their integral keys differ [%s, %s].", | ||
| 1147 | binOrJsonPath.c_str(), binsIter->second->jsonPath_.c_str(), | 1148 | binOrJsonPath.c_str(), binsIter->second->jsonPath_.c_str(), |
| 1148 | GetReadableKey(key.key, keyParams.len).c_str(), | 1149 | GetReadableKey(key.key, keyParams.len).c_str(), |
| 1149 | GetReadableKey(binsIter->second->GetKeyAndDetail().key, keyParams.len).c_str()); | 1150 | GetReadableKey(binsIter->second->GetKeyAndDetail().key, keyParams.len).c_str()); |
| @@ -1153,7 +1154,7 @@ aclnnStatus OpKernel::HashAndInsert(const string& binAndJsonDir, const string& b | |||
| 1153 | binsIter->second->SetJsonPath(jsonPath); | 1154 | binsIter->second->SetJsonPath(jsonPath); |
| 1154 | binsIter->second->SetBinPath(binPath); | 1155 | binsIter->second->SetBinPath(binPath); |
| 1155 | } else { | 1156 | } else { |
| 1156 | - OP_LOGW("Two different bin [%s & %s] has same integral key %s.", binOrJsonPath.c_str(), | 1157 | + OP_LOGW("Two different bins [%s & %s] have the same integral key %s.", binOrJsonPath.c_str(), |
| 1157 | binsIter->second->jsonPath_.c_str(), GetReadableKey(key.key, keyParams.len).c_str()); | 1158 | binsIter->second->jsonPath_.c_str(), GetReadableKey(key.key, keyParams.len).c_str()); |
| 1158 | continue; | 1159 | continue; |
| 1159 | } | 1160 | } |
| @@ -1220,7 +1221,7 @@ void HandleAttrValue(const nlohmann::json& value, AttrInfo& attrInfo) | |||
| 1220 | OP_LOGD("Float attr [%s] need to be compared.", attrInfo.attrName.c_str()); | 1221 | OP_LOGD("Float attr [%s] need to be compared.", attrInfo.attrName.c_str()); |
| 1221 | attrInfo.supportAll = false; | 1222 | attrInfo.supportAll = false; |
| 1222 | } else { | 1223 | } else { |
| 1223 | - OP_LOGD("Float attr [%s] currently do not need to be compared.", attrInfo.attrName.c_str()); | 1224 | + OP_LOGD("Float attr [%s] currently does not need to be compared.", attrInfo.attrName.c_str()); |
| 1224 | } | 1225 | } |
| 1225 | } else if (value.is_number()) { | 1226 | } else if (value.is_number()) { |
| 1226 | int64_t valueInt64 = value.get<int64_t>(); | 1227 | int64_t valueInt64 = value.get<int64_t>(); |
| @@ -1231,14 +1232,14 @@ void HandleAttrValue(const nlohmann::json& value, AttrInfo& attrInfo) | |||
| 1231 | OP_LOGD("Int64 attr [%s] need to be compared.", attrInfo.attrName.c_str()); | 1232 | OP_LOGD("Int64 attr [%s] need to be compared.", attrInfo.attrName.c_str()); |
| 1232 | attrInfo.supportAll = false; | 1233 | attrInfo.supportAll = false; |
| 1233 | } else { | 1234 | } else { |
| 1234 | - OP_LOGD("Int64 attr [%s] currently do not need to be compared.", attrInfo.attrName.c_str()); | 1235 | + OP_LOGD("Int64 attr [%s] currently does not need to be compared.", attrInfo.attrName.c_str()); |
| 1235 | } | 1236 | } |
| 1236 | } else if (value.is_array()) { | 1237 | } else if (value.is_array()) { |
| 1237 | if (attrInfo.values[0] != value.size()) { | 1238 | if (attrInfo.values[0] != value.size()) { |
| 1238 | OP_LOGD("Int64 attr [%s] need to be compared.", attrInfo.attrName.c_str()); | 1239 | OP_LOGD("Int64 attr [%s] need to be compared.", attrInfo.attrName.c_str()); |
| 1239 | attrInfo.supportAll = false; | 1240 | attrInfo.supportAll = false; |
| 1240 | } else { | 1241 | } else { |
| 1241 | - OP_LOGD("Int64 attr [%s] currently do not need to be compared.", attrInfo.attrName.c_str()); | 1242 | + OP_LOGD("Int64 attr [%s] currently does not need to be compared.", attrInfo.attrName.c_str()); |
| 1242 | } | 1243 | } |
| 1243 | } | 1244 | } |
| 1244 | return; | 1245 | return; |
| @@ -1266,7 +1267,9 @@ aclnnStatus OpKernel::JudgeInputSupportAll(const nlohmann::json& binListJson) | |||
| 1266 | for (const auto& input : *inputsIter) { | 1267 | for (const auto& input : *inputsIter) { |
| 1267 | ++inputsCnt; | 1268 | ++inputsCnt; |
| 1268 | if (inputsCnt >= static_cast<int64_t>(inputInfos_.size())) { | 1269 | if (inputsCnt >= static_cast<int64_t>(inputInfos_.size())) { |
| 1269 | - OP_LOGE(ACLNN_ERR_INNER_INPUT_NUM_IN_JSON_TOO_LARGE, "%ld is too large", inputsCnt); | 1270 | + OP_LOGE(ACLNN_ERR_INNER_INPUT_NUM_IN_JSON_TOO_LARGE, |
| 1271 | + "Input num %ld in json is too large, max supported input num is %zu.", inputsCnt, | ||
| 1272 | + inputInfos_.size()); | ||
| 1270 | return ACLNN_ERR_INNER_INPUT_NUM_IN_JSON_TOO_LARGE; | 1273 | return ACLNN_ERR_INNER_INPUT_NUM_IN_JSON_TOO_LARGE; |
| 1271 | } | 1274 | } |
| 1272 | auto& inputInfo = inputInfos_[inputsCnt]; | 1275 | auto& inputInfo = inputInfos_[inputsCnt]; |
| @@ -192,7 +192,7 @@ aclnnStatus CopyNpuToNpu(const aclTensor* src, const aclTensor* dst, aclOpExecut | |||
| 192 | OP_LOGE(ACLNN_ERR_INNER, "Get input param's placement:%d when expect kOnDeviceHbm.", src->GetPlacement()), | 192 | OP_LOGE(ACLNN_ERR_INNER, "Get input param's placement:%d when expect kOnDeviceHbm.", src->GetPlacement()), |
| 193 | return ACLNN_ERR_INNER); | 193 | return ACLNN_ERR_INNER); |
| 194 | OP_CHECK(dst->GetPlacement() == op::TensorPlacement::kOnDeviceHbm, | 194 | OP_CHECK(dst->GetPlacement() == op::TensorPlacement::kOnDeviceHbm, |
| 195 | - OP_LOGE(ACLNN_ERR_INNER, "Get out param's placement:%d when expect kOnDeviceHbm.", src->GetPlacement()), | 195 | + OP_LOGE(ACLNN_ERR_INNER, "Get out param's placement:%d when expect kOnDeviceHbm.", dst->GetPlacement()), |
| 196 | return ACLNN_ERR_INNER); | 196 | return ACLNN_ERR_INNER); |
| 197 | 197 | ||
| 198 | op::internal::ProfilingInfoId profilingInfoId; | 198 | op::internal::ProfilingInfoId profilingInfoId; |
| @@ -206,7 +206,7 @@ void ReportErrorMessageInner(const std::string& code, const char* fmt, ...) | |||
| 206 | va_start(argList, fmt); | 206 | va_start(argList, fmt); |
| 207 | auto ret = vsnprintf_s(buf.data(), LIMIT_PREDEFINED_MESSAGE, LIMIT_PREDEFINED_MESSAGE - 1U, fmt, argList); | 207 | auto ret = vsnprintf_s(buf.data(), LIMIT_PREDEFINED_MESSAGE, LIMIT_PREDEFINED_MESSAGE - 1U, fmt, argList); |
| 208 | if (ret == -1) { | 208 | if (ret == -1) { |
| 209 | - OP_LOGW("Construct report error message fail, maybe the length of error message exceeds limits: %zu", | 209 | + OP_LOGW("Construct report error message failed, maybe the length of error message exceeds limits: %zu", |
| 210 | LIMIT_PREDEFINED_MESSAGE); | 210 | LIMIT_PREDEFINED_MESSAGE); |
| 211 | } | 211 | } |
| 212 | va_end(argList); | 212 | va_end(argList); |
| @@ -41,7 +41,8 @@ void TensorBucket::UpdateOffset(const uint64_t offset) | |||
| 41 | for (const auto ref : refs_) { | 41 | for (const auto ref : refs_) { |
| 42 | ref->SetOffset(offset_); | 42 | ref->SetOffset(offset_); |
| 43 | OP_LOGI( | 43 | OP_LOGI( |
| 44 | - "MaxAllocator tensor index: %zu, offset: %lu, lifetime: [%ld, %ld], original size: %ld, align size: %lu.", | 44 | + "MaxAllocator tensor index: %zu, offset: %lu B, lifetime: [%ld, %ld], original size: %ld B, " |
| 45 | + "align size: %lu B.", | ||
| 45 | ref->GetIndex(), offset_, ref->GetLifeTimeStart(), ref->GetLifeTimeEnd(), ref->GetSize(), | 46 | ref->GetIndex(), offset_, ref->GetLifeTimeStart(), ref->GetLifeTimeEnd(), ref->GetSize(), |
| 46 | Align(ref->GetSize())); | 47 | Align(ref->GetSize())); |
| 47 | } | 48 | } |
| @@ -361,7 +361,7 @@ const PlatformInfo& PlatformThreadLocalCtx::GetPlatformInfo() | |||
| 361 | int32_t deviceId; | 361 | int32_t deviceId; |
| 362 | auto ret = aclrtGetDevice(&deviceId); | 362 | auto ret = aclrtGetDevice(&deviceId); |
| 363 | OP_CHECK(ret == ACL_SUCCESS, | 363 | OP_CHECK(ret == ACL_SUCCESS, |
| 364 | - OP_LOGE(ACLNN_ERR_RUNTIME_ERROR, "Get device id failed when do GetCurrentPlatformInfo."), | 364 | + OP_LOGE(ACLNN_ERR_RUNTIME_ERROR, "Get device id failed when doing GetCurrentPlatformInfo."), |
| 365 | return invalidPlatform_); | 365 | return invalidPlatform_); |
| 366 | while (platformInfoList_.size() <= static_cast<size_t>(deviceId)) { | 366 | while (platformInfoList_.size() <= static_cast<size_t>(deviceId)) { |
| 367 | PlatformInfo* info = new PlatformInfo(platformInfoList_.size()); | 367 | PlatformInfo* info = new PlatformInfo(platformInfoList_.size()); |
| @@ -456,7 +456,7 @@ class H2CC(object): | |||
| 456 | self.line_index += 1 | 456 | self.line_index += 1 |
| 457 | self.write_specified_template() | 457 | self.write_specified_template() |
| 458 | logging.info('Added %s functions', len(self.func_list_exist)) | 458 | logging.info('Added %s functions', len(self.func_list_exist)) |
| 459 | - logging.info('Successfully converted,please see ' + self.output_file) | 459 | + logging.info('Successfully converted, please see ' + self.output_file) |
| 460 | 460 | ||
| 461 | def handle_func1(self, line, template_string=''): | 461 | def handle_func1(self, line, template_string=''): |
| 462 | """ | 462 | """ |