已合并
fused_cross_entropy_loss_with_max_sum与threshold 文档修复 #3894
sakuraqqz创建于 4月16日
fused_cross_entropy_loss_with_max_sum与threshold 文档修复 #3894
已合并
共 2 个文件变更+6-2
| @@ -368,6 +368,7 @@ aclnnStatus aclnnInplaceThreshold( | |||
| 368 | 368 | ||
| 369 | - 确定性计算: | 369 | - 确定性计算: |
| 370 | - aclnnThreshold&aclnnInplaceThreshold默认确定性实现。 | 370 | - aclnnThreshold&aclnnInplaceThreshold默认确定性实现。 |
| 371 | +- 当输入是INT32类型时,数值不在[-16777216, 16777216]范围内,会存在精度误差。 | ||
| 371 | 372 | ||
| 372 | ## 调用示例 | 373 | ## 调用示例 |
| 373 | 374 | ||
| @@ -39,12 +39,15 @@ static const std::initializer_list<DataType> DTYPE_SUPPORT_LIST_VOCAB = { | |||
| 39 | 39 | ||
| 40 | static inline bool CheckNotNull( | 40 | static inline bool CheckNotNull( |
| 41 | const aclTensor* logitsMax, const aclTensor* sumExpLogits, const aclTensor* predictedLogits, | 41 | const aclTensor* logitsMax, const aclTensor* sumExpLogits, const aclTensor* predictedLogits, |
| 42 | - const aclTensor* lossOut) | 42 | + const aclTensor* lossOut, const aclTensor* vocabParallelLogitsOptional, const aclTensor* softMaxOutOptional) |
| 43 | { | 43 | { |
| 44 | OP_CHECK_NULL(logitsMax, return false); | 44 | OP_CHECK_NULL(logitsMax, return false); |
| 45 | OP_CHECK_NULL(sumExpLogits, return false); | 45 | OP_CHECK_NULL(sumExpLogits, return false); |
| 46 | OP_CHECK_NULL(predictedLogits, return false); | 46 | OP_CHECK_NULL(predictedLogits, return false); |
| 47 | OP_CHECK_NULL(lossOut, return false); | 47 | OP_CHECK_NULL(lossOut, return false); |
| 48 | + if (vocabParallelLogitsOptional != nullptr) { | ||
| 49 | + OP_CHECK_NULL(softMaxOutOptional, return false); | ||
| 50 | + } | ||
| 48 | return true; | 51 | return true; |
| 49 | } | 52 | } |
| 50 | 53 | ||
| @@ -92,7 +95,7 @@ static aclnnStatus CheckParams( | |||
| 92 | { | 95 | { |
| 93 | // 错误码等DFX方案细化后刷新,错误日志在check接口内打印 | 96 | // 错误码等DFX方案细化后刷新,错误日志在check接口内打印 |
| 94 | // 1. 检查参数是否为空指针 | 97 | // 1. 检查参数是否为空指针 |
| 95 | - CHECK_RET(CheckNotNull(logitsMax, sumExpLogits, predictedLogits, lossOut), ACLNN_ERR_PARAM_NULLPTR); | 98 | + CHECK_RET(CheckNotNull(logitsMax, sumExpLogits, predictedLogits, lossOut, vocabParallelLogitsOptional, softMaxOutOptional), ACLNN_ERR_PARAM_NULLPTR); |
| 96 | 99 | ||
| 97 | // 2. 检查输入的数据类型是否在API支持的数据类型范围之内,需要根据api定义校验 | 100 | // 2. 检查输入的数据类型是否在API支持的数据类型范围之内,需要根据api定义校验 |
| 98 | CHECK_RET( | 101 | CHECK_RET( |