已合并
feat(operation): Support int64/uint64 for vector operations #5572
junnyleo创建于 8月20日
feat(operation): Support int64/uint64 for vector operations #5572
已合并
共 98 个文件变更+864-205
| @@ -43,7 +43,7 @@ add(input: Tensor, other: Union[Tensor, float, int]) -> Tensor | |||
| 43 | 2. other为scalar时,若input为浮点类型,则scalar支持整型(自动转为浮点);若input为整型,则scalar不支持浮点类型(会报错)。 | 43 | 2. other为scalar时,若input为浮点类型,则scalar支持整型(自动转为浮点);若input为整型,则scalar不支持浮点类型(会报错)。 |
| 44 | 3. Tensor数据类型说明: | 44 | 3. Tensor数据类型说明: |
| 45 | <!-- npu="950" id4 --> | 45 | <!-- npu="950" id4 --> |
| 46 | - - Ascend 950PR/Ascend 950DT:DT_INT32,DT_FP32,DT_INT16,DT_FP16,DT_BF16,DT_UINT8,DT_INT8。 | 46 | + - Ascend 950PR/Ascend 950DT:DT_INT32,DT_FP32,DT_INT16,DT_FP16,DT_BF16,DT_UINT8,DT_INT8,DT_INT64,DT_UINT64。 |
| 47 | <!-- end id4 --> | 47 | <!-- end id4 --> |
| 48 | <!-- npu="A3" id5 --> | 48 | <!-- npu="A3" id5 --> |
| 49 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_INT32,DT_INT16,DT_FP16,DT_FP32,DT_BF16。 | 49 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_INT32,DT_INT16,DT_FP16,DT_FP32,DT_BF16。 |
| @@ -52,7 +52,7 @@ amax(input: Tensor, dim: int, keepdim: bool = False) -> Tensor | |||
| 52 | 52 | ||
| 53 | 2. Tensor数据类型说明: | 53 | 2. Tensor数据类型说明: |
| 54 | <!-- npu="950" id4 --> | 54 | <!-- npu="950" id4 --> |
| 55 | - - Ascend 950PR/Ascend 950DT:DT_FP16,DT_BF16,DT_FP32,DT_INT32,DT_INT16,DT_UINT8,DT_INT8 | 55 | + - Ascend 950PR/Ascend 950DT:DT_FP16,DT_BF16,DT_FP32,DT_INT32,DT_INT16,DT_UINT8,DT_INT8,DT_INT64,DT_UINT64 |
| 56 | <!-- end id4 --> | 56 | <!-- end id4 --> |
| 57 | <!-- npu="A3" id5 --> | 57 | <!-- npu="A3" id5 --> |
| 58 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP16,DT_BF16,DT_FP32,DT_INT32,DT_INT16 | 58 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP16,DT_BF16,DT_FP32,DT_INT32,DT_INT16 |
| @@ -52,7 +52,7 @@ amin(input: Tensor, dim: int, keepdim: bool = False) -> Tensor | |||
| 52 | 52 | ||
| 53 | 2. Tensor数据类型说明: | 53 | 2. Tensor数据类型说明: |
| 54 | <!-- npu="950" id4 --> | 54 | <!-- npu="950" id4 --> |
| 55 | - - Ascend 950PR/Ascend 950DT:DT_FP16,DT_BF16,DT_FP32,DT_INT32,DT_INT16,DT_UINT8,DT_INT8 | 55 | + - Ascend 950PR/Ascend 950DT:DT_FP16,DT_BF16,DT_FP32,DT_INT32,DT_INT16,DT_UINT8,DT_INT8,DT_INT64,DT_UINT64 |
| 56 | <!-- end id4 --> | 56 | <!-- end id4 --> |
| 57 | <!-- npu="A3" id5 --> | 57 | <!-- npu="A3" id5 --> |
| 58 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP16,DT_BF16,DT_FP32,DT_INT32,DT_INT16 | 58 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP16,DT_BF16,DT_FP32,DT_INT32,DT_INT16 |
| @@ -26,13 +26,13 @@ arange(start: Union[int, float] = 0, end: Union[int, float], step: Union[int, fl | |||
| 26 | 26 | ||
| 27 | | 参数名 | 输入/输出 | 说明 | | 27 | | 参数名 | 输入/输出 | 说明 | |
| 28 | |--------|-----------|----------------------------------------------------------------------| | 28 | |--------|-----------|----------------------------------------------------------------------| |
| 29 | -| start | 输入 | 源操作数。<br>支持的数据类型为:DT_FP16,DT_BF16,DT_INT16,DT_INT32,DT_FP32。<br>默认值为0。 | | 29 | +| start | 输入 | 源操作数。<br>支持的数据类型不同型号有所差异,详细请参见[约束说明](#约束说明)。<br>默认值为0。 | |
| 30 | -| end | 输入 | 源操作数。<br>支持的数据类型为:DT_FP16,DT_BF16,DT_INT16,DT_INT32,DT_FP32。<br>该参数不能省略。 | | 30 | +| end | 输入 | 源操作数。<br>支持的数据类型不同型号有所差异,详细请参见[约束说明](#约束说明)。<br>该参数不能省略。 | |
| 31 | -| step | 输入 | 源操作数。<br>支持的数据类型为:DT_FP16,DT_BF16,DT_INT16,DT_INT32,DT_FP32。<br>默认值为1。 | | 31 | +| step | 输入 | 源操作数。<br>支持的数据类型不同型号有所差异,详细请参见[约束说明](#约束说明)。<br>默认值为1。 | |
| 32 | 32 | ||
| 33 | ## 返回值说明 | 33 | ## 返回值说明 |
| 34 | 34 | ||
| 35 | -返回一维输出Tensor,若输入值存在float数据类型,则输出Tensor数据类型为DT_FP32,否则为DT_INT32。 | 35 | +返回一维输出Tensor,若输入值存在float数据类型,则输出Tensor数据类型为DT_FP32;若输入值存在DT_INT64数据类型(或超出int32范围,DT_INT64仅Ascend 950PR/Ascend 950DT支持),则输出Tensor数据类型为DT_INT64;否则为DT_INT32。 |
| 36 | 36 | ||
| 37 | ## 约束说明 | 37 | ## 约束说明 |
| 38 | 38 | ||
| @@ -40,7 +40,18 @@ arange(start: Union[int, float] = 0, end: Union[int, float], step: Union[int, fl | |||
| 40 | 40 | ||
| 41 | 2. \(end-start\)/step需大于0; | 41 | 2. \(end-start\)/step需大于0; |
| 42 | 42 | ||
| 43 | -3. 如果start,end,step均为int输入,则三者均不能超出int32范围 | 43 | +3. 如果start,end,step均为int输入且均在int32范围内,则输出数据类型为DT_INT32;若超出int32范围,则输出数据类型为DT_INT64(DT_INT64仅Ascend 950PR/Ascend 950DT支持) |
| 44 | + | ||
| 45 | +4. Tensor数据类型说明: | ||
| 46 | + <!-- npu="950" id4 --> | ||
| 47 | + - Ascend 950PR/Ascend 950DT:DT_FP16,DT_BF16,DT_INT16,DT_INT32,DT_INT64,DT_FP32。 | ||
| 48 | + <!-- end id4 --> | ||
| 49 | + <!-- npu="A3" id5 --> | ||
| 50 | + - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP16,DT_BF16,DT_INT16,DT_INT32,DT_FP32。 | ||
| 51 | + <!-- end id5 --> | ||
| 52 | + <!-- npu="910b" id6 --> | ||
| 53 | + - Atlas A2 训练系列产品/Atlas A2 推理系列产品:DT_FP16,DT_BF16,DT_INT16,DT_INT32,DT_FP32。 | ||
| 54 | + <!-- end id6 --> | ||
| 44 | 55 | ||
| 45 | ## 调用示例 | 56 | ## 调用示例 |
| 46 | 57 | ||
| @@ -42,7 +42,7 @@ bitwise_left_shift(input: Union[Tensor, int], other: Union[Tensor, int]) -> Tens | |||
| 42 | 1. input和other类型应该相同。 | 42 | 1. input和other类型应该相同。 |
| 43 | 2. Tensor数据类型说明: | 43 | 2. Tensor数据类型说明: |
| 44 | <!-- npu="950" id4 --> | 44 | <!-- npu="950" id4 --> |
| 45 | - - Ascend 950PR/Ascend 950DT:DT_INT16,DT_UINT16,DT_INT32,DT_UINT32,DT_INT8,DT_UINT8 | 45 | + - Ascend 950PR/Ascend 950DT:DT_INT16,DT_UINT16,DT_INT32,DT_UINT32,DT_INT8,DT_UINT8,DT_INT64,DT_UINT64 |
| 46 | <!-- end id4 --> | 46 | <!-- end id4 --> |
| 47 | <!-- npu="A3" id5 --> | 47 | <!-- npu="A3" id5 --> |
| 48 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_INT16,DT_UINT16 | 48 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_INT16,DT_UINT16 |
| @@ -42,7 +42,7 @@ bitwise_right_shift(input: Union[Tensor, int], other: Union[Tensor, int]) -> Ten | |||
| 42 | 1. input和other类型应该相同。 | 42 | 1. input和other类型应该相同。 |
| 43 | 2. Tensor数据类型说明: | 43 | 2. Tensor数据类型说明: |
| 44 | <!-- npu="950" id4 --> | 44 | <!-- npu="950" id4 --> |
| 45 | - - Ascend 950PR/Ascend 950DT:DT_INT16,DT_UINT16,DT_INT32,DT_UINT32,DT_INT8,DT_UINT8 | 45 | + - Ascend 950PR/Ascend 950DT:DT_INT16,DT_UINT16,DT_INT32,DT_UINT32,DT_INT8,DT_UINT8,DT_INT64,DT_UINT64 |
| 46 | <!-- end id4 --> | 46 | <!-- end id4 --> |
| 47 | <!-- npu="A3" id5 --> | 47 | <!-- npu="A3" id5 --> |
| 48 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_INT16,DT_UINT16 | 48 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_INT16,DT_UINT16 |
| @@ -30,9 +30,9 @@ clip( | |||
| 30 | 30 | ||
| 31 | | 参数名 | 输入/输出 | 说明 | | 31 | | 参数名 | 输入/输出 | 说明 | |
| 32 | |--------|-----------|----------------------------------------------------------------------| | 32 | |--------|-----------|----------------------------------------------------------------------| |
| 33 | -| input | 输入 | 源操作数。<br>支持的类型为Tensor类型。<br>Tensor支持的数据类型为:DT_FP32,DT_FP16,DT_BF16,DT_INT32,DT_INT16。<br>不支持空Tensor,数据维度大小仅支持1-4维,元素个数不超过INT32_MAX。 | | 33 | +| input | 输入 | 源操作数。<br>支持的类型为Tensor类型。<br>Tensor支持的数据类型不同型号有所差异,详细请参见[约束说明](#约束说明)。<br>不支持空Tensor,数据维度大小仅支持1-4维,元素个数不超过INT32_MAX。 | |
| 34 | -| min | 输入 | 源操作数。<br>支持的类型为int\float\Element以及Tensor类型,数据类型必须与输入input的数据类型一致。<br>当为int或者float类型时会自动转换为Element类型,且数据类型与输入input的数据类型一致。当需要使用其他数据类型时,可以通过Element构建。<br>Tensor和Element支持的数据类型为:DT_FP32,DT_FP16,DT_INT32,DT_INT16。<br>不支持空Tensor,数据维度大小仅支持1-4维,元素个数不超过INT32_MAX。<br>可缺省,默认值为-INF。<br>NaN,INF,-INF仅在浮点数运算时有定义,即只在数据类型为DT_FP16/DT_FP32时生效;当数据类型为DT_INT16和DT_INT32时,会跳过默认值的比较逻辑。 | | 34 | +| min | 输入 | 源操作数。<br>支持的类型为int\float\Element以及Tensor类型,数据类型必须与输入input的数据类型一致。<br>当为int或者float类型时会自动转换为Element类型,且数据类型与输入input的数据类型一致。当需要使用其他数据类型时,可以通过Element构建。<br>Tensor和Element支持的数据类型不同型号有所差异,详细请参见[约束说明](#约束说明)。<br>不支持空Tensor,数据维度大小仅支持1-4维,元素个数不超过INT32_MAX。<br>可缺省,默认值为-INF。<br>NaN,INF,-INF仅在浮点数运算时有定义,即只在数据类型为DT_FP16/DT_FP32时生效;当数据类型为DT_INT16和DT_INT32时,会跳过默认值的比较逻辑。 | |
| 35 | -| max | 输入 | 源操作数。<br>支持的类型为int\float\Element以及Tensor类型,数据类型必须与输入input的数据类型一致。<br>当为int或者float类型时会自动转换为Element类型,且数据类型与输入input的数据类型一致。当需要使用其他数据类型时,可以通过Element构建。<br>Tensor和Element支持的数据类型为:DT_FP32,DT_FP16,DT_INT32,DT_INT16。<br>不支持空Tensor,数据维度大小仅支持1-4维,元素个数不超过INT32_MAX。<br>可缺省,默认值为INF。<br>NaN,INF,-INF仅在浮点数运算时有定义,即只在数据类型为DT_FP16/DT_FP32时生效;当数据类型为DT_INT16和DT_INT32时,会跳过默认值的比较逻辑。 | | 35 | +| max | 输入 | 源操作数。<br>支持的类型为int\float\Element以及Tensor类型,数据类型必须与输入input的数据类型一致。<br>当为int或者float类型时会自动转换为Element类型,且数据类型与输入input的数据类型一致。当需要使用其他数据类型时,可以通过Element构建。<br>Tensor和Element支持的数据类型不同型号有所差异,详细请参见[约束说明](#约束说明)。<br>不支持空Tensor,数据维度大小仅支持1-4维,元素个数不超过INT32_MAX。<br>可缺省,默认值为INF。<br>NaN,INF,-INF仅在浮点数运算时有定义,即只在数据类型为DT_FP16/DT_FP32时生效;当数据类型为DT_INT16和DT_INT32时,会跳过默认值的比较逻辑。 | |
| 36 | 36 | ||
| 37 | ## 返回值说明 | 37 | ## 返回值说明 |
| 38 | 38 | ||
| @@ -59,7 +59,17 @@ $$ | |||
| 59 | 1. min / max的类型必须一致,同时为Element或同时为Tensor。 | 59 | 1. min / max的类型必须一致,同时为Element或同时为Tensor。 |
| 60 | 2. min / max为Tensor类型时,其Shape大小必须满足可以广播到输入的Shape。 | 60 | 2. min / max为Tensor类型时,其Shape大小必须满足可以广播到输入的Shape。 |
| 61 | 3. min和max支持同时缺省,返回原值。 | 61 | 3. min和max支持同时缺省,返回原值。 |
| 62 | -4. Tensor类型输入不支持`TileOpFormat.TILEOP_NZ`格式。 | 62 | +4. Tensor数据类型说明: |
| 63 | + <!-- npu="950" id4 --> | ||
| 64 | + - Ascend 950PR/Ascend 950DT:DT_FP32,DT_FP16,DT_BF16,DT_INT32,DT_INT16,DT_INT64。 | ||
| 65 | + <!-- end id4 --> | ||
| 66 | + <!-- npu="A3" id5 --> | ||
| 67 | + - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP32,DT_FP16,DT_BF16,DT_INT32,DT_INT16。 | ||
| 68 | + <!-- end id5 --> | ||
| 69 | + <!-- npu="910b" id6 --> | ||
| 70 | + - Atlas A2 训练系列产品/Atlas A2 推理系列产品:DT_FP32,DT_FP16,DT_BF16,DT_INT32,DT_INT16。 | ||
| 71 | + <!-- end id6 --> | ||
| 72 | +5. Tensor类型输入不支持`TileOpFormat.TILEOP_NZ`格式。 | ||
| 63 | 73 | ||
| 64 | ## 调用示例 | 74 | ## 调用示例 |
| 65 | 75 | ||
| @@ -30,19 +30,29 @@ div(input: Tensor, other: Union[Tensor, float, int], precision_type: PrecisionTy | |||
| 30 | 30 | ||
| 31 | | 参数名 | 输入/输出 | 说明 | | 31 | | 参数名 | 输入/输出 | 说明 | |
| 32 | |--------|-----------|----------------------------------------------------------------------| | 32 | |--------|-----------|----------------------------------------------------------------------| |
| 33 | -| input | 输入 | 源操作数。<br>支持的类型为:Tensor。<br>Tensor支持的数据类型为:DT_FP16,DT_FP32,DT_BF16,DT_INT16,DT_INT32。<br>不支持空Tensor;支持的维度:1-4维;支持多维度广播到相同形状;Shape Size不大于2147483647(即INT32_MAX)。 | | 33 | +| input | 输入 | 源操作数。<br>支持的类型为:Tensor。不同型号支持的数据类型有所差异,详细请参见[约束说明](#约束说明)。<br>不支持空Tensor;支持的维度:1-4维;支持多维度广播到相同形状;Shape Size不大于2147483647(即INT32_MAX)。 | |
| 34 | -| other | 输入 | 源操作数。<br>支持的类型为:Tensor、float、int。<br>Tensor支持的数据类型为:DT_FP16,DT_FP32,DT_BF16,DT_INT16,DT_INT32。<br>不支持空Tensor;支持的维度:1-4维;支持多维度广播到相同形状;Shape Size不大于2147483647(即INT32_MAX)。 | | 34 | +| other | 输入 | 源操作数。<br>支持的类型为:Tensor、float、int。不同型号支持的数据类型有所差异,详细请参见[约束说明](#约束说明)。<br>不支持空Tensor;支持的维度:1-4维;支持多维度广播到相同形状;Shape Size不大于2147483647(即INT32_MAX)。 | |
| 35 | | precision_type | 输入 | 精度模式枚举类型,用以控制除法计算的精度模式,具体定义为:[PrecisionType](../datatype/PrecisionType.md)。<br>默认为HIGH_PRECISION(高精度模式)。 | | 35 | | precision_type | 输入 | 精度模式枚举类型,用以控制除法计算的精度模式,具体定义为:[PrecisionType](../datatype/PrecisionType.md)。<br>默认为HIGH_PRECISION(高精度模式)。 | |
| 36 | 36 | ||
| 37 | ## 返回值说明 | 37 | ## 返回值说明 |
| 38 | 38 | ||
| 39 | -返回输出Tensor,Shape为input和other广播后大小。当输入为浮点类型时,输出数据类型与输入相同;当输入为整型(DT_INT16/DT_INT32)时,输出数据类型为DT_FP32。 | 39 | +返回输出Tensor,Shape为input和other广播后大小。当输入为浮点类型时,输出数据类型与输入相同;当输入为DT_INT16或DT_INT32时,输出数据类型为DT_FP32;当输入为DT_INT64或DT_UINT64时(仅Ascend 950PR/Ascend 950DT支持),输出数据类型与输入相同。 |
| 40 | 40 | ||
| 41 | ## 约束说明 | 41 | ## 约束说明 |
| 42 | 42 | ||
| 43 | 1. input和other都为Tensor时,数据类型应该相同。 | 43 | 1. input和other都为Tensor时,数据类型应该相同。 |
| 44 | 2. other为scalar时,若input为浮点类型,则scalar支持整型(自动转为浮点);若input为整型,则scalar不支持浮点类型(会报错)。 | 44 | 2. other为scalar时,若input为浮点类型,则scalar支持整型(自动转为浮点);若input为整型,则scalar不支持浮点类型(会报错)。 |
| 45 | -3. **精度模式说明**: | 45 | +3. Tensor数据类型说明: |
| 46 | + <!-- npu="950" id7 --> | ||
| 47 | + - Ascend 950PR/Ascend 950DT:DT_FP16,DT_FP32,DT_BF16,DT_INT16,DT_INT32,DT_INT64,DT_UINT64。 | ||
| 48 | + <!-- end id7 --> | ||
| 49 | + <!-- npu="A3" id8 --> | ||
| 50 | + - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP16,DT_FP32,DT_BF16,DT_INT16,DT_INT32。 | ||
| 51 | + <!-- end id8 --> | ||
| 52 | + <!-- npu="910b" id9 --> | ||
| 53 | + - Atlas A2 训练系列产品/Atlas A2 推理系列产品:DT_FP16,DT_FP32,DT_BF16,DT_INT16,DT_INT32。 | ||
| 54 | + <!-- end id9 --> | ||
| 55 | +4. **精度模式说明**: | ||
| 46 | - **HIGH_PRECISION(高精度模式)**:默认模式,在底层实现中会使用更高精度的计算方式,在不同型号上的支持情况: | 56 | - **HIGH_PRECISION(高精度模式)**:默认模式,在底层实现中会使用更高精度的计算方式,在不同型号上的支持情况: |
| 47 | <!-- npu="950" id4 --> | 57 | <!-- npu="950" id4 --> |
| 48 | - Ascend 950PR/Ascend 950DT:支持 | 58 | - Ascend 950PR/Ascend 950DT:支持 |
| @@ -54,8 +64,8 @@ div(input: Tensor, other: Union[Tensor, float, int], precision_type: PrecisionTy | |||
| 54 | - Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | 64 | - Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 |
| 55 | <!-- end id6 --> | 65 | <!-- end id6 --> |
| 56 | - **INTRINSIC(指令模式)**:直接使用芯片指令进行计算。 | 66 | - **INTRINSIC(指令模式)**:直接使用芯片指令进行计算。 |
| 57 | -4. Tensor类型输入不支持`TileOpFormat.TILEOP_NZ`格式。 | 67 | +5. Tensor类型输入不支持`TileOpFormat.TILEOP_NZ`格式。 |
| 58 | -5. 整型输入约束:当输入为DT_INT16或DT_INT32时,内部会将输入转换为DT_FP32进行计算(float32尾数为24位)。在 $[-2^{24},\ 2^{24}]$ 范围内的整数可精确转换,超出范围的整数在转换时可能丢失低位精度。 | 68 | +6. 整型输入约束:当输入为DT_INT16或DT_INT32时,内部会将输入转换为DT_FP32进行计算(float32尾数为24位)。在 $[-2^{24},\ 2^{24}]$ 范围内的整数可精确转换,超出范围的整数在转换时可能丢失低位精度。当输入为DT_INT64或DT_UINT64时(仅Ascend 950PR/Ascend 950DT支持),不进行类型转换,直接按整数除法计算。 |
| 59 | 69 | ||
| 60 | ## 调用示例 | 70 | ## 调用示例 |
| 61 | 71 | ||
| @@ -39,7 +39,7 @@ eq(input: Tensor, other: Union[Tensor, float, Element]) -> Tensor | |||
| 39 | 2. 支持多维度广播到相同形状。 | 39 | 2. 支持多维度广播到相同形状。 |
| 40 | 3. Tensor和Element数据类型说明: | 40 | 3. Tensor和Element数据类型说明: |
| 41 | <!-- npu="950" id4 --> | 41 | <!-- npu="950" id4 --> |
| 42 | - - Ascend 950PR/Ascend 950DT:DT_FP16,DT_FP32,DT_INT16 | 42 | + - Ascend 950PR/Ascend 950DT:DT_FP16,DT_FP32,DT_INT16,DT_INT64,DT_UINT64 |
| 43 | <!-- end id4 --> | 43 | <!-- end id4 --> |
| 44 | <!-- npu="A3" id5 --> | 44 | <!-- npu="A3" id5 --> |
| 45 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP16,DT_FP32 | 45 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP16,DT_FP32 |
| @@ -30,8 +30,8 @@ floor_div(input: Tensor, other: Union[Tensor, int, float]) -> Tensor | |||
| 30 | 30 | ||
| 31 | | 参数名 | 输入/输出 | 说明 | | 31 | | 参数名 | 输入/输出 | 说明 | |
| 32 | |--------|-----------|----------------------------------------------------------------------| | 32 | |--------|-----------|----------------------------------------------------------------------| |
| 33 | -| input | 输入 | 源操作数。<br>支持的类型为:Tensor。<br>Tensor支持的数据类型为:DT_FP16、DT_BF16、DT_FP32、DT_INT32、DT_INT8、DT_UINT8。<br>不支持空Tensor;Shape仅支持1-4维,支持多维度广播到相同形状;Shape Size不大于2147483647(即INT32_MAX)。 | | 33 | +| input | 输入 | 源操作数。<br>支持的类型为:Tensor。<br>Tensor支持的数据类型不同型号有所差异,详细请参见[约束说明](#约束说明)。<br>不支持空Tensor;Shape仅支持1-4维,支持多维度广播到相同形状;Shape Size不大于2147483647(即INT32_MAX)。 | |
| 34 | -| other | 输入 | 源操作数。<br>支持的类型为:Tensor、int、float。<br>Tensor支持的数据类型为:DT_FP16、DT_BF16、DT_FP32、DT_INT32、DT_INT8、DT_UINT8。<br>不支持空Tensor;Shape仅支持1-4维,支持多维度广播到相同形状;Shape Size不大于2147483647(即INT32_MAX)。 | | 34 | +| other | 输入 | 源操作数。<br>支持的类型为:Tensor、int、float。<br>Tensor支持的数据类型不同型号有所差异,详细请参见[约束说明](#约束说明)。<br>不支持空Tensor;Shape仅支持1-4维,支持多维度广播到相同形状;Shape Size不大于2147483647(即INT32_MAX)。 | |
| 35 | 35 | ||
| 36 | ## 返回值说明 | 36 | ## 返回值说明 |
| 37 | 37 | ||
| @@ -41,7 +41,17 @@ floor_div(input: Tensor, other: Union[Tensor, int, float]) -> Tensor | |||
| 41 | 41 | ||
| 42 | 1. input和other数据类型应该相同。 | 42 | 1. input和other数据类型应该相同。 |
| 43 | 2. 支持多维度广播。 | 43 | 2. 支持多维度广播。 |
| 44 | -3. Tensor类型输入不支持`TileOpFormat.TILEOP_NZ`格式。 | 44 | +3. Tensor数据类型说明: |
| 45 | + <!-- npu="950" id4 --> | ||
| 46 | + - Ascend 950PR/Ascend 950DT:DT_FP16、DT_BF16、DT_FP32、DT_INT32、DT_INT8、DT_UINT8、DT_INT64。 | ||
| 47 | + <!-- end id4 --> | ||
| 48 | + <!-- npu="A3" id5 --> | ||
| 49 | + - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP16、DT_BF16、DT_FP32、DT_INT32、DT_INT8、DT_UINT8。 | ||
| 50 | + <!-- end id5 --> | ||
| 51 | + <!-- npu="910b" id6 --> | ||
| 52 | + - Atlas A2 训练系列产品/Atlas A2 推理系列产品:DT_FP16、DT_BF16、DT_FP32、DT_INT32、DT_INT8、DT_UINT8。 | ||
| 53 | + <!-- end id6 --> | ||
| 54 | +4. Tensor类型输入不支持`TileOpFormat.TILEOP_NZ`格式。 | ||
| 45 | 55 | ||
| 46 | ## 调用示例 | 56 | ## 调用示例 |
| 47 | 57 | ||
| @@ -27,8 +27,8 @@ full(size: List[int], fill_value: Union[int, float, Element], dtype: DataType, * | |||
| 27 | | 参数名 | 输入/输出 | 说明 | | 27 | | 参数名 | 输入/输出 | 说明 | |
| 28 | |--------------|-----------|----------------------------------------------------------------------| | 28 | |--------------|-----------|----------------------------------------------------------------------| |
| 29 | | size | 输入 | 源操作数,用于定义输出Tensor的Shape。<br>支持的数据类型为:List[int]。<br>支持的维度范围为:1维到4维。 | | 29 | | size | 输入 | 源操作数,用于定义输出Tensor的Shape。<br>支持的数据类型为:List[int]。<br>支持的维度范围为:1维到4维。 | |
| 30 | -| fill_value | 输入 | 源操作数,用于填充输出Tensor的值。<br>支持的数据类型为:int,float,Element。<br>当为int或者float类型时会自动转换为Element类型,其中int对应DT_INT32,float对应DT_FP32。当需要使用其他数据类型时,可以通过Element构建。<br>Element支持的数据类型为:DT_FP32,DT_FP16,DT_BF16,DT_INT8,DT_INT16,DT_INT32,DT_UINT8,DT_UINT16,DT_UINT32,DT_BOOL。<br>输入需要和dtype类型相同,不支持隐式转化。 | | 30 | +| fill_value | 输入 | 源操作数,用于填充输出Tensor的值。<br>支持的数据类型为:int,float,Element。<br>当为int或者float类型时会自动转换为Element类型,其中int对应DT_INT32,float对应DT_FP32。当需要使用其他数据类型时,可以通过Element构建。<br>Element支持的数据类型不同型号有所差异,详细请参见[约束说明](#约束说明)。<br>输入需要和dtype类型相同,不支持隐式转化。 | |
| 31 | -| dtype | 输入 | 源操作数,用于定义输出Tensor的类型。<br>支持的数据类型为:DT_FP32,DT_FP16,DT_BF16,DT_INT8,DT_INT16,DT_INT32,DT_UINT8,DT_UINT16,DT_UINT32,DT_BOOL。<br>输入需要和fill_value类型相同,不支持隐式转化。 | | 31 | +| dtype | 输入 | 源操作数,用于定义输出Tensor的类型。<br>支持的数据类型不同型号有所差异,详细请参见[约束说明](#约束说明)。<br>输入需要和fill_value类型相同,不支持隐式转化。 | |
| 32 | | valid_shape | 输入 | 源操作数,用于定义输出Tensor的动态Shape,关键字参数,用于动态图,静态图可以省略。<br>支持的类型为List[SymbolicScalar],List[int]。 | | 32 | | valid_shape | 输入 | 源操作数,用于定义输出Tensor的动态Shape,关键字参数,用于动态图,静态图可以省略。<br>支持的类型为List[SymbolicScalar],List[int]。 | |
| 33 | 33 | ||
| 34 | ## 返回值说明 | 34 | ## 返回值说明 |
| @@ -47,6 +47,17 @@ full(size: List[int], fill_value: Union[int, float, Element], dtype: DataType, * | |||
| 47 | 47 | ||
| 48 | 2. size的维度范围为1维到4维,即size的长度范围为\[1, 4\]。 | 48 | 2. size的维度范围为1维到4维,即size的长度范围为\[1, 4\]。 |
| 49 | 49 | ||
| 50 | +3. Tensor数据类型说明: | ||
| 51 | + <!-- npu="950" id4 --> | ||
| 52 | + - Ascend 950PR/Ascend 950DT:DT_FP32,DT_FP16,DT_BF16,DT_INT8,DT_INT16,DT_INT32,DT_UINT8,DT_UINT16,DT_UINT32,DT_BOOL,DT_INT64,DT_UINT64。 | ||
| 53 | + <!-- end id4 --> | ||
| 54 | + <!-- npu="A3" id5 --> | ||
| 55 | + - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP32,DT_FP16,DT_BF16,DT_INT8,DT_INT16,DT_INT32,DT_UINT8,DT_UINT16,DT_UINT32,DT_BOOL。 | ||
| 56 | + <!-- end id5 --> | ||
| 57 | + <!-- npu="910b" id6 --> | ||
| 58 | + - Atlas A2 训练系列产品/Atlas A2 推理系列产品:DT_FP32,DT_FP16,DT_BF16,DT_INT8,DT_INT16,DT_INT32,DT_UINT8,DT_UINT16,DT_UINT32,DT_BOOL。 | ||
| 59 | + <!-- end id6 --> | ||
| 60 | + | ||
| 50 | ## 调用示例 | 61 | ## 调用示例 |
| 51 | 62 | ||
| 52 | ### TileShape设置示例 | 63 | ### TileShape设置示例 |
| @@ -54,7 +54,7 @@ gather(input: Tensor, dim: int, index: Tensor) -> Tensor | |||
| 54 | 54 | ||
| 55 | 5. Tensor数据类型说明: | 55 | 5. Tensor数据类型说明: |
| 56 | <!-- npu="950" id4 --> | 56 | <!-- npu="950" id4 --> |
| 57 | - - Ascend 950PR/Ascend 950DT:DT_INT16,DT_INT32,DT_UINT16,DT_UINT32,DT_FP16,DT_FP32,DT_BF16 | 57 | + - Ascend 950PR/Ascend 950DT:DT_INT16,DT_INT32,DT_UINT16,DT_UINT32,DT_FP16,DT_FP32,DT_BF16,DT_INT64,DT_UINT64 |
| 58 | <!-- end id4 --> | 58 | <!-- end id4 --> |
| 59 | <!-- npu="A3" id5 --> | 59 | <!-- npu="A3" id5 --> |
| 60 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_INT16,DT_INT32,DT_UINT16,DT_UINT32,DT_FP16,DT_FP32,DT_BF16 | 60 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_INT16,DT_INT32,DT_UINT16,DT_UINT32,DT_FP16,DT_FP32,DT_BF16 |
| @@ -39,7 +39,7 @@ ge(input: Tensor, other: Union[Tensor, float, Element]) -> Tensor | |||
| 39 | 2. 支持多维度广播到相同形状。 | 39 | 2. 支持多维度广播到相同形状。 |
| 40 | 3. Tensor和Element数据类型说明: | 40 | 3. Tensor和Element数据类型说明: |
| 41 | <!-- npu="950" id4 --> | 41 | <!-- npu="950" id4 --> |
| 42 | - - Ascend 950PR/Ascend 950DT:DT_FP16,DT_FP32,DT_INT16 | 42 | + - Ascend 950PR/Ascend 950DT:DT_FP16,DT_FP32,DT_INT16,DT_INT64,DT_UINT64 |
| 43 | <!-- end id4 --> | 43 | <!-- end id4 --> |
| 44 | <!-- npu="A3" id5 --> | 44 | <!-- npu="A3" id5 --> |
| 45 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP16,DT_FP32 | 45 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP16,DT_FP32 |
| @@ -39,7 +39,7 @@ gt(input: Tensor, other: Union[Tensor, float, Element]) -> Tensor | |||
| 39 | 2. 支持多维度广播到相同形状。 | 39 | 2. 支持多维度广播到相同形状。 |
| 40 | 3. Tensor和Element数据类型说明: | 40 | 3. Tensor和Element数据类型说明: |
| 41 | <!-- npu="950" id4 --> | 41 | <!-- npu="950" id4 --> |
| 42 | - - Ascend 950PR/Ascend 950DT:DT_FP16,DT_FP32,DT_INT16 | 42 | + - Ascend 950PR/Ascend 950DT:DT_FP16,DT_FP32,DT_INT16,DT_INT64,DT_UINT64 |
| 43 | <!-- end id4 --> | 43 | <!-- end id4 --> |
| 44 | <!-- npu="A3" id5 --> | 44 | <!-- npu="A3" id5 --> |
| 45 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP16,DT_FP32 | 45 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP16,DT_FP32 |
| @@ -39,7 +39,7 @@ le(input: Tensor, other: Union[Tensor, float, Element]) -> Tensor | |||
| 39 | 2. 支持多维度广播到相同形状。 | 39 | 2. 支持多维度广播到相同形状。 |
| 40 | 3. Tensor和Element数据类型说明: | 40 | 3. Tensor和Element数据类型说明: |
| 41 | <!-- npu="950" id4 --> | 41 | <!-- npu="950" id4 --> |
| 42 | - - Ascend 950PR/Ascend 950DT:DT_FP16,DT_FP32,DT_INT16 | 42 | + - Ascend 950PR/Ascend 950DT:DT_FP16,DT_FP32,DT_INT16,DT_INT64,DT_UINT64 |
| 43 | <!-- end id4 --> | 43 | <!-- end id4 --> |
| 44 | <!-- npu="A3" id5 --> | 44 | <!-- npu="A3" id5 --> |
| 45 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP16,DT_FP32 | 45 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP16,DT_FP32 |
| @@ -26,7 +26,7 @@ logical_not(input: Tensor) -> Tensor | |||
| 26 | 26 | ||
| 27 | | 参数名 | 输入/输出 | 说明 | | 27 | | 参数名 | 输入/输出 | 说明 | |
| 28 | |---------|-----------|----------------------------------------------------------------------| | 28 | |---------|-----------|----------------------------------------------------------------------| |
| 29 | -| input | 输入 | 源操作数。<br>支持的类型为:Tensor。<br>Tensor支持的数据类型为:DT_FP32,DT_FP16,DT_BF16,DT_BOOL,DT_INT8,DT_UINT8,DT_INT16,DT_UINT16,DT_INT32,DT_UINT32。<br>不支持空Tensor;Shape仅支持1-4维;Shape Size不大于2147483647(即INT32_MAX)。 | | 29 | +| input | 输入 | 源操作数。<br>支持的类型为:Tensor。<br>Tensor支持的数据类型不同型号有所差异,详细请参见[约束说明](#约束说明)。<br>不支持空Tensor;Shape仅支持1-4维;Shape Size不大于2147483647(即INT32_MAX)。 | |
| 30 | 30 | ||
| 31 | ## 返回值说明 | 31 | ## 返回值说明 |
| 32 | 32 | ||
| @@ -34,10 +34,20 @@ logical_not(input: Tensor) -> Tensor | |||
| 34 | 34 | ||
| 35 | ## 约束说明 | 35 | ## 约束说明 |
| 36 | 36 | ||
| 37 | -1. TileShape与input维度保持一致; | 37 | +1. Tensor数据类型说明: |
| 38 | -2. 由于存在临时内存使用,当输入数据类型为DT\_FP32,TileShape大小有额外约束,假设TileShape为\[a,b,c,d\],那么a\*b\*c\*d\*sizeof\(input\) + a\*b\*c\*d\*sizeof\(BOOL\) + 20.25KB<UB。其他输入数据类型应该满足,a\*b\*c\*d\*sizeof\(input\) + a\*b\*c\*d\*sizeof\(BOOL\) + 12.54KB<UB | 38 | + <!-- npu="950" id4 --> |
| 39 | -3. 当输入数据类型为DT\_INT16、DT\_UINT16、DT\_INT32、DT\_UINT32时,走整数计算路径,临时内存占用与输入数据类型相关:DT\_INT16/DT\_UINT16需4KB,DT\_INT32/DT\_UINT32需8KB。TileShape大小约束为:a\*b\*c\*d\*sizeof\(input\) + a\*b\*c\*d\*sizeof\(BOOL\) + sizeof\(input\)\*2KB<UB。 | 39 | + - Ascend 950PR/Ascend 950DT:DT_FP32,DT_FP16,DT_BF16,DT_BOOL,DT_INT8,DT_UINT8,DT_INT16,DT_UINT16,DT_INT32,DT_UINT32,DT_INT64。 |
| 40 | -4. Tensor类型输入不支持`TileOpFormat.TILEOP_NZ`格式。 | 40 | + <!-- end id4 --> |
| 41 | + <!-- npu="A3" id5 --> | ||
| 42 | + - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP32,DT_FP16,DT_BF16,DT_BOOL,DT_INT8,DT_UINT8,DT_INT16,DT_UINT16,DT_INT32,DT_UINT32。 | ||
| 43 | + <!-- end id5 --> | ||
| 44 | + <!-- npu="910b" id6 --> | ||
| 45 | + - Atlas A2 训练系列产品/Atlas A2 推理系列产品:DT_FP32,DT_FP16,DT_BF16,DT_BOOL,DT_INT8,DT_UINT8,DT_INT16,DT_UINT16,DT_INT32,DT_UINT32。 | ||
| 46 | + <!-- end id6 --> | ||
| 47 | +2. TileShape与input维度保持一致; | ||
| 48 | +3. 由于存在临时内存使用,当输入数据类型为DT_FP32,TileShape大小有额外约束,假设TileShape为[a,b,c,d],那么a*b*c*d*sizeof(input) + a*b*c*d*sizeof(BOOL) + 20.25KB<UB。其他输入数据类型应该满足,a*b*c*d*sizeof(input) + a*b*c*d*sizeof(BOOL) + 12.54KB<UB | ||
| 49 | +4. 当输入数据类型为DT_INT16、DT_UINT16、DT_INT32、DT_UINT32、DT_INT64(DT_INT64仅Ascend 950PR/Ascend 950DT支持)时,走整数计算路径,临时内存占用与输入数据类型相关:DT_INT16/DT_UINT16需4KB,DT_INT32/DT_UINT32需8KB,DT_INT64需16KB。TileShape大小约束为:a*b*c*d*sizeof(input) + a*b*c*d*sizeof(BOOL) + sizeof(input)*2KB<UB。 | ||
| 50 | +5. Tensor类型输入不支持`TileOpFormat.TILEOP_NZ`格式。 | ||
| 41 | 51 | ||
| 42 | ## 调用示例 | 52 | ## 调用示例 |
| 43 | 53 | ||
| @@ -39,7 +39,7 @@ lt(input: Tensor, other: Union[Tensor, float, Element]) -> Tensor | |||
| 39 | 2. 支持多维度广播到相同形状。 | 39 | 2. 支持多维度广播到相同形状。 |
| 40 | 3. Tensor和Element数据类型说明: | 40 | 3. Tensor和Element数据类型说明: |
| 41 | <!-- npu="950" id4 --> | 41 | <!-- npu="950" id4 --> |
| 42 | - - Ascend 950PR/Ascend 950DT:DT_FP16,DT_FP32,DT_INT16 | 42 | + - Ascend 950PR/Ascend 950DT:DT_FP16,DT_FP32,DT_INT16,DT_INT64,DT_UINT64 |
| 43 | <!-- end id4 --> | 43 | <!-- end id4 --> |
| 44 | <!-- npu="A3" id5 --> | 44 | <!-- npu="A3" id5 --> |
| 45 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP16,DT_FP32 | 45 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP16,DT_FP32 |
| @@ -47,7 +47,7 @@ maximum( | |||
| 47 | 47 | ||
| 48 | 1. 两个输入均为Tensor类型时,支持的数据类型如下: | 48 | 1. 两个输入均为Tensor类型时,支持的数据类型如下: |
| 49 | <!-- npu="950" id4 --> | 49 | <!-- npu="950" id4 --> |
| 50 | - - Ascend 950PR/Ascend 950DT:DT_INT32,DT_UINT32,DT_FP32,DT_INT16,DT_UINT16,DT_FP16,DT_BF16,DT_UINT8,DT_INT8 | 50 | + - Ascend 950PR/Ascend 950DT:DT_INT32,DT_UINT32,DT_FP32,DT_INT16,DT_UINT16,DT_FP16,DT_BF16,DT_UINT8,DT_INT8,DT_INT64,DT_UINT64 |
| 51 | <!-- end id4 --> | 51 | <!-- end id4 --> |
| 52 | <!-- npu="A3" id5 --> | 52 | <!-- npu="A3" id5 --> |
| 53 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_INT32,DT_INT16,DT_FP16,DT_FP32,DT_BF16 | 53 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_INT32,DT_INT16,DT_FP16,DT_FP32,DT_BF16 |
| @@ -57,7 +57,7 @@ maximum( | |||
| 57 | <!-- end id6 --> | 57 | <!-- end id6 --> |
| 58 | 2. 一个输入为Tensor,另一个输入为Element类型时,支持的数据类型如下: | 58 | 2. 一个输入为Tensor,另一个输入为Element类型时,支持的数据类型如下: |
| 59 | <!-- npu="950" id7 --> | 59 | <!-- npu="950" id7 --> |
| 60 | - - Ascend 950PR/Ascend 950DT:DT_INT32,DT_INT16,DT_FP16,DT_FP32,DT_BF16 | 60 | + - Ascend 950PR/Ascend 950DT:DT_INT32,DT_INT16,DT_FP16,DT_FP32,DT_BF16,DT_INT64,DT_UINT64 |
| 61 | <!-- end id7 --> | 61 | <!-- end id7 --> |
| 62 | <!-- npu="A3" id8 --> | 62 | <!-- npu="A3" id8 --> |
| 63 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_INT32,DT_INT16,DT_FP16,DT_FP32,DT_BF16 | 63 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_INT32,DT_INT16,DT_FP16,DT_FP32,DT_BF16 |
| @@ -48,7 +48,7 @@ minimum( | |||
| 48 | 48 | ||
| 49 | 1. 两个输入均为Tensor类型时,支持的数据类型如下: | 49 | 1. 两个输入均为Tensor类型时,支持的数据类型如下: |
| 50 | <!-- npu="950" id4 --> | 50 | <!-- npu="950" id4 --> |
| 51 | - - Ascend 950PR/Ascend 950DT:DT_INT32,DT_UINT32,DT_FP32,DT_INT16,DT_UINT16,DT_FP16,DT_BF16,DT_UINT8,DT_INT8 | 51 | + - Ascend 950PR/Ascend 950DT:DT_INT32,DT_UINT32,DT_FP32,DT_INT16,DT_UINT16,DT_FP16,DT_BF16,DT_UINT8,DT_INT8,DT_INT64,DT_UINT64 |
| 52 | <!-- end id4 --> | 52 | <!-- end id4 --> |
| 53 | <!-- npu="A3" id5 --> | 53 | <!-- npu="A3" id5 --> |
| 54 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_INT32,DT_INT16,DT_FP16,DT_FP32,DT_BF16 | 54 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_INT32,DT_INT16,DT_FP16,DT_FP32,DT_BF16 |
| @@ -58,7 +58,7 @@ minimum( | |||
| 58 | <!-- end id6 --> | 58 | <!-- end id6 --> |
| 59 | 2. 一个输入为Tensor,另一个输入为Element类型时,支持的数据类型如下: | 59 | 2. 一个输入为Tensor,另一个输入为Element类型时,支持的数据类型如下: |
| 60 | <!-- npu="950" id7 --> | 60 | <!-- npu="950" id7 --> |
| 61 | - - Ascend 950PR/Ascend 950DT:DT_INT32,DT_INT16,DT_FP16,DT_FP32,DT_BF16 | 61 | + - Ascend 950PR/Ascend 950DT:DT_INT32,DT_INT16,DT_FP16,DT_FP32,DT_BF16,DT_INT64,DT_UINT64 |
| 62 | <!-- end id7 --> | 62 | <!-- end id7 --> |
| 63 | <!-- npu="A3" id8 --> | 63 | <!-- npu="A3" id8 --> |
| 64 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_INT32,DT_INT16,DT_FP16,DT_FP32,DT_BF16 | 64 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_INT32,DT_INT16,DT_FP16,DT_FP32,DT_BF16 |
| @@ -30,8 +30,8 @@ mul(input: Tensor, other: Union[Tensor, float, int]) -> Tensor | |||
| 30 | 30 | ||
| 31 | | 参数名 | 输入/输出 | 说明 | | 31 | | 参数名 | 输入/输出 | 说明 | |
| 32 | |---------|-----------|----------------------------------------------------------------------| | 32 | |---------|-----------|----------------------------------------------------------------------| |
| 33 | -| input | 输入 | 源操作数。<br>支持的类型为:Tensor。<br>Tensor支持的数据类型为:DT_INT32,DT_FP32,DT_INT16,DT_FP16,DT_BF16。<br>不支持空Tensor;Shape仅支持1-4维;支持多维度广播到相同形状;Shape Size不大于2147483647(即INT32_MAX)。 | | 33 | +| input | 输入 | 源操作数。<br>支持的类型为:Tensor。不同型号支持的数据类型有所差异,详细请参见[约束说明](#约束说明)。<br>不支持空Tensor;Shape仅支持1-4维;支持多维度广播到相同形状;Shape Size不大于2147483647(即INT32_MAX)。 | |
| 34 | -| other | 输入 | 源操作数。<br>支持的类型为float、int以及Tensor类型。<br>Tensor支持的数据类型为:DT_INT32,DT_FP32,DT_INT16,DT_FP16,DT_BF16。<br>不支持空Tensor;Shape仅支持1-4维;支持多维度广播到相同形状;Shape Size不大于2147483647(即INT32_MAX)。 | | 34 | +| other | 输入 | 源操作数。<br>支持的类型为float、int以及Tensor类型。不同型号支持的数据类型有所差异,详细请参见[约束说明](#约束说明)。<br>不支持空Tensor;Shape仅支持1-4维;支持多维度广播到相同形状;Shape Size不大于2147483647(即INT32_MAX)。 | |
| 35 | 35 | ||
| 36 | ## 返回值说明 | 36 | ## 返回值说明 |
| 37 | 37 | ||
| @@ -41,7 +41,17 @@ mul(input: Tensor, other: Union[Tensor, float, int]) -> Tensor | |||
| 41 | 41 | ||
| 42 | 1. input和other都为Tensor时,数据类型应该相同。 | 42 | 1. input和other都为Tensor时,数据类型应该相同。 |
| 43 | 2. other为scalar时,若input为浮点类型,则scalar支持整型(自动转为浮点);若input为整型,则scalar不支持浮点类型(会报错)。 | 43 | 2. other为scalar时,若input为浮点类型,则scalar支持整型(自动转为浮点);若input为整型,则scalar不支持浮点类型(会报错)。 |
| 44 | -3. Tensor类型输入不支持`TileOpFormat.TILEOP_NZ`格式。 | 44 | +3. Tensor数据类型说明: |
| 45 | + <!-- npu="950" id4 --> | ||
| 46 | + - Ascend 950PR/Ascend 950DT:DT_INT32,DT_FP32,DT_INT16,DT_FP16,DT_BF16,DT_INT64,DT_UINT64。 | ||
| 47 | + <!-- end id4 --> | ||
| 48 | + <!-- npu="A3" id5 --> | ||
| 49 | + - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_INT32,DT_INT16,DT_FP16,DT_FP32,DT_BF16。 | ||
| 50 | + <!-- end id5 --> | ||
| 51 | + <!-- npu="910b" id6 --> | ||
| 52 | + - Atlas A2 训练系列产品/Atlas A2 推理系列产品:DT_INT32,DT_INT16,DT_FP16,DT_FP32,DT_BF16。 | ||
| 53 | + <!-- end id6 --> | ||
| 54 | +4. Tensor类型输入不支持`TileOpFormat.TILEOP_NZ`格式。 | ||
| 45 | 55 | ||
| 46 | ## 调用示例 | 56 | ## 调用示例 |
| 47 | 57 | ||
| @@ -39,7 +39,7 @@ ne(input: Tensor, other: Union[Tensor, float, Element]) -> Tensor | |||
| 39 | 2. 支持多维度广播到相同形状。 | 39 | 2. 支持多维度广播到相同形状。 |
| 40 | 3. Tensor和Element数据类型说明: | 40 | 3. Tensor和Element数据类型说明: |
| 41 | <!-- npu="950" id4 --> | 41 | <!-- npu="950" id4 --> |
| 42 | - - Ascend 950PR/Ascend 950DT:DT_FP16,DT_FP32,DT_INT16 | 42 | + - Ascend 950PR/Ascend 950DT:DT_FP16,DT_FP32,DT_INT16,DT_INT64,DT_UINT64 |
| 43 | <!-- end id4 --> | 43 | <!-- end id4 --> |
| 44 | <!-- npu="A3" id5 --> | 44 | <!-- npu="A3" id5 --> |
| 45 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP16,DT_FP32 | 45 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP16,DT_FP32 |
| @@ -26,7 +26,7 @@ neg(input: Tensor) -> Tensor | |||
| 26 | 26 | ||
| 27 | | 参数名 | 输入/输出 | 说明 | | 27 | | 参数名 | 输入/输出 | 说明 | |
| 28 | |---------|-----------|----------------------------------------------------------------------| | 28 | |---------|-----------|----------------------------------------------------------------------| |
| 29 | -| input | 输入 | 源操作数。<br>支持的类型为:Tensor。<br>Tensor支持的数据类型为:DT_FP32,DT_FP16,DT_BF16,DT_INT32,DT_INT16。<br>不支持空Tensor;Shape仅支持1-4维;Shape Size不大于2147483647(即INT32_MAX)。 | | 29 | +| input | 输入 | 源操作数。<br>支持的类型为:Tensor。<br>Tensor支持的数据类型不同型号有所差异,详细请参见[约束说明](#约束说明)。<br>不支持空Tensor;Shape仅支持1-4维;Shape Size不大于2147483647(即INT32_MAX)。 | |
| 30 | 30 | ||
| 31 | ## 返回值说明 | 31 | ## 返回值说明 |
| 32 | 32 | ||
| @@ -34,7 +34,17 @@ neg(input: Tensor) -> Tensor | |||
| 34 | 34 | ||
| 35 | ## 约束说明 | 35 | ## 约束说明 |
| 36 | 36 | ||
| 37 | -1. Tensor类型输入不支持`TileOpFormat.TILEOP_NZ`格式。 | 37 | +1. Tensor数据类型说明: |
| 38 | + <!-- npu="950" id4 --> | ||
| 39 | + - Ascend 950PR/Ascend 950DT:DT_FP32,DT_FP16,DT_BF16,DT_INT32,DT_INT16,DT_INT64。 | ||
| 40 | + <!-- end id4 --> | ||
| 41 | + <!-- npu="A3" id5 --> | ||
| 42 | + - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP32,DT_FP16,DT_BF16,DT_INT32,DT_INT16。 | ||
| 43 | + <!-- end id5 --> | ||
| 44 | + <!-- npu="910b" id6 --> | ||
| 45 | + - Atlas A2 训练系列产品/Atlas A2 推理系列产品:DT_FP32,DT_FP16,DT_BF16,DT_INT32,DT_INT16。 | ||
| 46 | + <!-- end id6 --> | ||
| 47 | +2. Tensor类型输入不支持`TileOpFormat.TILEOP_NZ`格式。 | ||
| 38 | 48 | ||
| 39 | ## 调用示例 | 49 | ## 调用示例 |
| 40 | 50 | ||
| @@ -30,7 +30,7 @@ relu(input: Tensor) -> Tensor | |||
| 30 | 30 | ||
| 31 | | 参数名 | 输入/输出 | 说明 | | 31 | | 参数名 | 输入/输出 | 说明 | |
| 32 | |--------|-----------|----------------------------------------------------------------------| | 32 | |--------|-----------|----------------------------------------------------------------------| |
| 33 | -| input | 输入 | 源操作数。<br>支持的类型为:Tensor。<br>Tensor支持的数据类型为:DT_INT16,DT_INT32,DT_FP16,DT_FP32,DT_BF16。<br>不支持空Tensor;Shape仅支持1-4维;Shape Size不大于2147483647(即INT32_MAX)。 | | 33 | +| input | 输入 | 源操作数。<br>支持的类型为:Tensor。<br>Tensor支持的数据类型不同型号有所差异,详细请参见[约束说明](#约束说明)。<br>不支持空Tensor;Shape仅支持1-4维;Shape Size不大于2147483647(即INT32_MAX)。 | |
| 34 | 34 | ||
| 35 | ## 返回值说明 | 35 | ## 返回值说明 |
| 36 | 36 | ||
| @@ -38,7 +38,17 @@ relu(input: Tensor) -> Tensor | |||
| 38 | 38 | ||
| 39 | ## 约束说明 | 39 | ## 约束说明 |
| 40 | 40 | ||
| 41 | -1. Tensor类型输入不支持`TileOpFormat.TILEOP_NZ`格式。 | 41 | +1. Tensor数据类型说明: |
| 42 | + <!-- npu="950" id4 --> | ||
| 43 | + - Ascend 950PR/Ascend 950DT:DT_INT16,DT_INT32,DT_INT64,DT_FP16,DT_FP32,DT_BF16。 | ||
| 44 | + <!-- end id4 --> | ||
| 45 | + <!-- npu="A3" id5 --> | ||
| 46 | + - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_INT16,DT_INT32,DT_FP16,DT_FP32,DT_BF16。 | ||
| 47 | + <!-- end id5 --> | ||
| 48 | + <!-- npu="910b" id6 --> | ||
| 49 | + - Atlas A2 训练系列产品/Atlas A2 推理系列产品:DT_INT16,DT_INT32,DT_FP16,DT_FP32,DT_BF16。 | ||
| 50 | + <!-- end id6 --> | ||
| 51 | +2. Tensor类型输入不支持`TileOpFormat.TILEOP_NZ`格式。 | ||
| 42 | 52 | ||
| 43 | ## 调用示例 | 53 | ## 调用示例 |
| 44 | 54 | ||
| @@ -34,8 +34,8 @@ remainder( | |||
| 34 | 34 | ||
| 35 | | 参数名 | 输入/输出 | 说明 | | 35 | | 参数名 | 输入/输出 | 说明 | |
| 36 | |--------|-----------|----------------------------------------------------------------------| | 36 | |--------|-----------|----------------------------------------------------------------------| |
| 37 | -| input | 输入 | 源操作数。<br>支持的类型为:Tensor、int、float。<br>Tensor支持的数据类型为:DT_FP32,DT_FP16,DT_BF16,DT_INT32,DT_INT16。<br>不支持空Tensor;Shape仅支持1-4维,支持多维度广播到相同形状;Shape Size不大于2147483647(即INT32_MAX)。 | | 37 | +| input | 输入 | 源操作数。<br>支持的类型为:Tensor、int、float。<br>Tensor支持的数据类型不同型号有所差异,详细请参见[约束说明](#约束说明)。<br>不支持空Tensor;Shape仅支持1-4维,支持多维度广播到相同形状;Shape Size不大于2147483647(即INT32_MAX)。 | |
| 38 | -| other | 输入 | 源操作数。<br>支持的类型为:Tensor、int、float。<br>Tensor支持的数据类型为:DT_FP32,DT_FP16,DT_BF16,DT_INT32,DT_INT16。<br>不支持空Tensor;Shape仅支持1-4维,支持多维度广播到相同形状;Shape Size不大于2147483647(即INT32_MAX)。 | | 38 | +| other | 输入 | 源操作数。<br>支持的类型为:Tensor、int、float。<br>Tensor支持的数据类型不同型号有所差异,详细请参见[约束说明](#约束说明)。<br>不支持空Tensor;Shape仅支持1-4维,支持多维度广播到相同形状;Shape Size不大于2147483647(即INT32_MAX)。 | |
| 39 | | precision_type | 输入 | 精度模式枚举类型,用以控制取余计算的精度模式,具体定义为:[PrecisionType](../datatype/PrecisionType.md)。<br>默认为HIGH_PRECISION(高精度模式)。 | | 39 | | precision_type | 输入 | 精度模式枚举类型,用以控制取余计算的精度模式,具体定义为:[PrecisionType](../datatype/PrecisionType.md)。<br>默认为HIGH_PRECISION(高精度模式)。 | |
| 40 | 40 | ||
| 41 | ## 返回值说明 | 41 | ## 返回值说明 |
| @@ -44,7 +44,7 @@ remainder( | |||
| 44 | 44 | ||
| 45 | ## 约束说明 | 45 | ## 约束说明 |
| 46 | 46 | ||
| 47 | -1. 当前不支持混合精度类型输入,即输入都是Tensor时数据类型都相同,输入有一个是标量时,Tensor的数据类型必须是对应的整数类型(DT_INT32或DT_INT16)或浮点数类型(DT_FP32、DT_FP16、DT_BF16); | 47 | +1. 当前不支持混合精度类型输入,即输入都是Tensor时数据类型都相同,输入有一个是标量时,Tensor的数据类型必须是对应的整数类型(DT_INT32、DT_INT16或DT_INT64,其中DT_INT64仅Ascend 950PR/Ascend 950DT支持)或浮点数类型(DT_FP32、DT_FP16、DT_BF16); |
| 48 | 2. 当input为整型数据类型时,**other不能含0**,整数取余的结果由芯片类型决定,可能为0或-1。 | 48 | 2. 当input为整型数据类型时,**other不能含0**,整数取余的结果由芯片类型决定,可能为0或-1。 |
| 49 | 3. 若输入Tensor的数据类型为DT_INT32,数据范围超过\[-2^24, 2^24\]范围时不保证精度; | 49 | 3. 若输入Tensor的数据类型为DT_INT32,数据范围超过\[-2^24, 2^24\]范围时不保证精度; |
| 50 | 4. precision_type使用说明: | 50 | 4. precision_type使用说明: |
| @@ -58,6 +58,16 @@ remainder( | |||
| 58 | - Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持,默认使用指令模式 `INTRINSIC` | 58 | - Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持,默认使用指令模式 `INTRINSIC` |
| 59 | <!-- end id6 --> | 59 | <!-- end id6 --> |
| 60 | 5. Tensor类型输入不支持`TileOpFormat.TILEOP_NZ`格式。 | 60 | 5. Tensor类型输入不支持`TileOpFormat.TILEOP_NZ`格式。 |
| 61 | +6. Tensor数据类型说明: | ||
| 62 | + <!-- npu="950" id7 --> | ||
| 63 | + - Ascend 950PR/Ascend 950DT:DT_FP32,DT_FP16,DT_BF16,DT_INT32,DT_INT16,DT_INT64。 | ||
| 64 | + <!-- end id7 --> | ||
| 65 | + <!-- npu="A3" id8 --> | ||
| 66 | + - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP32,DT_FP16,DT_BF16,DT_INT32,DT_INT16。 | ||
| 67 | + <!-- end id8 --> | ||
| 68 | + <!-- npu="910b" id9 --> | ||
| 69 | + - Atlas A2 训练系列产品/Atlas A2 推理系列产品:DT_FP32,DT_FP16,DT_BF16,DT_INT32,DT_INT16。 | ||
| 70 | + <!-- end id9 --> | ||
| 61 | 71 | ||
| 62 | ## 调用示例 | 72 | ## 调用示例 |
| 63 | 73 | ||
| @@ -26,7 +26,7 @@ round(input: Tensor, decimals: int) -> Tensor | |||
| 26 | 26 | ||
| 27 | | 参数名 | 输入/输出 | 说明 | | 27 | | 参数名 | 输入/输出 | 说明 | |
| 28 | |----------|-----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------| | 28 | |----------|-----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------| |
| 29 | -| input | 输入 | 源操作数。<br>支持的类型为:Tensor。<br>Tensor支持的数据类型为:DT_FP32,DT_FP16,DT_BF16,DT_INT32,DT_INT16。<br>不支持空Tensor;Shape仅支持1-4维;Shape Size不大于2147483647(即INT32_MAX)。 | | 29 | +| input | 输入 | 源操作数。<br>支持的类型为:Tensor。<br>Tensor支持的数据类型不同型号有所差异,详细请参见[约束说明](#约束说明)。<br>不支持空Tensor;Shape仅支持1-4维;Shape Size不大于2147483647(即INT32_MAX)。 | |
| 30 | | decimals | 输入 | 源操作数,四舍五入到的小数位数。<br>int类型。 | | 30 | | decimals | 输入 | 源操作数,四舍五入到的小数位数。<br>int类型。 | |
| 31 | 31 | ||
| 32 | ## 返回值说明 | 32 | ## 返回值说明 |
| @@ -35,7 +35,17 @@ round(input: Tensor, decimals: int) -> Tensor | |||
| 35 | 35 | ||
| 36 | ## 约束说明 | 36 | ## 约束说明 |
| 37 | 37 | ||
| 38 | -1. Tensor类型输入不支持`TileOpFormat.TILEOP_NZ`格式。 | 38 | +1. Tensor数据类型说明: |
| 39 | + <!-- npu="950" id4 --> | ||
| 40 | + - Ascend 950PR/Ascend 950DT:DT_FP32,DT_FP16,DT_BF16,DT_INT32,DT_INT16,DT_INT64。 | ||
| 41 | + <!-- end id4 --> | ||
| 42 | + <!-- npu="A3" id5 --> | ||
| 43 | + - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP32,DT_FP16,DT_BF16,DT_INT32,DT_INT16。 | ||
| 44 | + <!-- end id5 --> | ||
| 45 | + <!-- npu="910b" id6 --> | ||
| 46 | + - Atlas A2 训练系列产品/Atlas A2 推理系列产品:DT_FP32,DT_FP16,DT_BF16,DT_INT32,DT_INT16。 | ||
| 47 | + <!-- end id6 --> | ||
| 48 | +2. Tensor类型输入不支持`TileOpFormat.TILEOP_NZ`格式。 | ||
| 39 | 49 | ||
| 40 | ## 调用示例 | 50 | ## 调用示例 |
| 41 | 51 | ||
| @@ -42,10 +42,10 @@ scatter_(input: Tensor, dim: int, index: Tensor, src: Union[float, Element, Tens | |||
| 42 | 42 | ||
| 43 | | 参数名 | 输入/输出 | 说明 | | 43 | | 参数名 | 输入/输出 | 说明 | |
| 44 | |---------|-----------|----------------------------------------------------------------------| | 44 | |---------|-----------|----------------------------------------------------------------------| |
| 45 | -| input | 输入 | 支持的类型为:Tensor。<br>Tensor支持的数据类型为:DT_FP32、DT_FP16、DT_BF16、DT_INT8、DT_UINT8、DT_INT16、DT_INT32。<br>不支持空Tensor;Shape仅支持1-4维;Shape Size不大于2147483647(即INT32_MAX)。 | | 45 | +| input | 输入 | 支持的类型为:Tensor。<br>Tensor支持的数据类型为:DT_FP32、DT_FP16、DT_BF16、DT_INT8、DT_UINT8、DT_INT16、DT_INT32、DT_INT64。<br>不支持空Tensor;Shape仅支持1-4维;Shape Size不大于2147483647(即INT32_MAX)。 | |
| 46 | | dim | 输入 | 指定用于索引的维度,支持input的维度范围内的任意维度。<br>合法的维度索引,范围为:-input.dim到input.dim - 1。 | | 46 | | dim | 输入 | 指定用于索引的维度,支持input的维度范围内的任意维度。<br>合法的维度索引,范围为:-input.dim到input.dim - 1。 | |
| 47 | | index | 输入 | input的一组索引。<br>支持的数据类型为:Tensor。<br>Tensor支持的数据类型为:INT64、INT32。<br>支持的维度:和input保持一致<br>对于所有d != dim的维度,需满足要求:index.size(d) <= input.size(d)<br>当src为Tensor时,所有维度都需满足:index.size(d) <= src.size(d)<br>不支持空Tensor;Shape Size不大于2147483647(即INT32_MAX) | | 47 | | index | 输入 | input的一组索引。<br>支持的数据类型为:Tensor。<br>Tensor支持的数据类型为:INT64、INT32。<br>支持的维度:和input保持一致<br>对于所有d != dim的维度,需满足要求:index.size(d) <= input.size(d)<br>当src为Tensor时,所有维度都需满足:index.size(d) <= src.size(d)<br>不支持空Tensor;Shape Size不大于2147483647(即INT32_MAX) | |
| 48 | -| src | 输入 | src是更新的标量或Tensor。<br>src为Element时,支持的数据类型为:DT_FP32、DT_FP16、DT_BF16、DT_INT8、DT_UINT8、DT_INT16、DT_INT32,不支持输入INF/NAN<br>src为Tensor时,支持的数据类型为:DT_FP32、DT_FP16、DT_BF16、DT_INT8、DT_UINT8、DT_INT16、DT_INT32,数据类型和input保持一致。<br> | | 48 | +| src | 输入 | src是更新的标量或Tensor。<br>src为Element时,支持的数据类型为:DT_FP32、DT_FP16、DT_BF16、DT_INT8、DT_UINT8、DT_INT16、DT_INT32、DT_INT64,不支持输入INF/NAN<br>src为Tensor时,支持的数据类型为:DT_FP32、DT_FP16、DT_BF16、DT_INT8、DT_UINT8、DT_INT16、DT_INT32、DT_INT64,数据类型和input保持一致。<br> | |
| 49 | | reduce | 输入 | 要应用的归约操作,支持'add'或'multiply',不传参时默认为直接替换 | | 49 | | reduce | 输入 | 要应用的归约操作,支持'add'或'multiply',不传参时默认为直接替换 | |
| 50 | 50 | ||
| 51 | ## 返回值说明 | 51 | ## 返回值说明 |
| @@ -34,7 +34,7 @@ sign(input: Tensor) -> Tensor | |||
| 34 | 34 | ||
| 35 | | 参数名 | 输入/输出 | 说明 | | 35 | | 参数名 | 输入/输出 | 说明 | |
| 36 | |---------|-----------|----------------------------------------------------------------------| | 36 | |---------|-----------|----------------------------------------------------------------------| |
| 37 | -| input | 输入 | 源操作数。<br>支持的类型为:Tensor。<br>Tensor支持的数据类型为:DT_FP16,DT_BF16,DT_FP32,DT_INT8,DT_INT16,DT_INT32。<br>不支持空Tensor;Shape仅支持1-4维;Shape Size不大于2147483647(即INT32_MAX)。 | | 37 | +| input | 输入 | 源操作数。<br>支持的类型为:Tensor。<br>Tensor支持的数据类型不同型号有所差异,详细请参见[约束说明](#约束说明)。<br>不支持空Tensor;Shape仅支持1-4维;Shape Size不大于2147483647(即INT32_MAX)。 | |
| 38 | 38 | ||
| 39 | ## 返回值说明 | 39 | ## 返回值说明 |
| 40 | 40 | ||
| @@ -51,10 +51,20 @@ sign(input: Tensor) -> Tensor | |||
| 51 | | `DT_FP16` | `DT_FP16` | `W_align = CeilAlign(W, 16)` | `2 * H * W_align * sizeof(DT_FP16) + 32` | | 51 | | `DT_FP16` | `DT_FP16` | `W_align = CeilAlign(W, 16)` | `2 * H * W_align * sizeof(DT_FP16) + 32` | |
| 52 | | `DT_BF16` | `DT_FP32` | `W_align = CeilAlign(W, 8)` | `2 * H * W_align * sizeof(DT_FP32) + 32` | | 52 | | `DT_BF16` | `DT_FP32` | `W_align = CeilAlign(W, 8)` | `2 * H * W_align * sizeof(DT_FP32) + 32` | |
| 53 | | `DT_FP32` | `DT_FP32` | `W_align = CeilAlign(W, 8)` | `2 * H * W_align * sizeof(DT_FP32) + 32` | | 53 | | `DT_FP32` | `DT_FP32` | `W_align = CeilAlign(W, 8)` | `2 * H * W_align * sizeof(DT_FP32) + 32` | |
| 54 | - | `DT_INT16`、`DT_INT32` | 与输入一致 | 不涉及 | `32` | | 54 | + | `DT_INT16`、`DT_INT32`、`DT_INT64` | 与输入一致 | 不涉及 | `32` | |
| 55 | 55 | ||
| 56 | 浮点计算路径中的两块等大临时空间分别用于工作数据和比较掩码,额外的32字节用于标量临时块。`DT_BF16`输入在进入Sign TileOp前会通过AutoCast转换为`DT_FP32`,因此按`DT_FP32`路径申请临时空间;计算完成后,结果再转换回`DT_BF16`。 | 56 | 浮点计算路径中的两块等大临时空间分别用于工作数据和比较掩码,额外的32字节用于标量临时块。`DT_BF16`输入在进入Sign TileOp前会通过AutoCast转换为`DT_FP32`,因此按`DT_FP32`路径申请临时空间;计算完成后,结果再转换回`DT_BF16`。 |
| 57 | -3. Tensor类型输入不支持`TileOpFormat.TILEOP_NZ`格式。 | 57 | +3. Tensor数据类型说明: |
| 58 | + <!-- npu="950" id4 --> | ||
| 59 | + - Ascend 950PR/Ascend 950DT:DT_FP16,DT_BF16,DT_FP32,DT_INT8,DT_INT16,DT_INT32,DT_INT64。 | ||
| 60 | + <!-- end id4 --> | ||
| 61 | + <!-- npu="A3" id5 --> | ||
| 62 | + - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP16,DT_BF16,DT_FP32,DT_INT8,DT_INT16,DT_INT32。 | ||
| 63 | + <!-- end id5 --> | ||
| 64 | + <!-- npu="910b" id6 --> | ||
| 65 | + - Atlas A2 训练系列产品/Atlas A2 推理系列产品:DT_FP16,DT_BF16,DT_FP32,DT_INT8,DT_INT16,DT_INT32。 | ||
| 66 | + <!-- end id6 --> | ||
| 67 | +4. Tensor类型输入不支持`TileOpFormat.TILEOP_NZ`格式。 | ||
| 58 | 68 | ||
| 59 | ## 调用示例 | 69 | ## 调用示例 |
| 60 | 70 | ||
| @@ -43,7 +43,7 @@ sub(input: Tensor, other: Union[Tensor, float, int]) -> Tensor | |||
| 43 | 2. other为scalar时,若input为浮点类型,则scalar支持整型(自动转为浮点);若input为整型,则scalar不支持浮点类型(会报错)。 | 43 | 2. other为scalar时,若input为浮点类型,则scalar支持整型(自动转为浮点);若input为整型,则scalar不支持浮点类型(会报错)。 |
| 44 | 3. Tensor数据类型说明: | 44 | 3. Tensor数据类型说明: |
| 45 | <!-- npu="950" id4 --> | 45 | <!-- npu="950" id4 --> |
| 46 | - - Ascend 950PR/Ascend 950DT:DT_INT32,DT_FP32,DT_INT16,DT_FP16,DT_BF16,DT_UINT8,DT_INT8 | 46 | + - Ascend 950PR/Ascend 950DT:DT_INT32,DT_FP32,DT_INT16,DT_FP16,DT_BF16,DT_UINT8,DT_INT8,DT_INT64,DT_UINT64 |
| 47 | <!-- end id4 --> | 47 | <!-- end id4 --> |
| 48 | <!-- npu="A3" id5 --> | 48 | <!-- npu="A3" id5 --> |
| 49 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_INT32,DT_INT16,DT_FP16,DT_FP32,DT_BF16 | 49 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_INT32,DT_INT16,DT_FP16,DT_FP32,DT_BF16 |
| @@ -34,7 +34,7 @@ sum(input: Tensor, dim: int, keepdim: bool = False) -> Tensor | |||
| 34 | 34 | ||
| 35 | | 参数名 | 输入/输出 | 说明 | | 35 | | 参数名 | 输入/输出 | 说明 | |
| 36 | |---------|-----------|----------------------------------------------------------------------| | 36 | |---------|-----------|----------------------------------------------------------------------| |
| 37 | -| input | 输入 | 源操作数。<br>支持的类型为:Tensor。<br>Tensor支持的数据类型为:DT_FP32,DT_BF16,DT_INT32,DT_INT16。<br>不支持空Tensor;Shape仅支持1-4维,Shape Size不大于2147483647(即INT32_MAX)。 | | 37 | +| input | 输入 | 源操作数。<br>支持的类型为:Tensor。不同型号支持的数据类型有所差异,详细请参见[约束说明](#约束说明)。<br>不支持空Tensor;Shape仅支持1-4维,Shape Size不大于2147483647(即INT32_MAX)。 | |
| 38 | | dim | 输入 | 指定进行归约的维度。<br>支持任意单轴。 | | 38 | | dim | 输入 | 指定进行归约的维度。<br>支持任意单轴。 | |
| 39 | | keepdim | 输入 | 归约后是否保留被归约的维度。<br>默认值为False。 | | 39 | | keepdim | 输入 | 归约后是否保留被归约的维度。<br>默认值为False。 | |
| 40 | 40 | ||
| @@ -50,7 +50,18 @@ sum(input: Tensor, dim: int, keepdim: bool = False) -> Tensor | |||
| 50 | 50 | ||
| 51 | 1. TileShape大小不超过64KB; | 51 | 1. TileShape大小不超过64KB; |
| 52 | 52 | ||
| 53 | -2. Tensor类型输入不支持`TileOpFormat.TILEOP_NZ`格式。 | 53 | +2. Tensor数据类型说明: |
| 54 | + <!-- npu="950" id4 --> | ||
| 55 | + - Ascend 950PR/Ascend 950DT:DT_FP32,DT_BF16,DT_INT32,DT_INT16,DT_INT64,DT_UINT64。 | ||
| 56 | + <!-- end id4 --> | ||
| 57 | + <!-- npu="A3" id5 --> | ||
| 58 | + - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP32,DT_BF16,DT_INT32,DT_INT16。 | ||
| 59 | + <!-- end id5 --> | ||
| 60 | + <!-- npu="910b" id6 --> | ||
| 61 | + - Atlas A2 训练系列产品/Atlas A2 推理系列产品:DT_FP32,DT_BF16,DT_INT32,DT_INT16。 | ||
| 62 | + <!-- end id6 --> | ||
| 63 | + | ||
| 64 | +3. Tensor类型输入不支持`TileOpFormat.TILEOP_NZ`格式。 | ||
| 54 | 65 | ||
| 55 | ## 调用示例 | 66 | ## 调用示例 |
| 56 | 67 | ||
| @@ -37,7 +37,7 @@ tril(input: Tensor, diagonal: SymInt = 0) -> Tensor | |||
| 37 | 37 | ||
| 38 | 1. Tensor数据类型说明: | 38 | 1. Tensor数据类型说明: |
| 39 | <!-- npu="950" id4 --> | 39 | <!-- npu="950" id4 --> |
| 40 | - - Ascend 950PR/Ascend 950DT:DT_FP32,DT_FP16,DT_BF16,DT_INT8,DT_INT16,DT_INT32,DT_UINT16,DT_UINT32 | 40 | + - Ascend 950PR/Ascend 950DT:DT_FP32,DT_FP16,DT_BF16,DT_INT8,DT_INT16,DT_INT32,DT_UINT16,DT_UINT32,DT_INT64,DT_UINT64 |
| 41 | <!-- end id4 --> | 41 | <!-- end id4 --> |
| 42 | <!-- npu="A3" id5 --> | 42 | <!-- npu="A3" id5 --> |
| 43 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP32,DT_FP16,DT_BF16,DT_INT8,DT_INT16,DT_INT32 | 43 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP32,DT_FP16,DT_BF16,DT_INT8,DT_INT16,DT_INT32 |
| @@ -37,7 +37,7 @@ triu(input: Tensor, diagonal: SymInt = 0) -> Tensor | |||
| 37 | 37 | ||
| 38 | 1. Tensor数据类型说明: | 38 | 1. Tensor数据类型说明: |
| 39 | <!-- npu="950" id4 --> | 39 | <!-- npu="950" id4 --> |
| 40 | - - Ascend 950PR/Ascend 950DT:DT_FP32,DT_FP16,DT_BF16,DT_INT8,DT_INT16,DT_INT32,DT_UINT16,DT_UINT32 | 40 | + - Ascend 950PR/Ascend 950DT:DT_FP32,DT_FP16,DT_BF16,DT_INT8,DT_INT16,DT_INT32,DT_UINT16,DT_UINT32,DT_INT64,DT_UINT64 |
| 41 | <!-- end id4 --> | 41 | <!-- end id4 --> |
| 42 | <!-- npu="A3" id5 --> | 42 | <!-- npu="A3" id5 --> |
| 43 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP32,DT_FP16,DT_BF16,DT_INT8,DT_INT16,DT_INT32 | 43 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_FP32,DT_FP16,DT_BF16,DT_INT8,DT_INT16,DT_INT32 |
| @@ -68,7 +68,7 @@ result :Tensor,Shape由输入的广播得到,详细广播场景可看上 | |||
| 68 | 2. condition、input(如果是tensor)、other(如果是tensor)的维度必须相同。例如condition:[64],input:[2, 64],other:[2, 64]这种情况非法,应当设置为condition:[1, 64],input:[2, 64],other:[2, 64]。 | 68 | 2. condition、input(如果是tensor)、other(如果是tensor)的维度必须相同。例如condition:[64],input:[2, 64],other:[2, 64]这种情况非法,应当设置为condition:[1, 64],input:[2, 64],other:[2, 64]。 |
| 69 | 3. input和other的Tensor、Element数据类型说明: | 69 | 3. input和other的Tensor、Element数据类型说明: |
| 70 | <!-- npu="950" id4 --> | 70 | <!-- npu="950" id4 --> |
| 71 | - - Ascend 950PR/Ascend 950DT:DT_INT32,DT_FP32,DT_INT16,DT_FP16,DT_BF16,DT_UINT8,DT_INT8 | 71 | + - Ascend 950PR/Ascend 950DT:DT_INT32,DT_FP32,DT_INT16,DT_FP16,DT_BF16,DT_UINT8,DT_INT8,DT_INT64,DT_UINT64 |
| 72 | <!-- end id4 --> | 72 | <!-- end id4 --> |
| 73 | <!-- npu="A3" id5 --> | 73 | <!-- npu="A3" id5 --> |
| 74 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_INT32,DT_INT16,DT_FP16,DT_FP32,DT_BF16 | 74 | - Atlas A3 训练系列产品/Atlas A3 推理系列产品:DT_INT32,DT_INT16,DT_FP16,DT_FP32,DT_BF16 |
| @@ -174,7 +174,7 @@ std::string CodeGenOpNPU::GenDupOp() const | |||
| 174 | << "SCALAR attribute must be float value, data type: " << DataType2String(extOperandVal.GetDataType()); | 174 | << "SCALAR attribute must be float value, data type: " << DataType2String(extOperandVal.GetDataType()); |
| 175 | dupV = FormatFloat(extOperandVal.Cast<float>(), operandDtype[ToUnderlying(MISOIdx::DST_IDX)]); | 175 | dupV = FormatFloat(extOperandVal.Cast<float>(), operandDtype[ToUnderlying(MISOIdx::DST_IDX)]); |
| 176 | } else if (dstDtypeStr == "bool" || dstDtypeStr == "int8_t" || dstDtypeStr == "int16_t" || | 176 | } else if (dstDtypeStr == "bool" || dstDtypeStr == "int8_t" || dstDtypeStr == "int16_t" || |
| 177 | - dstDtypeStr == "int32_t") { | 177 | + dstDtypeStr == "int32_t" || dstDtypeStr == "int64_t") { |
| 178 | ASSERT(OperErr::ATTRIBUTE_INVALID, extOperandVal.IsSigned()) | 178 | ASSERT(OperErr::ATTRIBUTE_INVALID, extOperandVal.IsSigned()) |
| 179 | << "SCALAR attribute has to be int value, data type: " << DataType2String(extOperandVal.GetDataType()); | 179 | << "SCALAR attribute has to be int value, data type: " << DataType2String(extOperandVal.GetDataType()); |
| 180 | dupV = std::to_string(extOperandVal.Cast<int64_t>()); | 180 | dupV = std::to_string(extOperandVal.Cast<int64_t>()); |
| @@ -341,4 +341,17 @@ const std::unordered_set<DataType>& GetSupportedDataTypesByArch(const std::unord | |||
| 341 | bool isA5Architecture = (Platform::Instance().GetSoc().GetNPUArch() == NPUArch::DAV_3510); | 341 | bool isA5Architecture = (Platform::Instance().GetSoc().GetNPUArch() == NPUArch::DAV_3510); |
| 342 | return isA5Architecture ? a5Types : a2a3Types; | 342 | return isA5Architecture ? a5Types : a2a3Types; |
| 343 | } | 343 | } |
| 344 | + | ||
| 345 | +void CheckInt64Broadcast(const LogicalTensorPtr& tensor1, const LogicalTensorPtr& tensor2, const std::string& opName) | ||
| 346 | +{ | ||
| 347 | + auto dtype = tensor1->Datatype(); | ||
| 348 | + if (dtype != DT_INT64 && dtype != DT_UINT64) { | ||
| 349 | + return; | ||
| 350 | + } | ||
| 351 | + auto broadcastAxes = GetBroadcastAxes(tensor1->shape, tensor2->shape); | ||
| 352 | + if (!broadcastAxes.empty()) { | ||
| 353 | + CHECK(VectorErrorCode::ERR_PARAM_DTYPE_UNSUPPORTED, false) | ||
| 354 | + << opName << ": broadcast is not supported for int64/uint64 dtype on current device"; | ||
| 355 | + } | ||
| 356 | +} | ||
| 344 | } // namespace npu::tile_fwk | 357 | } // namespace npu::tile_fwk |
| @@ -105,6 +105,7 @@ void CheckTensorsFormatConsistency(const LogicalTensorPtr& tensor1, const Logica | |||
| 105 | void CheckTensorsFormatConsistency(const std::vector<LogicalTensorPtr>& tensors, const std::string& opName); | 105 | void CheckTensorsFormatConsistency(const std::vector<LogicalTensorPtr>& tensors, const std::string& opName); |
| 106 | void CheckBinaryInputTensors(const LogicalTensorPtr& tensor1, const LogicalTensorPtr& tensor2, | 106 | void CheckBinaryInputTensors(const LogicalTensorPtr& tensor1, const LogicalTensorPtr& tensor2, |
| 107 | const std::string& opName); | 107 | const std::string& opName); |
| 108 | +void CheckInt64Broadcast(const LogicalTensorPtr& tensor1, const LogicalTensorPtr& tensor2, const std::string& opName); | ||
| 108 | 109 | ||
| 109 | const std::unordered_set<DataType>& GetSupportedDataTypesByArch(const std::unordered_set<DataType>& a2a3Types, | 110 | const std::unordered_set<DataType>& GetSupportedDataTypesByArch(const std::unordered_set<DataType>& a2a3Types, |
| 110 | const std::unordered_set<DataType>& a5Types); | 111 | const std::unordered_set<DataType>& a5Types); |
| @@ -24,6 +24,15 @@ | |||
| 24 | #include "passes/tile_graph_pass/graph_constraint/axis_combine.h" | 24 | #include "passes/tile_graph_pass/graph_constraint/axis_combine.h" |
| 25 | namespace npu::tile_fwk { | 25 | namespace npu::tile_fwk { |
| 26 | 26 | ||
| 27 | +// 按目标 dtype 构造整型标量 Element:int64 不经 float 中转,避免大值精度丢失。 | ||
| 28 | +static Element CastScalarToDtype(const Element& scalar, DataType dtype) | ||
| 29 | +{ | ||
| 30 | + if (dtype == DT_INT64) { | ||
| 31 | + return Element(dtype, scalar.Cast<int64_t>()); | ||
| 32 | + } | ||
| 33 | + return Element(dtype, scalar.Cast<float>()); | ||
| 34 | +} | ||
| 35 | + | ||
| 27 | std::vector<int64_t> BinaryOperationResultShape(LogicalTensorPtr operand1, LogicalTensorPtr operand2) | 36 | std::vector<int64_t> BinaryOperationResultShape(LogicalTensorPtr operand1, LogicalTensorPtr operand2) |
| 28 | { | 37 | { |
| 29 | std::vector<int64_t> resultShape(operand1->shape.size()); | 38 | std::vector<int64_t> resultShape(operand1->shape.size()); |
| @@ -155,9 +164,10 @@ void TiledBinaryOperation(Function& function, const TileShape& tileShape, size_t | |||
| 155 | auto tmpShape = resultTileInfo.shape; | 164 | auto tmpShape = resultTileInfo.shape; |
| 156 | auto alignSize = BLOCK_SIZE / BytesOf(result->Datatype()); | 165 | auto alignSize = BLOCK_SIZE / BytesOf(result->Datatype()); |
| 157 | tmpShape[resultTileInfo.shape.size() - 1] = AlignUp(tmpShape.back(), alignSize) * 6; | 166 | tmpShape[resultTileInfo.shape.size() - 1] = AlignUp(tmpShape.back(), alignSize) * 6; |
| 167 | + auto tmpElemBytes = result->Datatype() == DT_INT64 ? BytesOf(DT_INT64) : BytesOf(DT_FP32); | ||
| 158 | int64_t intermediateBytes = std::accumulate(tmpShape.begin(), tmpShape.end(), 1LL, | 168 | int64_t intermediateBytes = std::accumulate(tmpShape.begin(), tmpShape.end(), 1LL, |
| 159 | std::multiplies<int64_t>()) * | 169 | std::multiplies<int64_t>()) * |
| 160 | - BytesOf(DT_FP32); | 170 | + tmpElemBytes; |
| 161 | auto tempTensor = std::make_shared<LogicalTensor>(function, DT_UINT8, | 171 | auto tempTensor = std::make_shared<LogicalTensor>(function, DT_UINT8, |
| 162 | std::vector<int64_t>{intermediateBytes}); | 172 | std::vector<int64_t>{intermediateBytes}); |
| 163 | op = &function.AddOperation(GetBinaryOpNameCode<T, false, false>(), {inputTile1, inputTile2}, | 173 | op = &function.AddOperation(GetBinaryOpNameCode<T, false, false>(), {inputTile1, inputTile2}, |
| @@ -392,10 +402,11 @@ Tensor Add(const Tensor& self, const Tensor& other) | |||
| 392 | CheckTensorsDataTypeConsistency(self.GetStorage(), other.GetStorage(), "ADD"); | 402 | CheckTensorsDataTypeConsistency(self.GetStorage(), other.GetStorage(), "ADD"); |
| 393 | 403 | ||
| 394 | static const std::unordered_set<DataType> ADD_A2A3_TYPES = {DT_INT32, DT_INT16, DT_FP16, DT_FP32, DT_BF16}; | 404 | static const std::unordered_set<DataType> ADD_A2A3_TYPES = {DT_INT32, DT_INT16, DT_FP16, DT_FP32, DT_BF16}; |
| 395 | - static const std::unordered_set<DataType> ADD_A5_TYPES = {DT_INT32, DT_FP32, DT_INT16, DT_FP16, | 405 | + static const std::unordered_set<DataType> ADD_A5_TYPES = {DT_INT32, DT_FP32, DT_INT16, DT_FP16, DT_BF16, |
| 396 | - DT_BF16, DT_UINT8, DT_INT8}; | 406 | + DT_UINT8, DT_INT8, DT_INT64, DT_UINT64}; |
| 397 | const auto& supportedTypes = GetSupportedDataTypesByArch(ADD_A2A3_TYPES, ADD_A5_TYPES); | 407 | const auto& supportedTypes = GetSupportedDataTypesByArch(ADD_A2A3_TYPES, ADD_A5_TYPES); |
| 398 | CheckTensorDataType(self.GetStorage(), supportedTypes, "ADD"); | 408 | CheckTensorDataType(self.GetStorage(), supportedTypes, "ADD"); |
| 409 | + CheckInt64Broadcast(self.GetStorage(), other.GetStorage(), "ADD"); | ||
| 399 | RETURN_CALL(BinaryOperation<BinaryOpType::ADD>, *Program::GetInstance().GetCurrentFunction(), self, other); | 410 | RETURN_CALL(BinaryOperation<BinaryOpType::ADD>, *Program::GetInstance().GetCurrentFunction(), self, other); |
| 400 | } | 411 | } |
| 401 | 412 | ||
| @@ -408,10 +419,11 @@ Tensor Sub(const Tensor& self, const Tensor& other) | |||
| 408 | CheckTensorsDataTypeConsistency(self.GetStorage(), other.GetStorage(), "SUB"); | 419 | CheckTensorsDataTypeConsistency(self.GetStorage(), other.GetStorage(), "SUB"); |
| 409 | 420 | ||
| 410 | static const std::unordered_set<DataType> SUB_A2A3_TYPES = {DT_INT32, DT_INT16, DT_FP16, DT_FP32, DT_BF16}; | 421 | static const std::unordered_set<DataType> SUB_A2A3_TYPES = {DT_INT32, DT_INT16, DT_FP16, DT_FP32, DT_BF16}; |
| 411 | - static const std::unordered_set<DataType> SUB_A5_TYPES = {DT_INT32, DT_FP32, DT_INT16, DT_FP16, | 422 | + static const std::unordered_set<DataType> SUB_A5_TYPES = {DT_INT32, DT_FP32, DT_INT16, DT_FP16, DT_BF16, |
| 412 | - DT_BF16, DT_UINT8, DT_INT8}; | 423 | + DT_UINT8, DT_INT8, DT_INT64, DT_UINT64}; |
| 413 | const auto& supportedTypes = GetSupportedDataTypesByArch(SUB_A2A3_TYPES, SUB_A5_TYPES); | 424 | const auto& supportedTypes = GetSupportedDataTypesByArch(SUB_A2A3_TYPES, SUB_A5_TYPES); |
| 414 | CheckTensorDataType(self.GetStorage(), supportedTypes, "SUB"); | 425 | CheckTensorDataType(self.GetStorage(), supportedTypes, "SUB"); |
| 426 | + CheckInt64Broadcast(self.GetStorage(), other.GetStorage(), "SUB"); | ||
| 415 | RETURN_CALL(BinaryOperation<BinaryOpType::SUB>, *Program::GetInstance().GetCurrentFunction(), self, other); | 427 | RETURN_CALL(BinaryOperation<BinaryOpType::SUB>, *Program::GetInstance().GetCurrentFunction(), self, other); |
| 416 | } | 428 | } |
| 417 | 429 | ||
| @@ -424,9 +436,11 @@ Tensor Mul(const Tensor& self, const Tensor& other) | |||
| 424 | CheckTensorsDataTypeConsistency(self.GetStorage(), other.GetStorage(), "MUL"); | 436 | CheckTensorsDataTypeConsistency(self.GetStorage(), other.GetStorage(), "MUL"); |
| 425 | 437 | ||
| 426 | static const std::unordered_set<DataType> MUL_A2A3_TYPES = {DT_INT32, DT_INT16, DT_FP16, DT_FP32, DT_BF16}; | 438 | static const std::unordered_set<DataType> MUL_A2A3_TYPES = {DT_INT32, DT_INT16, DT_FP16, DT_FP32, DT_BF16}; |
| 427 | - static const std::unordered_set<DataType> MUL_A5_TYPES = {DT_INT32, DT_FP32, DT_INT16, DT_FP16, DT_BF16}; | 439 | + static const std::unordered_set<DataType> MUL_A5_TYPES = {DT_INT32, DT_FP32, DT_INT16, DT_FP16, |
| 440 | + DT_BF16, DT_INT64, DT_UINT64}; | ||
| 428 | const auto& supportedTypes = GetSupportedDataTypesByArch(MUL_A2A3_TYPES, MUL_A5_TYPES); | 441 | const auto& supportedTypes = GetSupportedDataTypesByArch(MUL_A2A3_TYPES, MUL_A5_TYPES); |
| 429 | CheckTensorDataType(self.GetStorage(), supportedTypes, "MUL"); | 442 | CheckTensorDataType(self.GetStorage(), supportedTypes, "MUL"); |
| 443 | + CheckInt64Broadcast(self.GetStorage(), other.GetStorage(), "MUL"); | ||
| 430 | RETURN_CALL(BinaryOperation<BinaryOpType::MUL>, *Program::GetInstance().GetCurrentFunction(), self, other); | 444 | RETURN_CALL(BinaryOperation<BinaryOpType::MUL>, *Program::GetInstance().GetCurrentFunction(), self, other); |
| 431 | } | 445 | } |
| 432 | 446 | ||
| @@ -439,10 +453,12 @@ Tensor Div(const Tensor& self, const Tensor& other, PrecisionType precisionType) | |||
| 439 | CheckTensorsDataTypeConsistency(self.GetStorage(), other.GetStorage(), "DIV"); | 453 | CheckTensorsDataTypeConsistency(self.GetStorage(), other.GetStorage(), "DIV"); |
| 440 | 454 | ||
| 441 | static const std::unordered_set<DataType> DIV_A2A3_TYPES = {DT_FP16, DT_FP32, DT_BF16, DT_INT16, DT_INT32}; | 455 | static const std::unordered_set<DataType> DIV_A2A3_TYPES = {DT_FP16, DT_FP32, DT_BF16, DT_INT16, DT_INT32}; |
| 442 | - static const std::unordered_set<DataType> DIV_A5_TYPES = {DT_FP16, DT_FP32, DT_BF16, DT_INT16, DT_INT32}; | 456 | + static const std::unordered_set<DataType> DIV_A5_TYPES = {DT_FP16, DT_FP32, DT_BF16, DT_INT16, |
| 457 | + DT_INT32, DT_INT64, DT_UINT64}; | ||
| 443 | const auto& supportedTypes = GetSupportedDataTypesByArch(DIV_A2A3_TYPES, DIV_A5_TYPES); | 458 | const auto& supportedTypes = GetSupportedDataTypesByArch(DIV_A2A3_TYPES, DIV_A5_TYPES); |
| 444 | auto isDivSupportedInt = [](DataType dt) { return dt == DT_INT16 || dt == DT_INT32; }; | 459 | auto isDivSupportedInt = [](DataType dt) { return dt == DT_INT16 || dt == DT_INT32; }; |
| 445 | CheckTensorDataType(self.GetStorage(), supportedTypes, "DIV"); | 460 | CheckTensorDataType(self.GetStorage(), supportedTypes, "DIV"); |
| 461 | + CheckInt64Broadcast(self.GetStorage(), other.GetStorage(), "DIV"); | ||
| 446 | 462 | ||
| 447 | if (isDivSupportedInt(self.GetDataType())) { | 463 | if (isDivSupportedInt(self.GetDataType())) { |
| 448 | Tensor castSelf = Cast(self, DT_FP32, CastMode::CAST_NONE, SaturationMode::ON); | 464 | Tensor castSelf = Cast(self, DT_FP32, CastMode::CAST_NONE, SaturationMode::ON); |
| @@ -490,8 +506,11 @@ Tensor Remainder(const Tensor& self, const Tensor& other, PrecisionType precisio | |||
| 490 | CheckTensorFormat(other.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Remainder"); | 506 | CheckTensorFormat(other.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Remainder"); |
| 491 | 507 | ||
| 492 | CheckTensorsDataTypeConsistency(self.GetStorage(), other.GetStorage(), "REM"); | 508 | CheckTensorsDataTypeConsistency(self.GetStorage(), other.GetStorage(), "REM"); |
| 493 | - std::unordered_set<DataType> supportedTypes = {DT_FP16, DT_BF16, DT_INT16, DT_INT32, DT_FP32}; | 509 | + static const std::unordered_set<DataType> REM_A2A3_TYPES = {DT_FP16, DT_BF16, DT_INT16, DT_INT32, DT_FP32}; |
| 510 | + static const std::unordered_set<DataType> REM_A5_TYPES = {DT_FP16, DT_BF16, DT_INT16, DT_INT32, DT_FP32, DT_INT64}; | ||
| 511 | + const auto& supportedTypes = GetSupportedDataTypesByArch(REM_A2A3_TYPES, REM_A5_TYPES); | ||
| 494 | CheckTensorDataType(self.GetStorage(), supportedTypes, "REM"); | 512 | CheckTensorDataType(self.GetStorage(), supportedTypes, "REM"); |
| 513 | + CheckInt64Broadcast(self.GetStorage(), other.GetStorage(), "REM"); | ||
| 495 | auto selfDtype = self.GetDataType(); | 514 | auto selfDtype = self.GetDataType(); |
| 496 | bool isA5Architecture = (Platform::Instance().GetSoc().GetNPUArch() == NPUArch::DAV_3510); | 515 | bool isA5Architecture = (Platform::Instance().GetSoc().GetNPUArch() == NPUArch::DAV_3510); |
| 497 | if ((!isA5Architecture && selfDtype == DT_INT16) || selfDtype == DT_FP16) { | 516 | if ((!isA5Architecture && selfDtype == DT_INT16) || selfDtype == DT_FP16) { |
| @@ -518,10 +537,11 @@ Tensor Maximum(const Tensor& operand1, const Tensor& operand2) | |||
| 518 | CheckTensorsDataTypeConsistency(operand1.GetStorage(), operand2.GetStorage(), "MAXIMUM"); | 537 | CheckTensorsDataTypeConsistency(operand1.GetStorage(), operand2.GetStorage(), "MAXIMUM"); |
| 519 | 538 | ||
| 520 | static const std::unordered_set<DataType> MAX_A2A3_TYPES = {DT_INT32, DT_INT16, DT_FP16, DT_FP32, DT_BF16}; | 539 | static const std::unordered_set<DataType> MAX_A2A3_TYPES = {DT_INT32, DT_INT16, DT_FP16, DT_FP32, DT_BF16}; |
| 521 | - static const std::unordered_set<DataType> MAX_A5_TYPES = {DT_INT32, DT_UINT32, DT_FP32, DT_INT16, DT_UINT16, | 540 | + static const std::unordered_set<DataType> MAX_A5_TYPES = { |
| 522 | - DT_FP16, DT_BF16, DT_UINT8, DT_INT8}; | 541 | + DT_INT32, DT_UINT32, DT_FP32, DT_INT16, DT_UINT16, DT_FP16, DT_BF16, DT_UINT8, DT_INT8, DT_INT64, DT_UINT64}; |
| 523 | const auto& supportedTypes = GetSupportedDataTypesByArch(MAX_A2A3_TYPES, MAX_A5_TYPES); | 542 | const auto& supportedTypes = GetSupportedDataTypesByArch(MAX_A2A3_TYPES, MAX_A5_TYPES); |
| 524 | CheckTensorDataType(operand1.GetStorage(), supportedTypes, "MAXIMUM"); | 543 | CheckTensorDataType(operand1.GetStorage(), supportedTypes, "MAXIMUM"); |
| 544 | + CheckInt64Broadcast(operand1.GetStorage(), operand2.GetStorage(), "MAXIMUM"); | ||
| 525 | RETURN_CALL(BinaryOperation<BinaryOpType::MAXIMUM>, *Program::GetInstance().GetCurrentFunction(), operand1, | 545 | RETURN_CALL(BinaryOperation<BinaryOpType::MAXIMUM>, *Program::GetInstance().GetCurrentFunction(), operand1, |
| 526 | operand2); | 546 | operand2); |
| 527 | } | 547 | } |
| @@ -535,10 +555,11 @@ Tensor Minimum(const Tensor& operand1, const Tensor& operand2) | |||
| 535 | CheckTensorsDataTypeConsistency(operand1.GetStorage(), operand2.GetStorage(), "MINIMUM"); | 555 | CheckTensorsDataTypeConsistency(operand1.GetStorage(), operand2.GetStorage(), "MINIMUM"); |
| 536 | 556 | ||
| 537 | static const std::unordered_set<DataType> MIN_A2A3_TYPES = {DT_INT32, DT_INT16, DT_FP16, DT_FP32, DT_BF16}; | 557 | static const std::unordered_set<DataType> MIN_A2A3_TYPES = {DT_INT32, DT_INT16, DT_FP16, DT_FP32, DT_BF16}; |
| 538 | - static const std::unordered_set<DataType> MIN_A5_TYPES = {DT_INT32, DT_UINT32, DT_FP32, DT_INT16, DT_UINT16, | 558 | + static const std::unordered_set<DataType> MIN_A5_TYPES = { |
| 539 | - DT_FP16, DT_BF16, DT_UINT8, DT_INT8}; | 559 | + DT_INT32, DT_UINT32, DT_FP32, DT_INT16, DT_UINT16, DT_FP16, DT_BF16, DT_UINT8, DT_INT8, DT_INT64, DT_UINT64}; |
| 540 | const auto& supportedTypes = GetSupportedDataTypesByArch(MIN_A2A3_TYPES, MIN_A5_TYPES); | 560 | const auto& supportedTypes = GetSupportedDataTypesByArch(MIN_A2A3_TYPES, MIN_A5_TYPES); |
| 541 | CheckTensorDataType(operand1.GetStorage(), supportedTypes, "MINIMUM"); | 561 | CheckTensorDataType(operand1.GetStorage(), supportedTypes, "MINIMUM"); |
| 562 | + CheckInt64Broadcast(operand1.GetStorage(), operand2.GetStorage(), "MINIMUM"); | ||
| 542 | RETURN_CALL(BinaryOperation<BinaryOpType::MINIMUM>, *Program::GetInstance().GetCurrentFunction(), operand1, | 563 | RETURN_CALL(BinaryOperation<BinaryOpType::MINIMUM>, *Program::GetInstance().GetCurrentFunction(), operand1, |
| 543 | operand2); | 564 | operand2); |
| 544 | } | 565 | } |
| @@ -823,7 +844,11 @@ Tensor FloorDiv(const Tensor& self, const Tensor& other) | |||
| 823 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "FLOORDIV"); | 844 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "FLOORDIV"); |
| 824 | CheckTensorFormat(other.GetStorage(), {TileOpFormat::TILEOP_NZ}, "FLOORDIV"); | 845 | CheckTensorFormat(other.GetStorage(), {TileOpFormat::TILEOP_NZ}, "FLOORDIV"); |
| 825 | 846 | ||
| 826 | - std::unordered_set<DataType> supportedTypes = {DT_FP16, DT_BF16, DT_FP32, DT_INT32, DT_INT8, DT_UINT8}; | 847 | + static const std::unordered_set<DataType> FLOORDIV_A2A3_TYPES = {DT_FP16, DT_BF16, DT_FP32, |
| 848 | + DT_INT32, DT_INT8, DT_UINT8}; | ||
| 849 | + static const std::unordered_set<DataType> FLOORDIV_A5_TYPES = {DT_FP16, DT_BF16, DT_FP32, DT_INT32, | ||
| 850 | + DT_INT8, DT_UINT8, DT_INT64}; | ||
| 851 | + const auto& supportedTypes = GetSupportedDataTypesByArch(FLOORDIV_A2A3_TYPES, FLOORDIV_A5_TYPES); | ||
| 827 | CheckTensorDataType(self.GetStorage(), supportedTypes, "FLOORDIV"); | 852 | CheckTensorDataType(self.GetStorage(), supportedTypes, "FLOORDIV"); |
| 828 | CheckTensorDataType(other.GetStorage(), supportedTypes, "FLOORDIV"); | 853 | CheckTensorDataType(other.GetStorage(), supportedTypes, "FLOORDIV"); |
| 829 | 854 | ||
| @@ -853,9 +878,10 @@ void TiledBinaryOperationScalar(Function& function, const TileShape& tileShape, | |||
| 853 | auto alignSize = BLOCK_SIZE / BytesOf(input1.tensor->Datatype()); | 878 | auto alignSize = BLOCK_SIZE / BytesOf(input1.tensor->Datatype()); |
| 854 | auto tmpShape = resultTileInfo.shape; | 879 | auto tmpShape = resultTileInfo.shape; |
| 855 | tmpShape[resultTileInfo.shape.size() - 1] = AlignUp(tmpShape.back(), alignSize) * 6; | 880 | tmpShape[resultTileInfo.shape.size() - 1] = AlignUp(tmpShape.back(), alignSize) * 6; |
| 881 | + auto tmpElemBytes = input1.tensor->Datatype() == DT_INT64 ? BytesOf(DT_INT64) : BytesOf(DT_FP32); | ||
| 856 | int64_t intermediateBytes = std::accumulate(tmpShape.begin(), tmpShape.end(), 1LL, | 882 | int64_t intermediateBytes = std::accumulate(tmpShape.begin(), tmpShape.end(), 1LL, |
| 857 | std::multiplies<int64_t>()) * | 883 | std::multiplies<int64_t>()) * |
| 858 | - BytesOf(DT_FP32); | 884 | + tmpElemBytes; |
| 859 | auto tempTensor = std::make_shared<LogicalTensor>(function, DT_UINT8, | 885 | auto tempTensor = std::make_shared<LogicalTensor>(function, DT_UINT8, |
| 860 | std::vector<int64_t>{intermediateBytes}); | 886 | std::vector<int64_t>{intermediateBytes}); |
| 861 | auto& tmpOp = function.AddOperation(opNameCode, {inputTile1}, {resultTile, tempTensor}); | 887 | auto& tmpOp = function.AddOperation(opNameCode, {inputTile1}, {resultTile, tempTensor}); |
| @@ -972,8 +998,8 @@ Tensor Add(const Tensor& self, const Element& other) | |||
| 972 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Add"); | 998 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Add"); |
| 973 | 999 | ||
| 974 | static const std::unordered_set<DataType> ADD_A2A3_TYPES = {DT_INT32, DT_INT16, DT_FP16, DT_FP32, DT_BF16}; | 1000 | static const std::unordered_set<DataType> ADD_A2A3_TYPES = {DT_INT32, DT_INT16, DT_FP16, DT_FP32, DT_BF16}; |
| 975 | - static const std::unordered_set<DataType> ADD_A5_TYPES = {DT_INT32, DT_FP32, DT_INT16, DT_FP16, | 1001 | + static const std::unordered_set<DataType> ADD_A5_TYPES = {DT_INT32, DT_FP32, DT_INT16, DT_FP16, DT_BF16, |
| 976 | - DT_BF16, DT_UINT8, DT_INT8}; | 1002 | + DT_UINT8, DT_INT8, DT_INT64, DT_UINT64}; |
| 977 | const auto& supportedTypes = GetSupportedDataTypesByArch(ADD_A2A3_TYPES, ADD_A5_TYPES); | 1003 | const auto& supportedTypes = GetSupportedDataTypesByArch(ADD_A2A3_TYPES, ADD_A5_TYPES); |
| 978 | CheckTensorDataType(self.GetStorage(), supportedTypes, "ADD"); | 1004 | CheckTensorDataType(self.GetStorage(), supportedTypes, "ADD"); |
| 979 | RETURN_CALL(BinaryOperationScalar<BinaryOpType::ADD>, *Program::GetInstance().GetCurrentFunction(), | 1005 | RETURN_CALL(BinaryOperationScalar<BinaryOpType::ADD>, *Program::GetInstance().GetCurrentFunction(), |
| @@ -986,8 +1012,8 @@ Tensor Sub(const Tensor& self, const Element& other) | |||
| 986 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Sub"); | 1012 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Sub"); |
| 987 | 1013 | ||
| 988 | static const std::unordered_set<DataType> SUB_A2A3_TYPES = {DT_INT32, DT_INT16, DT_FP16, DT_FP32, DT_BF16}; | 1014 | static const std::unordered_set<DataType> SUB_A2A3_TYPES = {DT_INT32, DT_INT16, DT_FP16, DT_FP32, DT_BF16}; |
| 989 | - static const std::unordered_set<DataType> SUB_A5_TYPES = {DT_INT32, DT_FP32, DT_INT16, DT_FP16, | 1015 | + static const std::unordered_set<DataType> SUB_A5_TYPES = {DT_INT32, DT_FP32, DT_INT16, DT_FP16, DT_BF16, |
| 990 | - DT_BF16, DT_UINT8, DT_INT8}; | 1016 | + DT_UINT8, DT_INT8, DT_INT64, DT_UINT64}; |
| 991 | const auto& supportedTypes = GetSupportedDataTypesByArch(SUB_A2A3_TYPES, SUB_A5_TYPES); | 1017 | const auto& supportedTypes = GetSupportedDataTypesByArch(SUB_A2A3_TYPES, SUB_A5_TYPES); |
| 992 | CheckTensorDataType(self.GetStorage(), supportedTypes, "SUB"); | 1018 | CheckTensorDataType(self.GetStorage(), supportedTypes, "SUB"); |
| 993 | RETURN_CALL(BinaryOperationScalar<BinaryOpType::SUB>, *Program::GetInstance().GetCurrentFunction(), | 1019 | RETURN_CALL(BinaryOperationScalar<BinaryOpType::SUB>, *Program::GetInstance().GetCurrentFunction(), |
| @@ -1000,7 +1026,8 @@ Tensor Mul(const Tensor& self, const Element& other) | |||
| 1000 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Mul"); | 1026 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Mul"); |
| 1001 | 1027 | ||
| 1002 | static const std::unordered_set<DataType> MUL_A2A3_TYPES = {DT_INT32, DT_INT16, DT_FP16, DT_FP32, DT_BF16}; | 1028 | static const std::unordered_set<DataType> MUL_A2A3_TYPES = {DT_INT32, DT_INT16, DT_FP16, DT_FP32, DT_BF16}; |
| 1003 | - static const std::unordered_set<DataType> MUL_A5_TYPES = {DT_INT32, DT_FP32, DT_INT16, DT_FP16, DT_BF16}; | 1029 | + static const std::unordered_set<DataType> MUL_A5_TYPES = {DT_INT32, DT_FP32, DT_INT16, DT_FP16, |
| 1030 | + DT_BF16, DT_INT64, DT_UINT64}; | ||
| 1004 | const auto& supportedTypes = GetSupportedDataTypesByArch(MUL_A2A3_TYPES, MUL_A5_TYPES); | 1031 | const auto& supportedTypes = GetSupportedDataTypesByArch(MUL_A2A3_TYPES, MUL_A5_TYPES); |
| 1005 | CheckTensorDataType(self.GetStorage(), supportedTypes, "MUL"); | 1032 | CheckTensorDataType(self.GetStorage(), supportedTypes, "MUL"); |
| 1006 | RETURN_CALL(BinaryOperationScalar<BinaryOpType::MUL>, *Program::GetInstance().GetCurrentFunction(), | 1033 | RETURN_CALL(BinaryOperationScalar<BinaryOpType::MUL>, *Program::GetInstance().GetCurrentFunction(), |
| @@ -1013,9 +1040,11 @@ Tensor Div(const Tensor& self, const Element& other, PrecisionType precisionType | |||
| 1013 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Div"); | 1040 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Div"); |
| 1014 | 1041 | ||
| 1015 | static const std::unordered_set<DataType> DIV_A2A3_TYPES = {DT_FP16, DT_FP32, DT_BF16, DT_INT16, DT_INT32}; | 1042 | static const std::unordered_set<DataType> DIV_A2A3_TYPES = {DT_FP16, DT_FP32, DT_BF16, DT_INT16, DT_INT32}; |
| 1016 | - static const std::unordered_set<DataType> DIV_A5_TYPES = {DT_FP16, DT_FP32, DT_BF16, DT_INT16, DT_INT32}; | 1043 | + static const std::unordered_set<DataType> DIV_A5_TYPES = {DT_FP16, DT_FP32, DT_BF16, DT_INT16, |
| 1044 | + DT_INT32, DT_INT64, DT_UINT64}; | ||
| 1017 | const auto& supportedTypes = GetSupportedDataTypesByArch(DIV_A2A3_TYPES, DIV_A5_TYPES); | 1045 | const auto& supportedTypes = GetSupportedDataTypesByArch(DIV_A2A3_TYPES, DIV_A5_TYPES); |
| 1018 | auto isDivSupportedInt = [](DataType dt) { return dt == DT_INT16 || dt == DT_INT32; }; | 1046 | auto isDivSupportedInt = [](DataType dt) { return dt == DT_INT16 || dt == DT_INT32; }; |
| 1047 | + auto isDiv64Int = [](DataType dt) { return dt == DT_INT64 || dt == DT_UINT64; }; | ||
| 1019 | auto isDivSupportedFloat = [](DataType dt) { return dt == DT_FP16 || dt == DT_FP32 || dt == DT_BF16; }; | 1048 | auto isDivSupportedFloat = [](DataType dt) { return dt == DT_FP16 || dt == DT_FP32 || dt == DT_BF16; }; |
| 1020 | auto isDivSupportedScalar = [&](DataType dt) { return isDivSupportedFloat(dt) || isDivSupportedInt(dt); }; | 1049 | auto isDivSupportedScalar = [&](DataType dt) { return isDivSupportedFloat(dt) || isDivSupportedInt(dt); }; |
| 1021 | CheckTensorDataType(self.GetStorage(), supportedTypes, "DIV"); | 1050 | CheckTensorDataType(self.GetStorage(), supportedTypes, "DIV"); |
| @@ -1032,6 +1061,16 @@ Tensor Div(const Tensor& self, const Element& other, PrecisionType precisionType | |||
| 1032 | return Tensor(castResult); | 1061 | return Tensor(castResult); |
| 1033 | } | 1062 | } |
| 1034 | 1063 | ||
| 1064 | + if (isDiv64Int(self.GetDataType())) { | ||
| 1065 | + CHECK(VectorErrorCode::ERR_PARAM_DTYPE_UNSUPPORTED, isDiv64Int(other.GetDataType())) | ||
| 1066 | + << "Scalar dtype incorrect. When self dtype is DT_INT64/DT_UINT64, " | ||
| 1067 | + << "scalar must be DT_INT64 or DT_UINT64, actual is: " << DataType2String(other.GetDataType()); | ||
| 1068 | + auto [result, op] = TensorBinaryOperationScalarWithOp<BinaryOpType::DIV>( | ||
| 1069 | + *Program::GetInstance().GetCurrentFunction(), self.GetStorage(), other); | ||
| 1070 | + op->SetAttribute(OpAttributeKey::precisionType, static_cast<int64_t>(precisionType)); | ||
| 1071 | + return Tensor(result); | ||
| 1072 | + } | ||
| 1073 | + | ||
| 1035 | CHECK(VectorErrorCode::ERR_PARAM_DTYPE_UNSUPPORTED, isDivSupportedScalar(other.GetDataType())) | 1074 | CHECK(VectorErrorCode::ERR_PARAM_DTYPE_UNSUPPORTED, isDivSupportedScalar(other.GetDataType())) |
| 1036 | << "Scalar dtype incorrect. When self dtype is float, " | 1075 | << "Scalar dtype incorrect. When self dtype is float, " |
| 1037 | << "scalar must be float (DT_FP16/DT_FP32/DT_BF16) or integer (DT_INT16/DT_INT32), " | 1076 | << "scalar must be float (DT_FP16/DT_FP32/DT_BF16) or integer (DT_INT16/DT_INT32), " |
| @@ -1080,10 +1119,12 @@ Tensor Remainder(const Tensor& self, const Element& other, PrecisionType precisi | |||
| 1080 | DECLARE_TRACER(); | 1119 | DECLARE_TRACER(); |
| 1081 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Remainder"); | 1120 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Remainder"); |
| 1082 | 1121 | ||
| 1083 | - std::unordered_set<DataType> supportedTypes = {DT_FP16, DT_BF16, DT_INT16, DT_INT32, DT_FP32}; | 1122 | + static const std::unordered_set<DataType> REM_A2A3_TYPES = {DT_FP16, DT_BF16, DT_INT16, DT_INT32, DT_FP32}; |
| 1123 | + static const std::unordered_set<DataType> REM_A5_TYPES = {DT_FP16, DT_BF16, DT_INT16, DT_INT32, DT_FP32, DT_INT64}; | ||
| 1124 | + const auto& supportedTypes = GetSupportedDataTypesByArch(REM_A2A3_TYPES, REM_A5_TYPES); | ||
| 1084 | CheckTensorDataType(self.GetStorage(), supportedTypes, "REM"); | 1125 | CheckTensorDataType(self.GetStorage(), supportedTypes, "REM"); |
| 1085 | auto selfDtype = self.GetDataType(); | 1126 | auto selfDtype = self.GetDataType(); |
| 1086 | - Element castOther = Element(selfDtype, other.Cast<float>()); | 1127 | + Element castOther = CastScalarToDtype(other, selfDtype); |
| 1087 | bool isA5Architecture = (Platform::Instance().GetSoc().GetNPUArch() == NPUArch::DAV_3510); | 1128 | bool isA5Architecture = (Platform::Instance().GetSoc().GetNPUArch() == NPUArch::DAV_3510); |
| 1088 | if ((!isA5Architecture && selfDtype == DT_INT16) || selfDtype == DT_FP16) { | 1129 | if ((!isA5Architecture && selfDtype == DT_INT16) || selfDtype == DT_FP16) { |
| 1089 | Tensor castSelf = Cast(self, DT_FP32, CastMode::CAST_NONE, SaturationMode::ON); | 1130 | Tensor castSelf = Cast(self, DT_FP32, CastMode::CAST_NONE, SaturationMode::ON); |
| @@ -1104,10 +1145,12 @@ Tensor Remainder(const Element& self, const Tensor& other, PrecisionType precisi | |||
| 1104 | DECLARE_TRACER(); | 1145 | DECLARE_TRACER(); |
| 1105 | CheckTensorFormat(other.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Remainder"); | 1146 | CheckTensorFormat(other.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Remainder"); |
| 1106 | 1147 | ||
| 1107 | - std::unordered_set<DataType> supportedTypes = {DT_FP16, DT_BF16, DT_INT16, DT_INT32, DT_FP32}; | 1148 | + static const std::unordered_set<DataType> REM_A2A3_TYPES = {DT_FP16, DT_BF16, DT_INT16, DT_INT32, DT_FP32}; |
| 1149 | + static const std::unordered_set<DataType> REM_A5_TYPES = {DT_FP16, DT_BF16, DT_INT16, DT_INT32, DT_FP32, DT_INT64}; | ||
| 1150 | + const auto& supportedTypes = GetSupportedDataTypesByArch(REM_A2A3_TYPES, REM_A5_TYPES); | ||
| 1108 | CheckTensorDataType(other.GetStorage(), supportedTypes, "REM"); | 1151 | CheckTensorDataType(other.GetStorage(), supportedTypes, "REM"); |
| 1109 | auto otherDtype = other.GetDataType(); | 1152 | auto otherDtype = other.GetDataType(); |
| 1110 | - Element castSelf = Element(otherDtype, self.Cast<float>()); | 1153 | + Element castSelf = CastScalarToDtype(self, otherDtype); |
| 1111 | bool isA5Architecture = (Platform::Instance().GetSoc().GetNPUArch() == NPUArch::DAV_3510); | 1154 | bool isA5Architecture = (Platform::Instance().GetSoc().GetNPUArch() == NPUArch::DAV_3510); |
| 1112 | if ((!isA5Architecture && otherDtype == DT_INT16) || otherDtype == DT_FP16) { | 1155 | if ((!isA5Architecture && otherDtype == DT_INT16) || otherDtype == DT_FP16) { |
| 1113 | Tensor castOther = Cast(other, DT_FP32, CastMode::CAST_NONE, SaturationMode::ON); | 1156 | Tensor castOther = Cast(other, DT_FP32, CastMode::CAST_NONE, SaturationMode::ON); |
| @@ -1175,7 +1218,10 @@ Tensor Maximum(const Tensor& operand1, const Element& operand2) | |||
| 1175 | DECLARE_TRACER(); | 1218 | DECLARE_TRACER(); |
| 1176 | CheckTensorFormat(operand1.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Maximum"); | 1219 | CheckTensorFormat(operand1.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Maximum"); |
| 1177 | 1220 | ||
| 1178 | - std::unordered_set<DataType> supportedTypes = {DT_FP16, DT_BF16, DT_INT16, DT_INT32, DT_FP32}; | 1221 | + static const std::unordered_set<DataType> MAX_A2A3_TYPES = {DT_FP16, DT_BF16, DT_INT16, DT_INT32, DT_FP32}; |
| 1222 | + static const std::unordered_set<DataType> MAX_A5_TYPES = {DT_FP16, DT_BF16, DT_INT16, DT_INT32, | ||
| 1223 | + DT_FP32, DT_INT64, DT_UINT64}; | ||
| 1224 | + const auto& supportedTypes = GetSupportedDataTypesByArch(MAX_A2A3_TYPES, MAX_A5_TYPES); | ||
| 1179 | CheckTensorDataType(operand1.GetStorage(), supportedTypes, "MAX"); | 1225 | CheckTensorDataType(operand1.GetStorage(), supportedTypes, "MAX"); |
| 1180 | RETURN_CALL(BinaryOperationScalar<BinaryOpType::MAX>, *Program::GetInstance().GetCurrentFunction(), | 1226 | RETURN_CALL(BinaryOperationScalar<BinaryOpType::MAX>, *Program::GetInstance().GetCurrentFunction(), |
| 1181 | operand1.GetStorage(), operand2); | 1227 | operand1.GetStorage(), operand2); |
| @@ -1186,7 +1232,10 @@ Tensor Minimum(const Tensor& operand1, const Element& operand2) | |||
| 1186 | DECLARE_TRACER(); | 1232 | DECLARE_TRACER(); |
| 1187 | CheckTensorFormat(operand1.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Minimum"); | 1233 | CheckTensorFormat(operand1.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Minimum"); |
| 1188 | 1234 | ||
| 1189 | - std::unordered_set<DataType> supportedTypes = {DT_FP16, DT_BF16, DT_INT16, DT_INT32, DT_FP32}; | 1235 | + static const std::unordered_set<DataType> MIN_A2A3_TYPES = {DT_FP16, DT_BF16, DT_INT16, DT_INT32, DT_FP32}; |
| 1236 | + static const std::unordered_set<DataType> MIN_A5_TYPES = {DT_FP16, DT_BF16, DT_INT16, DT_INT32, | ||
| 1237 | + DT_FP32, DT_INT64, DT_UINT64}; | ||
| 1238 | + const auto& supportedTypes = GetSupportedDataTypesByArch(MIN_A2A3_TYPES, MIN_A5_TYPES); | ||
| 1190 | CheckTensorDataType(operand1.GetStorage(), supportedTypes, "MIN"); | 1239 | CheckTensorDataType(operand1.GetStorage(), supportedTypes, "MIN"); |
| 1191 | RETURN_CALL(BinaryOperationScalar<BinaryOpType::MIN>, *Program::GetInstance().GetCurrentFunction(), | 1240 | RETURN_CALL(BinaryOperationScalar<BinaryOpType::MIN>, *Program::GetInstance().GetCurrentFunction(), |
| 1192 | operand1.GetStorage(), operand2); | 1241 | operand1.GetStorage(), operand2); |
| @@ -1287,7 +1336,11 @@ Tensor FloorDiv(const Tensor& self, const Element& other) | |||
| 1287 | DECLARE_TRACER(); | 1336 | DECLARE_TRACER(); |
| 1288 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "FLOORDIV"); | 1337 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "FLOORDIV"); |
| 1289 | 1338 | ||
| 1290 | - std::unordered_set<DataType> supportedTypes = {DT_FP16, DT_BF16, DT_FP32, DT_INT32, DT_INT8, DT_UINT8}; | 1339 | + static const std::unordered_set<DataType> FLOORDIVS_A2A3_TYPES = {DT_FP16, DT_BF16, DT_FP32, |
| 1340 | + DT_INT32, DT_INT8, DT_UINT8}; | ||
| 1341 | + static const std::unordered_set<DataType> FLOORDIVS_A5_TYPES = {DT_FP16, DT_BF16, DT_FP32, DT_INT32, | ||
| 1342 | + DT_INT8, DT_UINT8, DT_INT64}; | ||
| 1343 | + const auto& supportedTypes = GetSupportedDataTypesByArch(FLOORDIVS_A2A3_TYPES, FLOORDIVS_A5_TYPES); | ||
| 1291 | CheckTensorDataType(self.GetStorage(), supportedTypes, "FLOORDIV"); | 1344 | CheckTensorDataType(self.GetStorage(), supportedTypes, "FLOORDIV"); |
| 1292 | CHECK(VectorErrorCode::ERR_PARAM_DTYPE_UNSUPPORTED, other.GetDataType() == self.GetDataType()) | 1345 | CHECK(VectorErrorCode::ERR_PARAM_DTYPE_UNSUPPORTED, other.GetDataType() == self.GetDataType()) |
| 1293 | << "Scalar dtype incorrect. Scalar dtype should be same as self dtype, self dtype is: " | 1346 | << "Scalar dtype incorrect. Scalar dtype should be same as self dtype, self dtype is: " |
| @@ -262,8 +262,17 @@ LogicalTensorPtr TensorBitwiseShiftOperationSelfScalar(Function& function, const | |||
| 262 | namespace { | 262 | namespace { |
| 263 | // TODO i8/u8/i32/u32: pending pto-isa additions on a2a3. | 263 | // TODO i8/u8/i32/u32: pending pto-isa additions on a2a3. |
| 264 | const std::unordered_set<DataType> BITWISESHIFT_A2A3_TYPES = {DT_INT16, DT_UINT16}; | 264 | const std::unordered_set<DataType> BITWISESHIFT_A2A3_TYPES = {DT_INT16, DT_UINT16}; |
| 265 | -const std::unordered_set<DataType> BITWISESHIFT_A5_TYPES = {DT_INT16, DT_UINT16, DT_INT32, | 265 | +const std::unordered_set<DataType> BITWISESHIFT_A5_TYPES = {DT_INT16, DT_UINT16, DT_INT32, DT_UINT32, |
| 266 | - DT_UINT32, DT_INT8, DT_UINT8}; | 266 | + DT_INT8, DT_UINT8, DT_INT64, DT_UINT64}; |
| 267 | + | ||
| 268 | +// 按目标 dtype 构造位移标量 Element:uint64 不经 int64 中转,避免大值符号翻转。 | ||
| 269 | +Element CastShiftScalarToDtype(const Element& scalar, DataType dtype) | ||
| 270 | +{ | ||
| 271 | + if (dtype == DT_UINT64) { | ||
| 272 | + return Element(dtype, scalar.Cast<uint64_t>()); | ||
| 273 | + } | ||
| 274 | + return Element(dtype, scalar.Cast<int64_t>()); | ||
| 275 | +} | ||
| 267 | } // namespace | 276 | } // namespace |
| 268 | 277 | ||
| 269 | Tensor BitwiseRightShift(const Tensor& self, const Tensor& other) | 278 | Tensor BitwiseRightShift(const Tensor& self, const Tensor& other) |
| @@ -287,7 +296,7 @@ Tensor BitwiseRightShift(const Tensor& self, const Element& other) | |||
| 287 | CheckTensorDataType(self.GetStorage(), supportedTypes, "BitwiseRightShift"); | 296 | CheckTensorDataType(self.GetStorage(), supportedTypes, "BitwiseRightShift"); |
| 288 | Element newOther = other; | 297 | Element newOther = other; |
| 289 | if (self.GetDataType() != other.GetDataType()) { | 298 | if (self.GetDataType() != other.GetDataType()) { |
| 290 | - newOther = Element(self.GetDataType(), other.Cast<int32_t>()); | 299 | + newOther = CastShiftScalarToDtype(other, self.GetDataType()); |
| 291 | } | 300 | } |
| 292 | RETURN_CALL(BitwiseShiftOperationScalar<BitwiseShiftOpType::BITWISERIGHTSHIFT>, | 301 | RETURN_CALL(BitwiseShiftOperationScalar<BitwiseShiftOpType::BITWISERIGHTSHIFT>, |
| 293 | *Program::GetInstance().GetCurrentFunction(), self.GetStorage(), newOther); | 302 | *Program::GetInstance().GetCurrentFunction(), self.GetStorage(), newOther); |
| @@ -302,7 +311,7 @@ Tensor BitwiseRightShift(const Element& self, const Tensor& other) | |||
| 302 | CheckTensorDataType(other.GetStorage(), supportedTypes, "BitwiseRightShift"); | 311 | CheckTensorDataType(other.GetStorage(), supportedTypes, "BitwiseRightShift"); |
| 303 | Element newSelf = self; | 312 | Element newSelf = self; |
| 304 | if (self.GetDataType() != other.GetDataType()) { | 313 | if (self.GetDataType() != other.GetDataType()) { |
| 305 | - newSelf = Element(other.GetDataType(), self.Cast<int32_t>()); | 314 | + newSelf = CastShiftScalarToDtype(self, other.GetDataType()); |
| 306 | } | 315 | } |
| 307 | RETURN_CALL(BitwiseShiftOperationSelfScalar<BitwiseShiftOpType::SBITWISERIGHTSHIFT>, | 316 | RETURN_CALL(BitwiseShiftOperationSelfScalar<BitwiseShiftOpType::SBITWISERIGHTSHIFT>, |
| 308 | *Program::GetInstance().GetCurrentFunction(), newSelf, other.GetStorage()); | 317 | *Program::GetInstance().GetCurrentFunction(), newSelf, other.GetStorage()); |
| @@ -328,7 +337,7 @@ Tensor BitwiseLeftShift(const Tensor& self, const Element& other) | |||
| 328 | CheckTensorDataType(self.GetStorage(), supportedTypes, "BitwiseLeftShift"); | 337 | CheckTensorDataType(self.GetStorage(), supportedTypes, "BitwiseLeftShift"); |
| 329 | Element newOther = other; | 338 | Element newOther = other; |
| 330 | if (self.GetDataType() != other.GetDataType()) { | 339 | if (self.GetDataType() != other.GetDataType()) { |
| 331 | - newOther = Element(self.GetDataType(), other.Cast<int32_t>()); | 340 | + newOther = CastShiftScalarToDtype(other, self.GetDataType()); |
| 332 | } | 341 | } |
| 333 | RETURN_CALL(BitwiseShiftOperationScalar<BitwiseShiftOpType::BITWISELEFTSHIFT>, | 342 | RETURN_CALL(BitwiseShiftOperationScalar<BitwiseShiftOpType::BITWISELEFTSHIFT>, |
| 334 | *Program::GetInstance().GetCurrentFunction(), self.GetStorage(), newOther); | 343 | *Program::GetInstance().GetCurrentFunction(), self.GetStorage(), newOther); |
| @@ -343,7 +352,7 @@ Tensor BitwiseLeftShift(const Element& self, const Tensor& other) | |||
| 343 | CheckTensorDataType(other.GetStorage(), supportedTypes, "BitwiseLeftShift"); | 352 | CheckTensorDataType(other.GetStorage(), supportedTypes, "BitwiseLeftShift"); |
| 344 | Element newSelf = self; | 353 | Element newSelf = self; |
| 345 | if (self.GetDataType() != other.GetDataType()) { | 354 | if (self.GetDataType() != other.GetDataType()) { |
| 346 | - newSelf = Element(other.GetDataType(), self.Cast<int32_t>()); | 355 | + newSelf = CastShiftScalarToDtype(self, other.GetDataType()); |
| 347 | } | 356 | } |
| 348 | RETURN_CALL(BitwiseShiftOperationSelfScalar<BitwiseShiftOpType::SBITWISELEFTSHIFT>, | 357 | RETURN_CALL(BitwiseShiftOperationSelfScalar<BitwiseShiftOpType::SBITWISELEFTSHIFT>, |
| 349 | *Program::GetInstance().GetCurrentFunction(), newSelf, other.GetStorage()); | 358 | *Program::GetInstance().GetCurrentFunction(), newSelf, other.GetStorage()); |
| @@ -306,7 +306,7 @@ Tensor Compare(const Tensor& self, const Tensor& other, OpType op, OutType mode) | |||
| 306 | 306 | ||
| 307 | CheckTensorsDataTypeConsistency(self.GetStorage(), other.GetStorage(), "COMPARE"); | 307 | CheckTensorsDataTypeConsistency(self.GetStorage(), other.GetStorage(), "COMPARE"); |
| 308 | static const std::unordered_set<DataType> CMP_A2A3_TYPES = {DT_FP16, DT_FP32}; | 308 | static const std::unordered_set<DataType> CMP_A2A3_TYPES = {DT_FP16, DT_FP32}; |
| 309 | - static const std::unordered_set<DataType> CMP_A5_TYPES = {DT_FP16, DT_FP32, DT_INT16}; | 309 | + static const std::unordered_set<DataType> CMP_A5_TYPES = {DT_FP16, DT_FP32, DT_INT16, DT_INT64, DT_UINT64}; |
| 310 | const auto& supportedTypes = GetSupportedDataTypesByArch(CMP_A2A3_TYPES, CMP_A5_TYPES); | 310 | const auto& supportedTypes = GetSupportedDataTypesByArch(CMP_A2A3_TYPES, CMP_A5_TYPES); |
| 311 | CheckTensorDataType(self.GetStorage(), supportedTypes, "COMPARE"); | 311 | CheckTensorDataType(self.GetStorage(), supportedTypes, "COMPARE"); |
| 312 | CheckTensorNonEmpty(self.GetStorage(), "COMPARE"); | 312 | CheckTensorNonEmpty(self.GetStorage(), "COMPARE"); |
| @@ -321,7 +321,7 @@ Tensor Compare(const Tensor& self, const Element& other, OpType op, OutType mode | |||
| 321 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Compare"); | 321 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Compare"); |
| 322 | 322 | ||
| 323 | static const std::unordered_set<DataType> CMP_A2A3_TYPES = {DT_FP16, DT_FP32}; | 323 | static const std::unordered_set<DataType> CMP_A2A3_TYPES = {DT_FP16, DT_FP32}; |
| 324 | - static const std::unordered_set<DataType> CMP_A5_TYPES = {DT_FP16, DT_FP32, DT_INT16}; | 324 | + static const std::unordered_set<DataType> CMP_A5_TYPES = {DT_FP16, DT_FP32, DT_INT16, DT_INT64, DT_UINT64}; |
| 325 | const auto& supportedTypes = GetSupportedDataTypesByArch(CMP_A2A3_TYPES, CMP_A5_TYPES); | 325 | const auto& supportedTypes = GetSupportedDataTypesByArch(CMP_A2A3_TYPES, CMP_A5_TYPES); |
| 326 | CheckTensorDataType(self.GetStorage(), supportedTypes, "COMPARE"); | 326 | CheckTensorDataType(self.GetStorage(), supportedTypes, "COMPARE"); |
| 327 | CheckTensorDimRange(self.GetStorage(), 1, 4, "COMPARE"); | 327 | CheckTensorDimRange(self.GetStorage(), 1, 4, "COMPARE"); |
| @@ -336,7 +336,7 @@ Tensor Compare(const Element& self, const Tensor& other, OpType op, OutType mode | |||
| 336 | CheckTensorFormat(other.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Compare"); | 336 | CheckTensorFormat(other.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Compare"); |
| 337 | 337 | ||
| 338 | static const std::unordered_set<DataType> CMP_A2A3_TYPES = {DT_FP16, DT_FP32}; | 338 | static const std::unordered_set<DataType> CMP_A2A3_TYPES = {DT_FP16, DT_FP32}; |
| 339 | - static const std::unordered_set<DataType> CMP_A5_TYPES = {DT_FP16, DT_FP32, DT_INT16}; | 339 | + static const std::unordered_set<DataType> CMP_A5_TYPES = {DT_FP16, DT_FP32, DT_INT16, DT_INT64, DT_UINT64}; |
| 340 | const auto& supportedTypes = GetSupportedDataTypesByArch(CMP_A2A3_TYPES, CMP_A5_TYPES); | 340 | const auto& supportedTypes = GetSupportedDataTypesByArch(CMP_A2A3_TYPES, CMP_A5_TYPES); |
| 341 | CheckTensorDataType(other.GetStorage(), supportedTypes, "COMPARE"); | 341 | CheckTensorDataType(other.GetStorage(), supportedTypes, "COMPARE"); |
| 342 | CheckTensorDimRange(other.GetStorage(), 1, 4, "COMPARE"); | 342 | CheckTensorDimRange(other.GetStorage(), 1, 4, "COMPARE"); |
| @@ -23,6 +23,7 @@ | |||
| 23 | #include "interface/operation/operation_common.h" | 23 | #include "interface/operation/operation_common.h" |
| 24 | #include "tensor_transformation.h" | 24 | #include "tensor_transformation.h" |
| 25 | #include "tilefwk/error_code.h" | 25 | #include "tilefwk/error_code.h" |
| 26 | +#include "tilefwk/platform.h" | ||
| 26 | 27 | ||
| 27 | namespace npu::tile_fwk { | 28 | namespace npu::tile_fwk { |
| 28 | 29 | ||
| @@ -679,8 +680,8 @@ Tensor GatherElements(const Tensor& params, const Tensor& indices, int axis) | |||
| 679 | } | 680 | } |
| 680 | static const std::unordered_set<DataType> a2a3Types = {DT_FP32, DT_FP16, DT_BF16, DT_INT32, | 681 | static const std::unordered_set<DataType> a2a3Types = {DT_FP32, DT_FP16, DT_BF16, DT_INT32, |
| 681 | DT_UINT32, DT_INT16, DT_UINT16}; | 682 | DT_UINT32, DT_INT16, DT_UINT16}; |
| 682 | - static const std::unordered_set<DataType> a5Types = {DT_FP32, DT_FP16, DT_BF16, DT_INT32, | 683 | + static const std::unordered_set<DataType> a5Types = {DT_FP32, DT_FP16, DT_BF16, DT_INT32, DT_UINT32, |
| 683 | - DT_UINT32, DT_INT16, DT_UINT16}; | 684 | + DT_INT16, DT_UINT16, DT_INT64, DT_UINT64}; |
| 684 | const auto& supportedTypes = GetSupportedDataTypesByArch(a2a3Types, a5Types); | 685 | const auto& supportedTypes = GetSupportedDataTypesByArch(a2a3Types, a5Types); |
| 685 | CheckTensorDataType(params.GetStorage(), supportedTypes, "GATHERELEMENTS"); | 686 | CheckTensorDataType(params.GetStorage(), supportedTypes, "GATHERELEMENTS"); |
| 686 | std::unordered_set<DataType> indexSupportedTypes = {DT_INT32, DT_INT64}; | 687 | std::unordered_set<DataType> indexSupportedTypes = {DT_INT32, DT_INT64}; |
| @@ -797,7 +798,11 @@ void TensorScatterElementS(Function& function, const ScatterElementSPara& scatte | |||
| 797 | static void CheckScatterElementSParamsInvalid(const Tensor& self, const Tensor& indices, int axis, | 798 | static void CheckScatterElementSParamsInvalid(const Tensor& self, const Tensor& indices, int axis, |
| 798 | const ScatterMode reduce) | 799 | const ScatterMode reduce) |
| 799 | { | 800 | { |
| 800 | - std::unordered_set<DataType> supportedTypes = {DT_FP32, DT_FP16, DT_BF16, DT_INT8, DT_UINT8, DT_INT16, DT_INT32}; | 801 | + static const std::unordered_set<DataType> SCATTER_A2A3_TYPES = {DT_FP32, DT_FP16, DT_BF16, DT_INT8, |
| 802 | + DT_UINT8, DT_INT16, DT_INT32, DT_INT64}; | ||
| 803 | + static const std::unordered_set<DataType> SCATTER_A5_TYPES = {DT_FP32, DT_FP16, DT_BF16, DT_INT8, | ||
| 804 | + DT_UINT8, DT_INT16, DT_INT32, DT_INT64}; | ||
| 805 | + const auto& supportedTypes = GetSupportedDataTypesByArch(SCATTER_A2A3_TYPES, SCATTER_A5_TYPES); | ||
| 801 | CheckTensorDataType(self.GetStorage(), supportedTypes, "SCATTER"); | 806 | CheckTensorDataType(self.GetStorage(), supportedTypes, "SCATTER"); |
| 802 | std::unordered_set<DataType> indexSupportedTypes = {DT_INT32, DT_INT64}; | 807 | std::unordered_set<DataType> indexSupportedTypes = {DT_INT32, DT_INT64}; |
| 803 | CheckTensorDataType(indices.GetStorage(), indexSupportedTypes, "SCATTER"); | 808 | CheckTensorDataType(indices.GetStorage(), indexSupportedTypes, "SCATTER"); |
| @@ -964,7 +969,11 @@ void TensorScatter(Function& function, const ScatterPara& scatterPara) | |||
| 964 | static void CheckScatterParamsInvalid(const Tensor& self, const Tensor& indices, const Tensor& src, int axis, | 969 | static void CheckScatterParamsInvalid(const Tensor& self, const Tensor& indices, const Tensor& src, int axis, |
| 965 | const ScatterMode reduce) | 970 | const ScatterMode reduce) |
| 966 | { | 971 | { |
| 967 | - std::unordered_set<DataType> supportedTypes = {DT_FP32, DT_FP16, DT_BF16, DT_INT8, DT_UINT8, DT_INT16, DT_INT32}; | 972 | + const std::unordered_set<DataType> SCATTER_A2A3_TYPES = {DT_FP32, DT_FP16, DT_BF16, DT_INT8, |
| 973 | + DT_UINT8, DT_INT16, DT_INT32, DT_INT64}; | ||
| 974 | + const std::unordered_set<DataType> SCATTER_A5_TYPES = {DT_FP32, DT_FP16, DT_BF16, DT_INT8, | ||
| 975 | + DT_UINT8, DT_INT16, DT_INT32, DT_INT64}; | ||
| 976 | + const auto& supportedTypes = GetSupportedDataTypesByArch(SCATTER_A2A3_TYPES, SCATTER_A5_TYPES); | ||
| 968 | CheckTensorDataType(self.GetStorage(), supportedTypes, "SCATTER"); | 977 | CheckTensorDataType(self.GetStorage(), supportedTypes, "SCATTER"); |
| 969 | CheckTensorsDataTypeConsistency(self.GetStorage(), src.GetStorage(), "SCATTER"); | 978 | CheckTensorsDataTypeConsistency(self.GetStorage(), src.GetStorage(), "SCATTER"); |
| 970 | std::unordered_set<DataType> indexSupportedTypes = {DT_INT32, DT_INT64}; | 979 | std::unordered_set<DataType> indexSupportedTypes = {DT_INT32, DT_INT64}; |
| @@ -1602,6 +1611,10 @@ DataType GetComputeDataType(const Element& start, const Element& end, const Elem | |||
| 1602 | if (startIsFloat || endIsFloat || stepIsFloat) { | 1611 | if (startIsFloat || endIsFloat || stepIsFloat) { |
| 1603 | return DT_FP32; | 1612 | return DT_FP32; |
| 1604 | } | 1613 | } |
| 1614 | + if (Platform::Instance().GetSoc().GetNPUArch() == NPUArch::DAV_3510 && | ||
| 1615 | + (startType == DT_INT64 || endType == DT_INT64 || stepType == DT_INT64)) { | ||
| 1616 | + return DT_INT64; | ||
| 1617 | + } | ||
| 1605 | int64_t startValue = start.GetSignedData(); | 1618 | int64_t startValue = start.GetSignedData(); |
| 1606 | int64_t endValue = end.GetSignedData(); | 1619 | int64_t endValue = end.GetSignedData(); |
| 1607 | int64_t stepValue = step.GetSignedData(); | 1620 | int64_t stepValue = step.GetSignedData(); |
| @@ -1631,6 +1644,10 @@ DataType GetOutputDataType(const Element& start, const Element& end, const Eleme | |||
| 1631 | if (startType == DT_BF16 || endType == DT_BF16 || stepType == DT_BF16) { | 1644 | if (startType == DT_BF16 || endType == DT_BF16 || stepType == DT_BF16) { |
| 1632 | return DT_BF16; | 1645 | return DT_BF16; |
| 1633 | } | 1646 | } |
| 1647 | + if (Platform::Instance().GetSoc().GetNPUArch() == NPUArch::DAV_3510 && | ||
| 1648 | + (startType == DT_INT64 || endType == DT_INT64 || stepType == DT_INT64)) { | ||
| 1649 | + return DT_INT64; | ||
| 1650 | + } | ||
| 1634 | return DT_INT32; | 1651 | return DT_INT32; |
| 1635 | } | 1652 | } |
| 1636 | 1653 | ||
| @@ -1651,10 +1668,13 @@ Element GetElementWithDataType(const Element& element, DataType dataType) | |||
| 1651 | Tensor Range(const Element& start, const Element& end, const Element& step) | 1668 | Tensor Range(const Element& start, const Element& end, const Element& step) |
| 1652 | { | 1669 | { |
| 1653 | DataType dataType = GetComputeDataType(start, end, step); | 1670 | DataType dataType = GetComputeDataType(start, end, step); |
| 1654 | - if (dataType != DT_FP32 && dataType != DT_INT32) { | 1671 | + if (dataType != DT_FP32 && dataType != DT_INT32 && dataType != DT_INT64) { |
| 1655 | CHECK(VectorErrorCode::ERR_PARAM_DTYPE_UNSUPPORTED, false) | 1672 | CHECK(VectorErrorCode::ERR_PARAM_DTYPE_UNSUPPORTED, false) |
| 1656 | << "Unsupported Output DataType " << DataType2String(dataType); | 1673 | << "Unsupported Output DataType " << DataType2String(dataType); |
| 1657 | } | 1674 | } |
| 1675 | + CHECK(VectorErrorCode::ERR_PARAM_DTYPE_UNSUPPORTED, | ||
| 1676 | + dataType != DT_INT64 || Platform::Instance().GetSoc().GetNPUArch() == NPUArch::DAV_3510) | ||
| 1677 | + << "RANGE: DT_INT64 is only supported on Ascend 950PR/Ascend 950DT architecture."; | ||
| 1658 | DataType outputDataType = DT_INT32; | 1678 | DataType outputDataType = DT_INT32; |
| 1659 | outputDataType = GetOutputDataType(start, end, step); | 1679 | outputDataType = GetOutputDataType(start, end, step); |
| 1660 | 1680 | ||
| @@ -101,8 +101,11 @@ Tensor LogicalNot(const Tensor& self) | |||
| 101 | DECLARE_TRACER(); | 101 | DECLARE_TRACER(); |
| 102 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "LogicalNot"); | 102 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "LogicalNot"); |
| 103 | 103 | ||
| 104 | - std::unordered_set<DataType> supportedTypes = {DT_FP32, DT_FP16, DT_UINT8, DT_INT8, DT_BOOL, | 104 | + static const std::unordered_set<DataType> LOGICALNOT_A2A3_TYPES = { |
| 105 | - DT_BF16, DT_INT16, DT_INT32, DT_UINT16, DT_UINT32}; | 105 | + DT_FP32, DT_FP16, DT_UINT8, DT_INT8, DT_BOOL, DT_BF16, DT_INT16, DT_INT32, DT_UINT16, DT_UINT32}; |
| 106 | + static const std::unordered_set<DataType> LOGICALNOT_A5_TYPES = { | ||
| 107 | + DT_FP32, DT_FP16, DT_UINT8, DT_INT8, DT_BOOL, DT_BF16, DT_INT16, DT_INT32, DT_UINT16, DT_UINT32, DT_INT64}; | ||
| 108 | + const auto& supportedTypes = GetSupportedDataTypesByArch(LOGICALNOT_A2A3_TYPES, LOGICALNOT_A5_TYPES); | ||
| 106 | CheckTensorDataType(self.GetStorage(), supportedTypes, "LOGICALNOT"); | 109 | CheckTensorDataType(self.GetStorage(), supportedTypes, "LOGICALNOT"); |
| 107 | CheckTensorDimRange(self.GetStorage(), 1, 4, "LOGICALNOT"); | 110 | CheckTensorDimRange(self.GetStorage(), 1, 4, "LOGICALNOT"); |
| 108 | CheckTensorShapeSize(self.GetStorage(), "LOGICALNOT"); | 111 | CheckTensorShapeSize(self.GetStorage(), "LOGICALNOT"); |
| @@ -219,7 +222,11 @@ Tensor Sign(const Tensor& self) | |||
| 219 | DECLARE_TRACER(); | 222 | DECLARE_TRACER(); |
| 220 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Sign"); | 223 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Sign"); |
| 221 | 224 | ||
| 222 | - std::unordered_set<DataType> supportedTypes = {DT_FP16, DT_BF16, DT_INT16, DT_INT32, DT_FP32, DT_INT8}; | 225 | + static const std::unordered_set<DataType> SIGN_A2A3_TYPES = {DT_FP16, DT_BF16, DT_INT16, |
| 226 | + DT_INT32, DT_FP32, DT_INT8}; | ||
| 227 | + static const std::unordered_set<DataType> SIGN_A5_TYPES = {DT_FP16, DT_BF16, DT_INT16, DT_INT32, | ||
| 228 | + DT_FP32, DT_INT8, DT_INT64}; | ||
| 229 | + const auto& supportedTypes = GetSupportedDataTypesByArch(SIGN_A2A3_TYPES, SIGN_A5_TYPES); | ||
| 223 | CheckTensorDataType(self.GetStorage(), supportedTypes, "SIGN"); | 230 | CheckTensorDataType(self.GetStorage(), supportedTypes, "SIGN"); |
| 224 | CheckTensorDimRange(self.GetStorage(), 1, 4, "SIGN"); | 231 | CheckTensorDimRange(self.GetStorage(), 1, 4, "SIGN"); |
| 225 | CheckTensorShapeSize(self.GetStorage(), "SIGN"); | 232 | CheckTensorShapeSize(self.GetStorage(), "SIGN"); |
| @@ -315,7 +322,9 @@ Tensor Neg(const Tensor& self) | |||
| 315 | DECLARE_TRACER(); | 322 | DECLARE_TRACER(); |
| 316 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Neg"); | 323 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Neg"); |
| 317 | 324 | ||
| 318 | - std::unordered_set<DataType> supportedTypes = {DT_FP16, DT_BF16, DT_INT16, DT_INT32, DT_FP32}; | 325 | + static const std::unordered_set<DataType> NEG_A2A3_TYPES = {DT_FP16, DT_BF16, DT_INT16, DT_INT32, DT_FP32}; |
| 326 | + static const std::unordered_set<DataType> NEG_A5_TYPES = {DT_FP16, DT_BF16, DT_INT16, DT_INT32, DT_FP32, DT_INT64}; | ||
| 327 | + const auto& supportedTypes = GetSupportedDataTypesByArch(NEG_A2A3_TYPES, NEG_A5_TYPES); | ||
| 319 | CheckTensorDataType(self.GetStorage(), supportedTypes, "NEG"); | 328 | CheckTensorDataType(self.GetStorage(), supportedTypes, "NEG"); |
| 320 | CheckTensorDimRange(self.GetStorage(), 1, 4, "NEG"); | 329 | CheckTensorDimRange(self.GetStorage(), 1, 4, "NEG"); |
| 321 | CheckTensorShapeSize(self.GetStorage(), "NEG"); | 330 | CheckTensorShapeSize(self.GetStorage(), "NEG"); |
| @@ -1168,8 +1177,8 @@ void TiledTriUL(Function& function, const TileShape& tileShape, const TriULPara& | |||
| 1168 | void CheckTriULOperationParams(const Tensor& input, const std::string& opName) | 1177 | void CheckTriULOperationParams(const Tensor& input, const std::string& opName) |
| 1169 | { | 1178 | { |
| 1170 | static const std::unordered_set<DataType> a2a3Types = {DT_FP32, DT_FP16, DT_BF16, DT_INT16, DT_INT32, DT_INT8}; | 1179 | static const std::unordered_set<DataType> a2a3Types = {DT_FP32, DT_FP16, DT_BF16, DT_INT16, DT_INT32, DT_INT8}; |
| 1171 | - static const std::unordered_set<DataType> a5Types = {DT_FP32, DT_FP16, DT_BF16, DT_INT16, | 1180 | + static const std::unordered_set<DataType> a5Types = {DT_FP32, DT_FP16, DT_BF16, DT_INT16, DT_INT32, |
| 1172 | - DT_INT32, DT_INT8, DT_UINT16, DT_UINT32}; | 1181 | + DT_INT8, DT_UINT16, DT_UINT32, DT_INT64, DT_UINT64}; |
| 1173 | const auto& supportedTypes = GetSupportedDataTypesByArch(a2a3Types, a5Types); | 1182 | const auto& supportedTypes = GetSupportedDataTypesByArch(a2a3Types, a5Types); |
| 1174 | CheckTensorDataType(input.GetStorage(), supportedTypes, opName); | 1183 | CheckTensorDataType(input.GetStorage(), supportedTypes, opName); |
| 1175 | CheckTensorDimRange(input.GetStorage(), 2, 5, opName); | 1184 | CheckTensorDimRange(input.GetStorage(), 2, 5, opName); |
| @@ -1241,7 +1250,9 @@ Tensor Clip(const Tensor& self, const Element& min, const Element& max) | |||
| 1241 | DECLARE_TRACER(); | 1250 | DECLARE_TRACER(); |
| 1242 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Clip"); | 1251 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Clip"); |
| 1243 | 1252 | ||
| 1244 | - std::unordered_set<DataType> supportedTypes = {DT_FP32, DT_FP16, DT_BF16, DT_INT32, DT_INT16}; | 1253 | + static const std::unordered_set<DataType> CLIP_A2A3_TYPES = {DT_FP32, DT_FP16, DT_BF16, DT_INT32, DT_INT16}; |
| 1254 | + static const std::unordered_set<DataType> CLIP_A5_TYPES = {DT_FP32, DT_FP16, DT_BF16, DT_INT32, DT_INT16, DT_INT64}; | ||
| 1255 | + const auto& supportedTypes = GetSupportedDataTypesByArch(CLIP_A2A3_TYPES, CLIP_A5_TYPES); | ||
| 1245 | CheckTensorDataType(self.GetStorage(), supportedTypes, "CLIP"); | 1256 | CheckTensorDataType(self.GetStorage(), supportedTypes, "CLIP"); |
| 1246 | CheckTensorShapeSize(self.GetStorage(), "CLIP"); | 1257 | CheckTensorShapeSize(self.GetStorage(), "CLIP"); |
| 1247 | 1258 | ||
| @@ -1267,7 +1278,9 @@ Tensor Clip(const Tensor& self, const Tensor& min, const Tensor& max) | |||
| 1267 | DECLARE_TRACER(); | 1278 | DECLARE_TRACER(); |
| 1268 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Clip"); | 1279 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Clip"); |
| 1269 | 1280 | ||
| 1270 | - std::unordered_set<DataType> supportedTypes = {DT_FP32, DT_FP16, DT_BF16, DT_INT32, DT_INT16}; | 1281 | + static const std::unordered_set<DataType> CLIP_A2A3_TYPES = {DT_FP32, DT_FP16, DT_BF16, DT_INT32, DT_INT16}; |
| 1282 | + static const std::unordered_set<DataType> CLIP_A5_TYPES = {DT_FP32, DT_FP16, DT_BF16, DT_INT32, DT_INT16, DT_INT64}; | ||
| 1283 | + const auto& supportedTypes = GetSupportedDataTypesByArch(CLIP_A2A3_TYPES, CLIP_A5_TYPES); | ||
| 1271 | CheckTensorDataType(self.GetStorage(), supportedTypes, "CLIP"); | 1284 | CheckTensorDataType(self.GetStorage(), supportedTypes, "CLIP"); |
| 1272 | CheckTensorShapeSize(self.GetStorage(), "CLIP"); | 1285 | CheckTensorShapeSize(self.GetStorage(), "CLIP"); |
| 1273 | 1286 | ||
| @@ -1279,6 +1292,7 @@ Tensor Clip(const Tensor& self, const Tensor& min, const Tensor& max) | |||
| 1279 | std::vector minBroadcastAxes = GetBroadcastAxes(min.GetShape(), self.GetShape()); | 1292 | std::vector minBroadcastAxes = GetBroadcastAxes(min.GetShape(), self.GetShape()); |
| 1280 | CHECK(VectorErrorCode::ERR_PARAM_INVALID, minBroadcastAxes.size() <= 1) | 1293 | CHECK(VectorErrorCode::ERR_PARAM_INVALID, minBroadcastAxes.size() <= 1) |
| 1281 | << "minBroadcastAxes size should be <= 1"; | 1294 | << "minBroadcastAxes size should be <= 1"; |
| 1295 | + CheckInt64Broadcast(self.GetStorage(), min.GetStorage(), "CLIP"); | ||
| 1282 | result = Maximum(result, min); | 1296 | result = Maximum(result, min); |
| 1283 | } | 1297 | } |
| 1284 | if (max.GetStorage() != nullptr) { | 1298 | if (max.GetStorage() != nullptr) { |
| @@ -1288,6 +1302,7 @@ Tensor Clip(const Tensor& self, const Tensor& min, const Tensor& max) | |||
| 1288 | std::vector maxBroadcastAxes = GetBroadcastAxes(max.GetShape(), self.GetShape()); | 1302 | std::vector maxBroadcastAxes = GetBroadcastAxes(max.GetShape(), self.GetShape()); |
| 1289 | CHECK(VectorErrorCode::ERR_PARAM_INVALID, maxBroadcastAxes.size() <= 1) | 1303 | CHECK(VectorErrorCode::ERR_PARAM_INVALID, maxBroadcastAxes.size() <= 1) |
| 1290 | << "maxBroadcastAxes size should be <= 1"; | 1304 | << "maxBroadcastAxes size should be <= 1"; |
| 1305 | + CheckInt64Broadcast(self.GetStorage(), max.GetStorage(), "CLIP"); | ||
| 1291 | result = Minimum(result, max); | 1306 | result = Minimum(result, max); |
| 1292 | } | 1307 | } |
| 1293 | result.GetStorage()->UpdateDynValidShape(self.GetStorage()->GetDynValidShape()); | 1308 | result.GetStorage()->UpdateDynValidShape(self.GetStorage()->GetDynValidShape()); |
| @@ -1509,7 +1524,10 @@ Tensor Round(const Tensor& self, const int& decimals) | |||
| 1509 | DECLARE_TRACER(); | 1524 | DECLARE_TRACER(); |
| 1510 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Round"); | 1525 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Round"); |
| 1511 | 1526 | ||
| 1512 | - std::unordered_set<DataType> supportedTypes = {DT_FP32, DT_FP16, DT_BF16, DT_INT32, DT_INT16}; | 1527 | + static const std::unordered_set<DataType> ROUND_A2A3_TYPES = {DT_FP32, DT_FP16, DT_BF16, DT_INT32, DT_INT16}; |
| 1528 | + static const std::unordered_set<DataType> ROUND_A5_TYPES = {DT_FP32, DT_FP16, DT_BF16, | ||
| 1529 | + DT_INT32, DT_INT16, DT_INT64}; | ||
| 1530 | + const auto& supportedTypes = GetSupportedDataTypesByArch(ROUND_A2A3_TYPES, ROUND_A5_TYPES); | ||
| 1513 | CheckTensorDataType(self.GetStorage(), supportedTypes, "ROUND"); | 1531 | CheckTensorDataType(self.GetStorage(), supportedTypes, "ROUND"); |
| 1514 | CheckTensorDimRange(self.GetStorage(), 1, 4, "ROUND"); | 1532 | CheckTensorDimRange(self.GetStorage(), 1, 4, "ROUND"); |
| 1515 | CheckTensorShapeSize(self.GetStorage(), "ROUND"); | 1533 | CheckTensorShapeSize(self.GetStorage(), "ROUND"); |
| @@ -433,13 +433,10 @@ Tensor Amax(const Tensor& self, int axis, bool keepDim) | |||
| 433 | { | 433 | { |
| 434 | DECLARE_TRACER(); | 434 | DECLARE_TRACER(); |
| 435 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Amax"); | 435 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Amax"); |
| 436 | - | 436 | + static const std::unordered_set<DataType> AMAX_A2A3_TYPES = {DT_FP16, DT_BF16, DT_INT16, DT_INT32, DT_FP32}; |
| 437 | - std::unordered_set<DataType> supportedTypes; | 437 | + static const std::unordered_set<DataType> AMAX_A5_TYPES = {DT_FP16, DT_BF16, DT_INT16, DT_INT32, DT_FP32, |
| 438 | - if (Platform::Instance().GetSoc().GetNPUArch() == NPUArch::DAV_3510) { | 438 | + DT_INT8, DT_UINT8, DT_INT64, DT_UINT64}; |
| 439 | - supportedTypes = {DT_FP16, DT_BF16, DT_INT16, DT_INT32, DT_FP32, DT_INT8, DT_UINT8}; | 439 | + const auto& supportedTypes = GetSupportedDataTypesByArch(AMAX_A2A3_TYPES, AMAX_A5_TYPES); |
| 440 | - } else { | ||
| 441 | - supportedTypes = {DT_FP16, DT_BF16, DT_INT16, DT_INT32, DT_FP32}; | ||
| 442 | - } | ||
| 443 | CheckTensorDataType(self.GetStorage(), supportedTypes, "AMAX"); | 440 | CheckTensorDataType(self.GetStorage(), supportedTypes, "AMAX"); |
| 444 | CheckTensorDimRange(self.GetStorage(), 1, 4, "AMAX"); | 441 | CheckTensorDimRange(self.GetStorage(), 1, 4, "AMAX"); |
| 445 | CheckTensorShapeSize(self.GetStorage(), "AMAX"); | 442 | CheckTensorShapeSize(self.GetStorage(), "AMAX"); |
| @@ -512,13 +509,11 @@ Tensor Amin(const Tensor& self, int axis, bool keepDim) | |||
| 512 | { | 509 | { |
| 513 | DECLARE_TRACER(); | 510 | DECLARE_TRACER(); |
| 514 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Amin"); | 511 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Amin"); |
| 515 | - | 512 | + CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Amax"); |
| 516 | - std::unordered_set<DataType> supportedTypes; | 513 | + static const std::unordered_set<DataType> AMIN_A2A3_TYPES = {DT_FP16, DT_BF16, DT_INT16, DT_INT32, DT_FP32}; |
| 517 | - if (Platform::Instance().GetSoc().GetNPUArch() == NPUArch::DAV_3510) { | 514 | + static const std::unordered_set<DataType> AMIN_A5_TYPES = {DT_FP16, DT_BF16, DT_INT16, DT_INT32, DT_FP32, |
| 518 | - supportedTypes = {DT_FP16, DT_BF16, DT_INT16, DT_INT32, DT_FP32, DT_INT8, DT_UINT8}; | 515 | + DT_INT8, DT_UINT8, DT_INT64, DT_UINT64}; |
| 519 | - } else { | 516 | + const auto& supportedTypes = GetSupportedDataTypesByArch(AMIN_A2A3_TYPES, AMIN_A5_TYPES); |
| 520 | - supportedTypes = {DT_FP16, DT_BF16, DT_INT16, DT_INT32, DT_FP32}; | ||
| 521 | - } | ||
| 522 | CheckTensorDataType(self.GetStorage(), supportedTypes, "AMIN"); | 517 | CheckTensorDataType(self.GetStorage(), supportedTypes, "AMIN"); |
| 523 | CheckTensorDimRange(self.GetStorage(), 1, 4, "AMIN"); | 518 | CheckTensorDimRange(self.GetStorage(), 1, 4, "AMIN"); |
| 524 | CheckTensorShapeSize(self.GetStorage(), "AMIN"); | 519 | CheckTensorShapeSize(self.GetStorage(), "AMIN"); |
| @@ -538,7 +533,10 @@ Tensor Sum(const Tensor& self, int axis, bool keepDim) | |||
| 538 | DECLARE_TRACER(); | 533 | DECLARE_TRACER(); |
| 539 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Sum"); | 534 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Sum"); |
| 540 | 535 | ||
| 541 | - std::unordered_set<DataType> supportedTypes = {DT_FP32, DT_BF16, DT_INT32, DT_INT16}; | 536 | + static const std::unordered_set<DataType> SUM_A2A3_TYPES = {DT_FP32, DT_BF16, DT_INT32, DT_INT16}; |
| 537 | + static const std::unordered_set<DataType> SUM_A5_TYPES = {DT_FP32, DT_BF16, DT_INT32, | ||
| 538 | + DT_INT16, DT_INT64, DT_UINT64}; | ||
| 539 | + const auto& supportedTypes = GetSupportedDataTypesByArch(SUM_A2A3_TYPES, SUM_A5_TYPES); | ||
| 542 | CheckTensorDataType(self.GetStorage(), supportedTypes, "SUM"); | 540 | CheckTensorDataType(self.GetStorage(), supportedTypes, "SUM"); |
| 543 | CheckTensorDimRange(self.GetStorage(), 1, 4, "SUM"); | 541 | CheckTensorDimRange(self.GetStorage(), 1, 4, "SUM"); |
| 544 | CheckTensorShapeSize(self.GetStorage(), "SUM"); | 542 | CheckTensorShapeSize(self.GetStorage(), "SUM"); |
| @@ -197,8 +197,11 @@ Tensor Expand(const Tensor& self, const std::vector<int64_t>& dstShape, std::vec | |||
| 197 | DECLARE_TRACER(); | 197 | DECLARE_TRACER(); |
| 198 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Expand"); | 198 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Expand"); |
| 199 | 199 | ||
| 200 | - std::unordered_set<DataType> supportedTypes = {DT_BF16, DT_FP32, DT_FP16, DT_INT8, DT_INT16, | 200 | + static const std::unordered_set<DataType> EXPAND_A2A3_TYPES = {DT_BF16, DT_FP32, DT_FP16, DT_INT8, DT_INT16, |
| 201 | - DT_INT32, DT_UINT8, DT_UINT16, DT_UINT32, DT_BOOL}; | 201 | + DT_INT32, DT_UINT8, DT_UINT16, DT_UINT32, DT_BOOL}; |
| 202 | + static const std::unordered_set<DataType> EXPAND_A5_TYPES = {DT_BF16, DT_FP32, DT_FP16, DT_INT8, DT_INT16, | ||
| 203 | + DT_INT32, DT_UINT8, DT_UINT16, DT_UINT32, DT_BOOL}; | ||
| 204 | + const auto& supportedTypes = GetSupportedDataTypesByArch(EXPAND_A2A3_TYPES, EXPAND_A5_TYPES); | ||
| 202 | CheckTensorDataType(self.GetStorage(), supportedTypes, "EXPAND"); | 205 | CheckTensorDataType(self.GetStorage(), supportedTypes, "EXPAND"); |
| 203 | CheckTensorDimRange(self.GetStorage(), 1, 4, "EXPAND"); | 206 | CheckTensorDimRange(self.GetStorage(), 1, 4, "EXPAND"); |
| 204 | CheckTensorShapeSize(self.GetStorage(), "EXPAND"); | 207 | CheckTensorShapeSize(self.GetStorage(), "EXPAND"); |
| @@ -1692,8 +1695,12 @@ Tensor Full(const Element& src, DataType dtype, const std::vector<int64_t>& dstS | |||
| 1692 | std::vector<SymbolicScalar> validShape) | 1695 | std::vector<SymbolicScalar> validShape) |
| 1693 | { | 1696 | { |
| 1694 | DECLARE_TRACER(); | 1697 | DECLARE_TRACER(); |
| 1695 | - std::unordered_set<DataType> supportedTypes = {DT_FP32, DT_FP16, DT_BF16, DT_INT8, DT_INT16, | 1698 | + static const std::unordered_set<DataType> FULL_A2A3_TYPES = {DT_FP32, DT_FP16, DT_BF16, DT_INT8, DT_INT16, |
| 1696 | - DT_INT32, DT_UINT8, DT_UINT16, DT_UINT32, DT_BOOL}; | 1699 | + DT_INT32, DT_UINT8, DT_UINT16, DT_UINT32, DT_BOOL}; |
| 1700 | + static const std::unordered_set<DataType> FULL_A5_TYPES = {DT_FP32, DT_FP16, DT_BF16, DT_INT8, | ||
| 1701 | + DT_INT16, DT_INT32, DT_UINT8, DT_UINT16, | ||
| 1702 | + DT_UINT32, DT_BOOL, DT_INT64, DT_UINT64}; | ||
| 1703 | + const auto& supportedTypes = GetSupportedDataTypesByArch(FULL_A2A3_TYPES, FULL_A5_TYPES); | ||
| 1697 | CheckTensorDataType(dtype, supportedTypes, "FULL"); | 1704 | CheckTensorDataType(dtype, supportedTypes, "FULL"); |
| 1698 | CheckDstShapeDimRange(dstShape, 1, 4, "FULL"); | 1705 | CheckDstShapeDimRange(dstShape, 1, 4, "FULL"); |
| 1699 | CheckDstShapeSize(dstShape, "FULL"); | 1706 | CheckDstShapeSize(dstShape, "FULL"); |
| @@ -1709,8 +1716,12 @@ Tensor Full(const SymbolicScalar& dynSrc, DataType dtype, const std::vector<int6 | |||
| 1709 | std::vector<SymbolicScalar> validShape) | 1716 | std::vector<SymbolicScalar> validShape) |
| 1710 | { | 1717 | { |
| 1711 | DECLARE_TRACER(); | 1718 | DECLARE_TRACER(); |
| 1712 | - std::unordered_set<DataType> supportedTypes = {DT_FP32, DT_FP16, DT_BF16, DT_INT8, DT_INT16, | 1719 | + static const std::unordered_set<DataType> FULL_A2A3_TYPES = {DT_FP32, DT_FP16, DT_BF16, DT_INT8, DT_INT16, |
| 1713 | - DT_INT32, DT_UINT8, DT_UINT16, DT_UINT32, DT_BOOL}; | 1720 | + DT_INT32, DT_UINT8, DT_UINT16, DT_UINT32, DT_BOOL}; |
| 1721 | + static const std::unordered_set<DataType> FULL_A5_TYPES = {DT_FP32, DT_FP16, DT_BF16, DT_INT8, | ||
| 1722 | + DT_INT16, DT_INT32, DT_UINT8, DT_UINT16, | ||
| 1723 | + DT_UINT32, DT_BOOL, DT_INT64, DT_UINT64}; | ||
| 1724 | + const auto& supportedTypes = GetSupportedDataTypesByArch(FULL_A2A3_TYPES, FULL_A5_TYPES); | ||
| 1714 | CheckTensorDataType(dtype, supportedTypes, "FULL"); | 1725 | CheckTensorDataType(dtype, supportedTypes, "FULL"); |
| 1715 | CheckDstShapeDimRange(dstShape, 1, 4, "FULL"); | 1726 | CheckDstShapeDimRange(dstShape, 1, 4, "FULL"); |
| 1716 | CheckDstShapeSize(dstShape, "FULL"); | 1727 | CheckDstShapeSize(dstShape, "FULL"); |
| @@ -192,7 +192,9 @@ Tensor Relu(const Tensor& self) | |||
| 192 | DECLARE_TRACER(); | 192 | DECLARE_TRACER(); |
| 193 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Relu"); | 193 | CheckTensorFormat(self.GetStorage(), {TileOpFormat::TILEOP_NZ}, "Relu"); |
| 194 | 194 | ||
| 195 | - std::unordered_set<DataType> supportedTypes = {DT_FP16, DT_BF16, DT_FP32, DT_INT32, DT_INT16}; | 195 | + static const std::unordered_set<DataType> RELU_A2A3_TYPES = {DT_FP16, DT_BF16, DT_FP32, DT_INT32, DT_INT16}; |
| 196 | + static const std::unordered_set<DataType> RELU_A5_TYPES = {DT_FP16, DT_BF16, DT_FP32, DT_INT32, DT_INT16, DT_INT64}; | ||
| 197 | + const auto& supportedTypes = GetSupportedDataTypesByArch(RELU_A2A3_TYPES, RELU_A5_TYPES); | ||
| 196 | CheckTensorDataType(self.GetStorage(), supportedTypes, "Relu"); | 198 | CheckTensorDataType(self.GetStorage(), supportedTypes, "Relu"); |
| 197 | RETURN_CALL(UnaryOperation<UnaryOpType::RELU>, *Program::GetInstance().GetCurrentFunction(), self.GetStorage()); | 199 | RETURN_CALL(UnaryOperation<UnaryOpType::RELU>, *Program::GetInstance().GetCurrentFunction(), self.GetStorage()); |
| 198 | } | 200 | } |
| @@ -472,8 +472,8 @@ Tensor Where(const Tensor& condition, const Tensor& input, const Tensor& other) | |||
| 472 | static const std::unordered_set<DataType> conditionTypes = {DT_BOOL, DT_UINT8}; | 472 | static const std::unordered_set<DataType> conditionTypes = {DT_BOOL, DT_UINT8}; |
| 473 | CheckTensorDataType(condition.GetStorage(), conditionTypes, "WHERE"); | 473 | CheckTensorDataType(condition.GetStorage(), conditionTypes, "WHERE"); |
| 474 | static const std::unordered_set<DataType> a2a3InputTypes = {DT_INT32, DT_INT16, DT_FP16, DT_FP32, DT_BF16}; | 474 | static const std::unordered_set<DataType> a2a3InputTypes = {DT_INT32, DT_INT16, DT_FP16, DT_FP32, DT_BF16}; |
| 475 | - static const std::unordered_set<DataType> a5InputTypes = {DT_INT32, DT_FP32, DT_INT16, DT_FP16, | 475 | + static const std::unordered_set<DataType> a5InputTypes = {DT_INT32, DT_FP32, DT_INT16, DT_FP16, DT_BF16, |
| 476 | - DT_BF16, DT_UINT8, DT_INT8}; | 476 | + DT_UINT8, DT_INT8, DT_INT64, DT_UINT64}; |
| 477 | const auto& inputTypes = GetSupportedDataTypesByArch(a2a3InputTypes, a5InputTypes); | 477 | const auto& inputTypes = GetSupportedDataTypesByArch(a2a3InputTypes, a5InputTypes); |
| 478 | CheckTensorDataType(input.GetStorage(), inputTypes, "WHERE"); | 478 | CheckTensorDataType(input.GetStorage(), inputTypes, "WHERE"); |
| 479 | CheckTensorDimRange(condition.GetStorage(), 1, 4, "WHERE"); | 479 | CheckTensorDimRange(condition.GetStorage(), 1, 4, "WHERE"); |
| @@ -496,8 +496,8 @@ Tensor Where(const Tensor& condition, const Tensor& input, const Element& otherV | |||
| 496 | static const std::unordered_set<DataType> conditionTypes = {DT_BOOL, DT_UINT8}; | 496 | static const std::unordered_set<DataType> conditionTypes = {DT_BOOL, DT_UINT8}; |
| 497 | CheckTensorDataType(condition.GetStorage(), conditionTypes, "WHERE"); | 497 | CheckTensorDataType(condition.GetStorage(), conditionTypes, "WHERE"); |
| 498 | static const std::unordered_set<DataType> a2a3InputTypes = {DT_INT32, DT_INT16, DT_FP16, DT_FP32, DT_BF16}; | 498 | static const std::unordered_set<DataType> a2a3InputTypes = {DT_INT32, DT_INT16, DT_FP16, DT_FP32, DT_BF16}; |
| 499 | - static const std::unordered_set<DataType> a5InputTypes = {DT_INT32, DT_FP32, DT_INT16, DT_FP16, | 499 | + static const std::unordered_set<DataType> a5InputTypes = {DT_INT32, DT_FP32, DT_INT16, DT_FP16, DT_BF16, |
| 500 | - DT_BF16, DT_UINT8, DT_INT8}; | 500 | + DT_UINT8, DT_INT8, DT_INT64, DT_UINT64}; |
| 501 | const auto& inputTypes = GetSupportedDataTypesByArch(a2a3InputTypes, a5InputTypes); | 501 | const auto& inputTypes = GetSupportedDataTypesByArch(a2a3InputTypes, a5InputTypes); |
| 502 | CheckTensorDataType(input.GetStorage(), inputTypes, "WHERE"); | 502 | CheckTensorDataType(input.GetStorage(), inputTypes, "WHERE"); |
| 503 | CheckTensorDimRange(condition.GetStorage(), 1, 4, "WHERE"); | 503 | CheckTensorDimRange(condition.GetStorage(), 1, 4, "WHERE"); |
| @@ -517,8 +517,8 @@ Tensor Where(const Tensor& condition, const Element& inputValue, const Tensor& o | |||
| 517 | static const std::unordered_set<DataType> conditionTypes = {DT_BOOL, DT_UINT8}; | 517 | static const std::unordered_set<DataType> conditionTypes = {DT_BOOL, DT_UINT8}; |
| 518 | CheckTensorDataType(condition.GetStorage(), conditionTypes, "WHERE"); | 518 | CheckTensorDataType(condition.GetStorage(), conditionTypes, "WHERE"); |
| 519 | static const std::unordered_set<DataType> a2a3InputTypes = {DT_INT32, DT_INT16, DT_FP16, DT_FP32, DT_BF16}; | 519 | static const std::unordered_set<DataType> a2a3InputTypes = {DT_INT32, DT_INT16, DT_FP16, DT_FP32, DT_BF16}; |
| 520 | - static const std::unordered_set<DataType> a5InputTypes = {DT_INT32, DT_FP32, DT_INT16, DT_FP16, | 520 | + static const std::unordered_set<DataType> a5InputTypes = {DT_INT32, DT_FP32, DT_INT16, DT_FP16, DT_BF16, |
| 521 | - DT_BF16, DT_UINT8, DT_INT8}; | 521 | + DT_UINT8, DT_INT8, DT_INT64, DT_UINT64}; |
| 522 | const auto& inputTypes = GetSupportedDataTypesByArch(a2a3InputTypes, a5InputTypes); | 522 | const auto& inputTypes = GetSupportedDataTypesByArch(a2a3InputTypes, a5InputTypes); |
| 523 | CheckTensorDataType(other.GetStorage(), inputTypes, "WHERE"); | 523 | CheckTensorDataType(other.GetStorage(), inputTypes, "WHERE"); |
| 524 | CheckTensorDimRange(condition.GetStorage(), 1, 4, "WHERE"); | 524 | CheckTensorDimRange(condition.GetStorage(), 1, 4, "WHERE"); |
| @@ -1196,6 +1196,27 @@ TILEOP void FloorDivNonV220Int32Compute(DstTile dstTile, Src0Tile src0Tile, Src1 | |||
| 1196 | IntFloorDiv<(int32_t)0x7FFF7F7F, (int32_t)0x80008080>(dstTile, src0Tile, src1Tile, tmp0DataTile, tmp1DataTile, | 1196 | IntFloorDiv<(int32_t)0x7FFF7F7F, (int32_t)0x80008080>(dstTile, src0Tile, src1Tile, tmp0DataTile, tmp1DataTile, |
| 1197 | tmp2DataTile, tmp3MaskTile, tmp4MaskTile); | 1197 | tmp2DataTile, tmp3MaskTile, tmp4MaskTile); |
| 1198 | } | 1198 | } |
| 1199 | + | ||
| 1200 | +template <typename T0, typename T3, auto tileH, auto tileW, typename SrcTile, typename DstTile> | ||
| 1201 | +TILEOP void FloorDivNonV220Int64Compute(DstTile dstTile, SrcTile src0Tile, SrcTile src1Tile, T3 tmp, size_t offset, | ||
| 1202 | + size_t dstShape3, size_t dstShape4, size_t tileShapeSize) | ||
| 1203 | +{ | ||
| 1204 | + using Int64TileDefine = pto::Tile<pto::TileType::Vec, int64_t, tileH, tileW, pto::BLayout::RowMajor, -1, -1>; | ||
| 1205 | + using MaskTileDefine = pto::Tile<pto::TileType::Vec, uint8_t, tileH, 8 * tileW, pto::BLayout::RowMajor, -1, -1>; | ||
| 1206 | + Int64TileDefine tmp0DataTile(dstShape3, dstShape4); | ||
| 1207 | + Int64TileDefine tmp1DataTile(dstShape3, dstShape4); | ||
| 1208 | + Int64TileDefine tmp2DataTile(dstShape3, dstShape4); | ||
| 1209 | + MaskTileDefine tmp3MaskTile(dstShape3, dstShape4); | ||
| 1210 | + MaskTileDefine tmp4MaskTile(dstShape3, dstShape4); | ||
| 1211 | + pto::TASSIGN(tmp0DataTile, FloorDivTmpAddr(tmp, offset, tileShapeSize, 0, sizeof(int64_t))); | ||
| 1212 | + pto::TASSIGN(tmp1DataTile, FloorDivTmpAddr(tmp, offset, tileShapeSize, 1, sizeof(int64_t))); | ||
| 1213 | + pto::TASSIGN(tmp2DataTile, FloorDivTmpAddr(tmp, offset, tileShapeSize, 3, sizeof(int64_t))); | ||
| 1214 | + pto::TASSIGN(tmp3MaskTile, FloorDivTmpAddr(tmp, offset, tileShapeSize, 2, sizeof(int64_t))); | ||
| 1215 | + pto::TASSIGN(tmp4MaskTile, FloorDivTmpAddr(tmp, offset, tileShapeSize, 3, sizeof(int64_t))); | ||
| 1216 | + | ||
| 1217 | + IntFloorDiv<(int64_t)0x7FFFFFFFFFFFFFFF, (int64_t)0x8000000000000000>( | ||
| 1218 | + dstTile, src0Tile, src1Tile, tmp0DataTile, tmp1DataTile, tmp2DataTile, tmp3MaskTile, tmp4MaskTile); | ||
| 1219 | +} | ||
| 1199 | #endif | 1220 | #endif |
| 1200 | 1221 | ||
| 1201 | #define OP_TILE_OP_FLOORDIV TFloorDiv | 1222 | #define OP_TILE_OP_FLOORDIV TFloorDiv |
| @@ -1259,6 +1280,9 @@ TILEOP void TFloorDiv(T0 dst, T1 src0, T2 src1, T3 tmp) | |||
| 1259 | } else if constexpr (std::is_same_v<typename T0::Type, int32_t>) { | 1280 | } else if constexpr (std::is_same_v<typename T0::Type, int32_t>) { |
| 1260 | FloorDivNonV220Int32Compute<T0, T3, tileH, tileW>( | 1281 | FloorDivNonV220Int32Compute<T0, T3, tileH, tileW>( |
| 1261 | dstTile, src0ExecTile, src1ExecTile, tmp, tmpByteOffset, dstShape3, dstShape4, tileShapeSize); | 1282 | dstTile, src0ExecTile, src1ExecTile, tmp, tmpByteOffset, dstShape3, dstShape4, tileShapeSize); |
| 1283 | + } else if constexpr (std::is_same_v<typename T0::Type, int64_t>) { | ||
| 1284 | + FloorDivNonV220Int64Compute<T0, T3, tileH, tileW>( | ||
| 1285 | + dstTile, src0ExecTile, src1ExecTile, tmp, tmpByteOffset, dstShape3, dstShape4, tileShapeSize); | ||
| 1262 | } | 1286 | } |
| 1263 | #endif | 1287 | #endif |
| 1264 | } | 1288 | } |
| @@ -816,6 +816,41 @@ TILEOP void TFloorDivS(T0 dst, T1 src0, Scalar src1, T2 tmp) | |||
| 816 | pto::TADDS(tmp1DataTile, dstTile, -1); | 816 | pto::TADDS(tmp1DataTile, dstTile, -1); |
| 817 | pto::TSEL(dstTile, tmp2MaskTile, tmp1DataTile, dstTile, tmp0DataTile); | 817 | pto::TSEL(dstTile, tmp2MaskTile, tmp1DataTile, dstTile, tmp0DataTile); |
| 818 | } | 818 | } |
| 819 | + } else if constexpr (std::is_same_v<typename T0::Type, int64_t>) { | ||
| 820 | + using Int64TileDefine = pto::Tile<pto::TileType::Vec, int64_t, tileH, tileW, pto::BLayout::RowMajor, | ||
| 821 | + -1, -1>; | ||
| 822 | + using MaskTileDefine = pto::Tile<pto::TileType::Vec, uint8_t, tileH, 8 * tileW, | ||
| 823 | + pto::BLayout::RowMajor, -1, -1>; | ||
| 824 | + Int64TileDefine tmp0DataTile(dstShape3, dstShape4); | ||
| 825 | + Int64TileDefine tmp1DataTile(dstShape3, dstShape4); | ||
| 826 | + MaskTileDefine tmp2MaskTile(dstShape3, dstShape4); | ||
| 827 | + MaskTileDefine tmp3MaskTile(dstShape3, dstShape4); | ||
| 828 | + pto::TASSIGN(tmp0DataTile, FloorDivTmpAddr(tmp, dstOffset, tileShapeSize, 0, sizeof(int64_t))); | ||
| 829 | + pto::TASSIGN(tmp1DataTile, FloorDivTmpAddr(tmp, dstOffset, tileShapeSize, 1, sizeof(int64_t))); | ||
| 830 | + pto::TASSIGN(tmp2MaskTile, FloorDivTmpAddr(tmp, dstOffset, tileShapeSize, 2, sizeof(int64_t))); | ||
| 831 | + pto::TASSIGN(tmp3MaskTile, FloorDivTmpAddr(tmp, dstOffset, tileShapeSize, 3, sizeof(int64_t))); | ||
| 832 | + | ||
| 833 | + if (src1 == 0) { | ||
| 834 | + constexpr int64_t pos = 0x7FFFFFFFFFFFFFFF; | ||
| 835 | + constexpr int64_t neg = 0x8000000000000000; | ||
| 836 | + pto::TCMPS(tmp2MaskTile, src0Tile, 0, pto::CmpMode::LT); | ||
| 837 | + pto::TSELS(dstTile, tmp2MaskTile, dstTile, tmp0DataTile, pos); | ||
| 838 | + pto::TCMPS(tmp2MaskTile, src0Tile, 0, pto::CmpMode::GE); | ||
| 839 | + pto::TSELS(dstTile, tmp2MaskTile, dstTile, tmp0DataTile, neg); | ||
| 840 | + } else { | ||
| 841 | + if (src1 < 0) { | ||
| 842 | + pto::TCMPS(tmp2MaskTile, src0Tile, 0, pto::CmpMode::GE); | ||
| 843 | + } else { | ||
| 844 | + pto::TCMPS(tmp2MaskTile, src0Tile, 0, pto::CmpMode::LT); | ||
| 845 | + } | ||
| 846 | + pto::TDIVS(dstTile, src0Tile, static_cast<int64_t>(src1)); | ||
| 847 | + pto::TMULS(tmp0DataTile, dstTile, static_cast<int64_t>(src1)); | ||
| 848 | + pto::TSUB(tmp0DataTile, src0Tile, tmp0DataTile); | ||
| 849 | + pto::TCMPS(tmp3MaskTile, tmp0DataTile, 0, pto::CmpMode::NE); | ||
| 850 | + pto::TAND(tmp2MaskTile, tmp2MaskTile, tmp3MaskTile); | ||
| 851 | + pto::TADDS(tmp1DataTile, dstTile, -1); | ||
| 852 | + pto::TSEL(dstTile, tmp2MaskTile, tmp1DataTile, dstTile, tmp0DataTile); | ||
| 853 | + } | ||
| 819 | } | 854 | } |
| 820 | #endif | 855 | #endif |
| 821 | } | 856 | } |
| @@ -58,7 +58,7 @@ TILEOP void GetValidShiftTile(T& dst, U& src1, V& tmp, USigned& src1Signed, VSig | |||
| 58 | SyncV(); | 58 | SyncV(); |
| 59 | pto::TOR(tmp, tmp, src1); | 59 | pto::TOR(tmp, tmp, src1); |
| 60 | SyncV(); | 60 | SyncV(); |
| 61 | - pto::TSHRS(tmpSigned, tmpSigned, MAX_SHIFT_NUM); | 61 | + pto::TSHRS(tmpSigned, tmpSigned, MAX_SHIFT_NUM - 1); |
| 62 | SyncV(); | 62 | SyncV(); |
| 63 | pto::TNOT(dst, tmp); | 63 | pto::TNOT(dst, tmp); |
| 64 | SyncV(); | 64 | SyncV(); |
| @@ -164,7 +164,8 @@ template <typename T, typename SrcTileType, typename DstTileType, typename CmpTi | |||
| 164 | typename AddrUBTileType> | 164 | typename AddrUBTileType> |
| 165 | TILEOP void PostProcessMode0(DstTileType& bitResTile, CmpTileType& cmpResTile, SrcTileType& vselResultTile, | 165 | TILEOP void PostProcessMode0(DstTileType& bitResTile, CmpTileType& cmpResTile, SrcTileType& vselResultTile, |
| 166 | SrcTileType& oneConditionTile, SrcTileType& zeroConditionTile, | 166 | SrcTileType& oneConditionTile, SrcTileType& zeroConditionTile, |
| 167 | - AddrUBTileType& startAddrUBTile, TmpTileType& tmpTile, __ubuf__ T* zeroCondition) | 167 | + AddrUBTileType& startAddrUBTile, TmpTileType& tmpTile, __ubuf__ T* zeroCondition, |
| 168 | + __ubuf__ T* vselResult) | ||
| 168 | { | 169 | { |
| 169 | pto::TEXPANDS(zeroConditionTile, 0.000000e+00f); | 170 | pto::TEXPANDS(zeroConditionTile, 0.000000e+00f); |
| 170 | pto::TEXPANDS(oneConditionTile, 1.000000e+00f); | 171 | pto::TEXPANDS(oneConditionTile, 1.000000e+00f); |
| @@ -184,6 +185,21 @@ TILEOP void PostProcessMode0(DstTileType& bitResTile, CmpTileType& cmpResTile, S | |||
| 184 | pipe_barrier(PIPE_V); | 185 | pipe_barrier(PIPE_V); |
| 185 | #endif | 186 | #endif |
| 186 | pto::TCVT(bitResTile, tmpTile, pto::RoundMode::CAST_NONE); | 187 | pto::TCVT(bitResTile, tmpTile, pto::RoundMode::CAST_NONE); |
| 188 | +#ifdef __DAV_V310 | ||
| 189 | + } else if constexpr (sizeof(typename T::Type) == 8) { | ||
| 190 | + // int64/uint64: device TCVT has no direct 64-bit -> 8-bit path, so convert through int32. | ||
| 191 | + // TSEL only writes 0/1, whose bit pattern is identical between int64 and uint64, hence the | ||
| 192 | + // source can be safely reinterpreted as int64 to share a single conversion path. | ||
| 193 | + constexpr int64_t cmpTileCols = 1024; | ||
| 194 | + using Int64Tile = pto::Tile<pto::TileType::Vec, int64_t, 1, cmpTileCols, pto::BLayout::RowMajor, -1, -1>; | ||
| 195 | + using Int32Tile = pto::Tile<pto::TileType::Vec, int32_t, 1, cmpTileCols, pto::BLayout::RowMajor, -1, -1>; | ||
| 196 | + Int64Tile int64SrcTile(1, vselResultTile.GetValidCol()); | ||
| 197 | + Int32Tile int32TmpTile(1, vselResultTile.GetValidCol()); | ||
| 198 | + pto::TASSIGN(int64SrcTile, reinterpret_cast<uint64_t>(vselResult)); | ||
| 199 | + pto::TASSIGN(int32TmpTile, reinterpret_cast<uint64_t>(zeroCondition)); | ||
| 200 | + pto::TCVT(int32TmpTile, int64SrcTile, pto::RoundMode::CAST_NONE); | ||
| 201 | + pto::TCVT(bitResTile, int32TmpTile, pto::RoundMode::CAST_NONE); | ||
| 202 | +#endif | ||
| 187 | } | 203 | } |
| 188 | } | 204 | } |
| 189 | 205 | ||
| @@ -280,7 +296,8 @@ TILEOP void TCompare(TDst dst, T0 src0, T1 src1, TTmp tmpbuf) | |||
| 280 | 296 | ||
| 281 | if constexpr (mode == 0) { | 297 | if constexpr (mode == 0) { |
| 282 | PostProcessMode0<T0>(bitResTile, cmpResTile, vselResultTile, oneConditionTile, | 298 | PostProcessMode0<T0>(bitResTile, cmpResTile, vselResultTile, oneConditionTile, |
| 283 | - zeroConditionTile, startAddrUBTile, tmpTile, buffers.zeroCondition); | 299 | + zeroConditionTile, startAddrUBTile, tmpTile, buffers.zeroCondition, |
| 300 | + buffers.vselResult); | ||
| 284 | } | 301 | } |
| 285 | } | 302 | } |
| 286 | 303 | ||
| @@ -313,7 +330,8 @@ TILEOP void TCompare(TDst dst, T0 src0, T1 src1, TTmp tmpbuf) | |||
| 313 | 330 | ||
| 314 | if constexpr (mode == 0) { | 331 | if constexpr (mode == 0) { |
| 315 | PostProcessMode0<T0>(bitResTile, cmpResTile, vselResultTile, oneConditionTile, | 332 | PostProcessMode0<T0>(bitResTile, cmpResTile, vselResultTile, oneConditionTile, |
| 316 | - zeroConditionTile, startAddrUBTile, tmpTile, buffers.zeroCondition); | 333 | + zeroConditionTile, startAddrUBTile, tmpTile, buffers.zeroCondition, |
| 334 | + buffers.vselResult); | ||
| 317 | } | 335 | } |
| 318 | } | 336 | } |
| 319 | } | 337 | } |
| @@ -380,7 +398,8 @@ TILEOP void TCompareScalar(TDst dst, T src, TTmp tmpbuf, TVal scalarVal) | |||
| 380 | 398 | ||
| 381 | if constexpr (mode == 0) { | 399 | if constexpr (mode == 0) { |
| 382 | PostProcessMode0<T>(bitResTile, cmpResTile, vselResultTile, oneConditionTile, | 400 | PostProcessMode0<T>(bitResTile, cmpResTile, vselResultTile, oneConditionTile, |
| 383 | - zeroConditionTile, startAddrUBTile, tmpTile, buffers.zeroCondition); | 401 | + zeroConditionTile, startAddrUBTile, tmpTile, buffers.zeroCondition, |
| 402 | + buffers.vselResult); | ||
| 384 | } | 403 | } |
| 385 | } | 404 | } |
| 386 | 405 | ||
| @@ -410,7 +429,8 @@ TILEOP void TCompareScalar(TDst dst, T src, TTmp tmpbuf, TVal scalarVal) | |||
| 410 | 429 | ||
| 411 | if constexpr (mode == 0) { | 430 | if constexpr (mode == 0) { |
| 412 | PostProcessMode0<T>(bitResTile, cmpResTile, vselResultTile, oneConditionTile, | 431 | PostProcessMode0<T>(bitResTile, cmpResTile, vselResultTile, oneConditionTile, |
| 413 | - zeroConditionTile, startAddrUBTile, tmpTile, buffers.zeroCondition); | 432 | + zeroConditionTile, startAddrUBTile, tmpTile, buffers.zeroCondition, |
| 433 | + buffers.vselResult); | ||
| 414 | } | 434 | } |
| 415 | } | 435 | } |
| 416 | } | 436 | } |
| @@ -77,6 +77,22 @@ TILEOP void LogicalNotImplInt(DstTile dstTile, SrcTile srcTile, TmpTile tmpTile) | |||
| 77 | pto::TASSIGN(srcView, (uint64_t)(unsignedSrcTile.data())); | 77 | pto::TASSIGN(srcView, (uint64_t)(unsignedSrcTile.data())); |
| 78 | pto::TASSIGN(gatherDst, (uint64_t)(dstTile.data())); | 78 | pto::TASSIGN(gatherDst, (uint64_t)(dstTile.data())); |
| 79 | pto::TGATHER<U8DstTile, U8ViewTile, pto::MaskPattern::P0001>(gatherDst, srcView); | 79 | pto::TGATHER<U8DstTile, U8ViewTile, pto::MaskPattern::P0001>(gatherDst, srcView); |
| 80 | + } else if constexpr (sizeof(UnsignedT) == 8) { | ||
| 81 | + // 8-byte elements: extract the low byte via a two-step gather. | ||
| 82 | + // Step 1 (P0001): each 8-byte element -> byte0 and byte4, buffered into the reused tmp area. | ||
| 83 | + using U8ViewTile = pto::Tile<pto::TileType::Vec, uint8_t, 1, COUNT_MAX_BYTES, pto::BLayout::RowMajor, -1, -1>; | ||
| 84 | + using U8DstTile = pto::Tile<pto::TileType::Vec, uint8_t, 1, 2048, pto::BLayout::RowMajor, -1, -1>; | ||
| 85 | + U8ViewTile srcView(1, dstValid * sizeof(UnsignedT)); | ||
| 86 | + U8DstTile step1Dst(1, dstValid * 2); | ||
| 87 | + pto::TASSIGN(srcView, (uint64_t)(unsignedSrcTile.data())); | ||
| 88 | + pto::TASSIGN(step1Dst, (uint64_t)(tmpTile.data())); | ||
| 89 | + pto::TGATHER<U8DstTile, U8ViewTile, pto::MaskPattern::P0001>(step1Dst, srcView); | ||
| 90 | + // Step 2 (P0101): each 2-byte pair -> low byte, written to the dst. | ||
| 91 | + U8ViewTile step2View(1, dstValid * 2); | ||
| 92 | + U8DstTile gatherDst(1, dstValid); | ||
| 93 | + pto::TASSIGN(step2View, (uint64_t)(tmpTile.data())); | ||
| 94 | + pto::TASSIGN(gatherDst, (uint64_t)(dstTile.data())); | ||
| 95 | + pto::TGATHER<U8DstTile, U8ViewTile, pto::MaskPattern::P0101>(gatherDst, step2View); | ||
| 80 | } | 96 | } |
| 81 | } | 97 | } |
| 82 | 98 | ||
| @@ -202,7 +218,8 @@ TILEOP void LogicalNotProcessTile(T0 dst, T1 src, __ubuf__ int8_t* tmpBuffer, __ | |||
| 202 | TileStartAddrUBT startAddrUBTile, unsigned count, uint64_t dstOff, uint64_t srcOff) | 218 | TileStartAddrUBT startAddrUBTile, unsigned count, uint64_t dstOff, uint64_t srcOff) |
| 203 | { | 219 | { |
| 204 | if constexpr (std::is_same_v<typename T1::Type, int16_t> || std::is_same_v<typename T1::Type, uint16_t> || | 220 | if constexpr (std::is_same_v<typename T1::Type, int16_t> || std::is_same_v<typename T1::Type, uint16_t> || |
| 205 | - std::is_same_v<typename T1::Type, int32_t> || std::is_same_v<typename T1::Type, uint32_t>) { | 221 | + std::is_same_v<typename T1::Type, int32_t> || std::is_same_v<typename T1::Type, uint32_t> || |
| 222 | + std::is_same_v<typename T1::Type, int64_t>) { | ||
| 206 | LogicalNotProcessTileInt(dst, src, tmpBuffer, count, dstOff, srcOff); | 223 | LogicalNotProcessTileInt(dst, src, tmpBuffer, count, dstOff, srcOff); |
| 207 | } else { | 224 | } else { |
| 208 | LogicalNotProcessTileGeneric(dst, src, compareCondition, oneCondition, castCondition, vcmpResTile, | 225 | LogicalNotProcessTileGeneric(dst, src, compareCondition, oneCondition, castCondition, vcmpResTile, |
| @@ -216,7 +233,8 @@ TILEOP void LogicalNotPrepareState(T2 tmp, __ubuf__ int8_t*& tmpBuffer, __ubuf__ | |||
| 216 | VcmpResTileT& vcmpResTile, TileStartAddrUBT& startAddrUBTile) | 233 | VcmpResTileT& vcmpResTile, TileStartAddrUBT& startAddrUBTile) |
| 217 | { | 234 | { |
| 218 | if constexpr (std::is_same_v<typename T1::Type, int16_t> || std::is_same_v<typename T1::Type, uint16_t> || | 235 | if constexpr (std::is_same_v<typename T1::Type, int16_t> || std::is_same_v<typename T1::Type, uint16_t> || |
| 219 | - std::is_same_v<typename T1::Type, int32_t> || std::is_same_v<typename T1::Type, uint32_t>) { | 236 | + std::is_same_v<typename T1::Type, int32_t> || std::is_same_v<typename T1::Type, uint32_t> || |
| 237 | + std::is_same_v<typename T1::Type, int64_t>) { | ||
| 220 | tmpBuffer = reinterpret_cast<__ubuf__ int8_t*>(tmp.GetAddr()); | 238 | tmpBuffer = reinterpret_cast<__ubuf__ int8_t*>(tmp.GetAddr()); |
| 221 | } else { | 239 | } else { |
| 222 | LogicalNotGenericSetup<T1>(tmp, compareCondition, oneCondition, castCondition, vcmpResTile, startAddrUBTile); | 240 | LogicalNotGenericSetup<T1>(tmp, compareCondition, oneCondition, castCondition, vcmpResTile, startAddrUBTile); |
| @@ -99,7 +99,8 @@ template <typename LastUse, typename T, typename DstTile, typename SrcTile, type | |||
| 99 | TILEOP void SignImpl(DstTile dstTile, SrcTile srcTile, WorkTile workTile, MaskTile maskTile, | 99 | TILEOP void SignImpl(DstTile dstTile, SrcTile srcTile, WorkTile workTile, MaskTile maskTile, |
| 100 | ScalarTmpTile scalarTmpTile) | 100 | ScalarTmpTile scalarTmpTile) |
| 101 | { | 101 | { |
| 102 | - if constexpr (std::is_same<T, int32_t>::value || std::is_same<T, int16_t>::value) { | 102 | + if constexpr (std::is_same<T, int32_t>::value || std::is_same<T, int16_t>::value || |
| 103 | + std::is_same<T, int64_t>::value) { | ||
| 103 | SignInt<LastUse, T, DstTile, SrcTile>(dstTile, srcTile); | 104 | SignInt<LastUse, T, DstTile, SrcTile>(dstTile, srcTile); |
| 104 | } else if constexpr (std::is_same<T, half>::value || std::is_same<T, float>::value) { | 105 | } else if constexpr (std::is_same<T, half>::value || std::is_same<T, float>::value) { |
| 105 | SignFloat<LastUse, T>(dstTile, srcTile, workTile, maskTile, scalarTmpTile); | 106 | SignFloat<LastUse, T>(dstTile, srcTile, workTile, maskTile, scalarTmpTile); |
| @@ -71,7 +71,7 @@ TILEOP void UnaryComputeImpl(T0 dst, T1 src) | |||
| 71 | return; | 71 | return; |
| 72 | } | 72 | } |
| 73 | if constexpr (op == UnaryOp::RELU) { | 73 | if constexpr (op == UnaryOp::RELU) { |
| 74 | - pto::TMAXS(dst, src, 0.0f); | 74 | + pto::TMAXS(dst, src, static_cast<typename T1::DType>(0)); |
| 75 | return; | 75 | return; |
| 76 | } | 76 | } |
| 77 | if constexpr (op == UnaryOp::LN) { | 77 | if constexpr (op == UnaryOp::LN) { |
| @@ -132,7 +132,8 @@ TILEOP void UnaryCompute(T0 dst, T1 src) | |||
| 132 | } | 132 | } |
| 133 | 133 | ||
| 134 | using SrcExecDtype = typename ElementwiseOperandExecConfig<T0, T1>::OperandDtype; | 134 | using SrcExecDtype = typename ElementwiseOperandExecConfig<T0, T1>::OperandDtype; |
| 135 | - if constexpr (TileOp::IsConstContinous<T0, T1>()) { | 135 | + if constexpr (TileOp::IsConstContinous<T0, T1>() && !std::is_same_v<typename T0::Type, int64_t> && |
| 136 | + !std::is_same_v<typename T0::Type, uint64_t>) { | ||
| 136 | auto dstTile = PtoTile<T0, pto::BLayout::RowMajor, true>().Data(); | 137 | auto dstTile = PtoTile<T0, pto::BLayout::RowMajor, true>().Data(); |
| 137 | auto srcTile = PtoTile<T0, pto::BLayout::RowMajor, true, SrcExecDtype>().Data(); | 138 | auto srcTile = PtoTile<T0, pto::BLayout::RowMajor, true, SrcExecDtype>().Data(); |
| 138 | pto::TASSIGN(dstTile, (uint64_t)dst.GetAddr()); | 139 | pto::TASSIGN(dstTile, (uint64_t)dst.GetAddr()); |
| @@ -665,7 +666,11 @@ TILEOP void TRound(T0 dst, T1 tmp, T2 src, Scalar powDecimals) | |||
| 665 | 666 | ||
| 666 | if constexpr (std::is_integral_v<typename T2::Type>) { | 667 | if constexpr (std::is_integral_v<typename T2::Type>) { |
| 667 | if (powDecimals >= 1.0f) { | 668 | if (powDecimals >= 1.0f) { |
| 668 | - pto::TMOV(dstTile.Data(), srcExecTile); | 669 | + if constexpr (std::is_same_v<typename T2::Type, int64_t>) { |
| 670 | + pto::TADDS(dstTile.Data(), srcExecTile, static_cast<typename T2::Type>(0)); | ||
| 671 | + } else { | ||
| 672 | + pto::TMOV(dstTile.Data(), srcExecTile); | ||
| 673 | + } | ||
| 669 | continue; | 674 | continue; |
| 670 | } | 675 | } |
| 671 | } | 676 | } |
| @@ -3230,7 +3230,7 @@ def gen_uniform_op_golden(case_name: str, output: Path, case_index: int = None) | |||
| 3230 | 3230 | ||
| 3231 | 3231 | ||
| 3232 | def safe_tensor_conversion(arr): | 3232 | def safe_tensor_conversion(arr): |
| 3233 | - if isinstance(arr, np.ndarray) and arr.dtype == np.dtype('bfloat16'): | 3233 | + if isinstance(arr, np.ndarray) and arr.dtype == bfloat16: |
| 3234 | return torch.tensor(arr.astype(np.float32), dtype=torch.bfloat16) | 3234 | return torch.tensor(arr.astype(np.float32), dtype=torch.bfloat16) |
| 3235 | else: | 3235 | else: |
| 3236 | return torch.tensor(arr) | 3236 | return torch.tensor(arr) |
| @@ -541,6 +541,18 @@ T2 GetMapValByName(const std::map<T1, T2>& map_data, const T1& name) | |||
| 541 | } else if (dataType == DT_INT64) { | 541 | } else if (dataType == DT_INT64) { |
| 542 | Element element(dataType, GetValueByName<int64_t>(test_data, name)); | 542 | Element element(dataType, GetValueByName<int64_t>(test_data, name)); |
| 543 | return element; | 543 | return element; |
| 544 | + } else if (dataType == DT_UINT8) { | ||
| 545 | + Element element(dataType, GetValueByName<uint8_t>(test_data, name)); | ||
| 546 | + return element; | ||
| 547 | + } else if (dataType == DT_UINT16) { | ||
| 548 | + Element element(dataType, GetValueByName<uint16_t>(test_data, name)); | ||
| 549 | + return element; | ||
| 550 | + } else if (dataType == DT_UINT32) { | ||
| 551 | + Element element(dataType, GetValueByName<uint32_t>(test_data, name)); | ||
| 552 | + return element; | ||
| 553 | + } else if (dataType == DT_UINT64) { | ||
| 554 | + Element element(dataType, GetValueByName<uint64_t>(test_data, name)); | ||
| 555 | + return element; | ||
| 544 | } else { | 556 | } else { |
| 545 | std::string errorMessage = "Unsupported DataType " + std::string(DataType2String(dataType)); | 557 | std::string errorMessage = "Unsupported DataType " + std::string(DataType2String(dataType)); |
| 546 | throw std::invalid_argument(errorMessage.c_str()); | 558 | throw std::invalid_argument(errorMessage.c_str()); |
| @@ -21,7 +21,15 @@ Add_test_19,"[2, 4, 8, 16], [1, 1, 8, 1]","fp32, fp32","ND, ND","[-10, 10], [-10 | |||
| 21 | Add_test_20,"[2, 4, 8, 16], [1, 1, 1, 16]","fp32, fp32","ND, ND","[-10, 10], [-10, 10]","[2, 4, 8, 16]",fp32,ND,"[2, 4, 8, 16]","[2, 4, 8, 16]" | 21 | Add_test_20,"[2, 4, 8, 16], [1, 1, 1, 16]","fp32, fp32","ND, ND","[-10, 10], [-10, 10]","[2, 4, 8, 16]",fp32,ND,"[2, 4, 8, 16]","[2, 4, 8, 16]" |
| 22 | Add_test_21,"[2, 4, 8, 16], [1, 1, 1, 1]","fp32, fp32","ND, ND","[-10, 10], [-10, 10]","[2, 4, 8, 16]",fp32,ND,"[2, 4, 8, 16]","[2, 4, 8, 16]" | 22 | Add_test_21,"[2, 4, 8, 16], [1, 1, 1, 1]","fp32, fp32","ND, ND","[-10, 10], [-10, 10]","[2, 4, 8, 16]",fp32,ND,"[2, 4, 8, 16]","[2, 4, 8, 16]" |
| 23 | Add_test_22,"[1, 4, 8, 16], [2, 1, 8, 16]","fp32, fp32","ND, ND","[-10, 10], [-10, 10]","[2, 4, 8, 16]",fp32,ND,"[2, 4, 8, 16]","[2, 4, 8, 16]" | 23 | Add_test_22,"[1, 4, 8, 16], [2, 1, 8, 16]","fp32, fp32","ND, ND","[-10, 10], [-10, 10]","[2, 4, 8, 16]",fp32,ND,"[2, 4, 8, 16]","[2, 4, 8, 16]" |
| 24 | -Add_test_23,"[32, 32], [32, 32]","int8, int8","ND, ND","[-10, 10], [-10, 10]","[32, 32]",int8,ND,"[16, 16]","[16, 16]" | 24 | +Add_test_23,"[32, 32], [32, 32]","int8, int8","ND, ND","[-10, 10], [-10, 10]","[32, 32]",int8,ND,"[16, 16]","[16, 16]" |
| 25 | -Add_test_24,"[32, 32], [32, 32]","uint8, uint8","ND, ND","[-10, 10], [-10, 10]","[32, 32]",uint8,ND,"[16, 16]","[16, 16]" | 25 | +Add_test_24,"[32, 32], [32, 32]","uint8, uint8","ND, ND","[-10, 10], [-10, 10]","[32, 32]",uint8,ND,"[16, 16]","[16, 16]" |
| 26 | -Add_test_25,"[32, 32], [32, 32]","uint16, uint16","ND, ND","[-100, 100], [-100, 100]","[32, 32]",uint16,ND,"[16, 16]","[16, 16]" | 26 | +Add_test_25,"[32, 32], [32, 32]","uint16, uint16","ND, ND","[-100, 100], [-100, 100]","[32, 32]",uint16,ND,"[16, 16]","[16, 16]" |
| 27 | -Add_test_26,"[32, 32], [32, 32]","uint32, uint32","ND, ND","[-1000, 1000], [-1000, 1000]","[32, 32]",uint32,ND,"[16, 16]","[16, 16]" | 27 | +Add_test_26,"[32, 32], [32, 32]","uint32, uint32","ND, ND","[-1000, 1000], [-1000, 1000]","[32, 32]",uint32,ND,"[16, 16]","[16, 16]" |
| 28 | +Add_int64,"[32, 32], [32, 32]","int64, int64","ND, ND","[-100, 100], [-100, 100]","[32, 32]",int64,ND,"[16, 16]","[16, 16]" | ||
| 29 | +Add_uint64,"[32, 32], [32, 32]","uint64, uint64","ND, ND","[1, 100], [1, 100]","[32, 32]",uint64,ND,"[16, 16]","[16, 16]" | ||
| 30 | +Add_tail_int64,"[107, 145], [107, 145]","int64, int64","ND, ND","[-100, 100], [-100, 100]","[107, 145]",int64,ND,"[32, 32]","[16, 16]" | ||
| 31 | +Add_tail_uint64,"[107, 145], [107, 145]","uint64, uint64","ND, ND","[1, 100], [1, 100]","[107, 145]",uint64,ND,"[32, 32]","[16, 16]" | ||
| 32 | +Add_3d_int64,"[2, 32, 32], [2, 32, 32]","int64, int64","ND, ND","[-100, 100], [-100, 100]","[2, 32, 32]",int64,ND,"[2, 16, 16]","[2, 8, 8]" | ||
| 33 | +Add_3d_uint64,"[2, 32, 32], [2, 32, 32]","uint64, uint64","ND, ND","[1, 100], [1, 100]","[2, 32, 32]",uint64,ND,"[2, 16, 16]","[2, 8, 8]" | ||
| 34 | +Add_bc_int64,"[4, 1], [1, 8]","int64, int64","ND, ND","[-100, 100], [-100, 100]","[4, 8]",int64,ND,"[4, 8]","[4, 8]" | ||
| 35 | +Add_bc_uint64,"[4, 1], [1, 8]","uint64, uint64","ND, ND","[1, 100], [1, 100]","[4, 8]",uint64,ND,"[4, 8]","[4, 8]" | ||
| @@ -22,3 +22,5 @@ Adds_test_20,"[786432, 384]",fp32,ND,"[-1, 1]","[786432, 384]",fp32,ND,"[32768, | |||
| 22 | Adds_test_21,"[16, 384]",fp32,ND,"[-10, 10]","[16, 384]",fp32,ND,"[5, 126]","[351, 8]",1,fp32 | 22 | Adds_test_21,"[16, 384]",fp32,ND,"[-10, 10]","[16, 384]",fp32,ND,"[5, 126]","[351, 8]",1,fp32 |
| 23 | Adds_test_22,"[16, 127, 128, 32]",fp32,ND,"[-10, 10]","[16, 127, 128, 32]",fp32,ND,"[2, 29, 37, 1]","[13, 149, 1, 8]",0,fp32 | 23 | Adds_test_22,"[16, 127, 128, 32]",fp32,ND,"[-10, 10]","[16, 127, 128, 32]",fp32,ND,"[2, 29, 37, 1]","[13, 149, 1, 8]",0,fp32 |
| 24 | Adds_test_23,"[1, 2048]",fp32,ND,"[-1, 1]","[1, 2048]",fp32,ND,"[1, 2047]","[1, 2048]",0.00001,fp32 | 24 | Adds_test_23,"[1, 2048]",fp32,ND,"[-1, 1]","[1, 2048]",fp32,ND,"[1, 2047]","[1, 2048]",0.00001,fp32 |
| 25 | +Adds_int64,"[32, 32]",int64,ND,"[-100, 100]","[32, 32]",int64,ND,"[16, 16]","[16, 16]",5,int64 | ||
| 26 | +Adds_uint64,"[32, 32]",uint64,ND,"[1, 100]","[32, 32]",uint64,ND,"[16, 16]","[16, 16]",5,uint64 | ||
| @@ -119,3 +119,13 @@ RowMax_uint8_4D_dim1_non32_nokeepdim,"[7, 95, 17, 9]",uint8,ND,"[-5e4, 5e4]","[7 | |||
| 119 | RowMax_uint8_3D_dim1_32align_keepdim,"[15, 255, 31]",uint8,ND,"[-10, 10]","[15, 1, 31]",uint8,ND,"[15, 255, 31]","[4, 128, 32]",[1],TRUE | 119 | RowMax_uint8_3D_dim1_32align_keepdim,"[15, 255, 31]",uint8,ND,"[-10, 10]","[15, 1, 31]",uint8,ND,"[15, 255, 31]","[4, 128, 32]",[1],TRUE |
| 120 | RowMax_uint8_3D_dim1_non32_nokeepdim,"[31, 99, 63]",uint8,ND,"[-9999, 9999]","[31, 63]",uint8,ND,"[31, 99, 63]","[8, 32, 64]",[-2],FALSE | 120 | RowMax_uint8_3D_dim1_non32_nokeepdim,"[31, 99, 63]",uint8,ND,"[-9999, 9999]","[31, 63]",uint8,ND,"[31, 99, 63]","[8, 32, 64]",[-2],FALSE |
| 121 | RowMax_uint8_2D_dim0_non32_keepdim,"[127, 129]",uint8,ND,"[-1e6, 1e6]","[1, 129]",uint8,ND,"[127, 129]","[64, 136]",[0],TRUE | 121 | RowMax_uint8_2D_dim0_non32_keepdim,"[127, 129]",uint8,ND,"[-1e6, 1e6]","[1, 129]",uint8,ND,"[127, 129]","[64, 136]",[0],TRUE |
| 122 | +Amax_int64,"[32, 32]",int64,ND,"[-100, 100]","[32, 1]",int64,ND,"[16, 32]","[16, 32]",[-1],TRUE | ||
| 123 | +Amax_uint64,"[32, 32]",uint64,ND,"[1, 100]","[32, 1]",uint64,ND,"[16, 32]","[16, 32]",[-1],TRUE | ||
| 124 | +Amax_tail_int64,"[107, 145]",int64,ND,"[-100, 100]","[107, 1]",int64,ND,"[32, 145]","[32, 145]",[-1],TRUE | ||
| 125 | +Amax_tail_uint64,"[107, 145]",uint64,ND,"[1, 100]","[107, 1]",uint64,ND,"[32, 145]","[32, 145]",[-1],TRUE | ||
| 126 | +Amax_3d_dim0_nokeep_int64,"[31, 17, 63]",int64,ND,"[-128, 127]","[17, 63]",int64,ND,"[31, 17, 31]","[16, 17, 32]",[0],FALSE | ||
| 127 | +Amax_3d_dim0_nokeep_uint64,"[31, 17, 63]",uint64,ND,"[1, 100]","[17, 63]",uint64,ND,"[31, 17, 31]","[16, 17, 32]",[0],FALSE | ||
| 128 | +Amax_2d_last_nokeep_int64,"[32, 64]",int64,ND,"[-100, 100]","[32]",int64,ND,"[16, 64]","[16, 32]",[-1],FALSE | ||
| 129 | +Amax_2d_last_nokeep_uint64,"[32, 64]",uint64,ND,"[1, 100]","[32]",uint64,ND,"[16, 64]","[16, 32]",[-1],FALSE | ||
| 130 | +Amax_2d_dim0_keep_int64,"[16, 64]",int64,ND,"[-100, 100]","[1, 64]",int64,ND,"[16, 32]","[16, 32]",[0],TRUE | ||
| 131 | +Amax_2d_dim0_keep_uint64,"[16, 64]",uint64,ND,"[1, 100]","[1, 64]",uint64,ND,"[16, 32]","[16, 32]",[0],TRUE | ||
| @@ -65,3 +65,13 @@ RowMin_int16_48_300_safe_keepdim_true,"[48, 300]",int16,ND,"[50, 50]","[48, 1]", | |||
| 65 | RowMin_int16_48_300_safe_keepdim_false,"[48, 300]",int16,ND,"[50, 50]","[48]",int16,ND,"[48, 300]","[48, 320]",[-1],FALSE, | 65 | RowMin_int16_48_300_safe_keepdim_false,"[48, 300]",int16,ND,"[50, 50]","[48]",int16,ND,"[48, 300]","[48, 320]",[-1],FALSE, |
| 66 | RowMin_int32_12_1200_overflow_keepdim_true,"[12, 1200]",int32,ND,"[2000000, 2000000]","[12, 1]",int32,ND,"[12, 1200]","[12, 1280]",[-1],TRUE, | 66 | RowMin_int32_12_1200_overflow_keepdim_true,"[12, 1200]",int32,ND,"[2000000, 2000000]","[12, 1]",int32,ND,"[12, 1200]","[12, 1280]",[-1],TRUE, |
| 67 | RowMin_int32_12_1200_overflow_keepdim_false,"[12, 1200]",int32,ND,"[2000000, 2000000]","[12]",int32,ND,"[12, 1200]","[12, 1280]",[-1],FALSE, | 67 | RowMin_int32_12_1200_overflow_keepdim_false,"[12, 1200]",int32,ND,"[2000000, 2000000]","[12]",int32,ND,"[12, 1200]","[12, 1280]",[-1],FALSE, |
| 68 | +Amin_int64,"[32, 32]",int64,ND,"[-100, 100]","[32, 1]",int64,ND,"[16, 32]","[16, 32]",[-1],TRUE | ||
| 69 | +Amin_uint64,"[32, 32]",uint64,ND,"[1, 100]","[32, 1]",uint64,ND,"[16, 32]","[16, 32]",[-1],TRUE | ||
| 70 | +Amin_tail_int64,"[107, 145]",int64,ND,"[-100, 100]","[107, 1]",int64,ND,"[32, 145]","[32, 145]",[-1],TRUE, | ||
| 71 | +Amin_tail_uint64,"[107, 145]",uint64,ND,"[1, 100]","[107, 1]",uint64,ND,"[32, 145]","[32, 145]",[-1],TRUE, | ||
| 72 | +Amin_3d_dim0_nokeep_int64,"[31, 17, 63]",int64,ND,"[-128, 127]","[17, 63]",int64,ND,"[31, 17, 31]","[16, 17, 32]",[0],FALSE, | ||
| 73 | +Amin_3d_dim0_nokeep_uint64,"[31, 17, 63]",uint64,ND,"[1, 100]","[17, 63]",uint64,ND,"[31, 17, 31]","[16, 17, 32]",[0],FALSE, | ||
| 74 | +Amin_2d_last_nokeep_int64,"[32, 64]",int64,ND,"[-100, 100]","[32]",int64,ND,"[16, 64]","[16, 32]",[-1],FALSE, | ||
| 75 | +Amin_2d_last_nokeep_uint64,"[32, 64]",uint64,ND,"[1, 100]","[32]",uint64,ND,"[16, 64]","[16, 32]",[-1],FALSE, | ||
| 76 | +Amin_2d_dim0_keep_int64,"[16, 64]",int64,ND,"[-100, 100]","[1, 64]",int64,ND,"[16, 32]","[16, 32]",[0],TRUE, | ||
| 77 | +Amin_2d_dim0_keep_uint64,"[16, 64]",uint64,ND,"[1, 100]","[1, 64]",uint64,ND,"[16, 32]","[16, 32]",[0],TRUE, | ||
| @@ -7,3 +7,9 @@ BitwiseLeftShift_test_4,"[16, 64, 32], [1, 64, 32]","int16, int16","ND, ND","[-1 | |||
| 7 | BitwiseLeftShift_test_5,"[16, 64, 32, 1], [16, 64, 32, 16]","int16, int16","ND, ND","[-10, 10], [0, 7]"," [16, 64, 32, 16]",int16,ND,"[4, 16, 8, 2]","[4, 16, 8, 2]" | 7 | BitwiseLeftShift_test_5,"[16, 64, 32, 1], [16, 64, 32, 16]","int16, int16","ND, ND","[-10, 10], [0, 7]"," [16, 64, 32, 16]",int16,ND,"[4, 16, 8, 2]","[4, 16, 8, 2]" |
| 8 | BitwiseLeftShift_test_6,"[32, 32], [32, 32]","int8, int8","ND, ND","[-10, 10], [0, 7]","[32, 32]",int8,ND,"[16, 16]","[16, 16]" | 8 | BitwiseLeftShift_test_6,"[32, 32], [32, 32]","int8, int8","ND, ND","[-10, 10], [0, 7]","[32, 32]",int8,ND,"[16, 16]","[16, 16]" |
| 9 | BitwiseLeftShift_test_8,"[32, 32], [32, 32]","int32, int32","ND, ND","[-1000, 1000], [-1000, 1000]","[32, 32]",int32,ND,"[16, 16]","[16, 16]" | 9 | BitwiseLeftShift_test_8,"[32, 32], [32, 32]","int32, int32","ND, ND","[-1000, 1000], [-1000, 1000]","[32, 32]",int32,ND,"[16, 16]","[16, 16]" |
| 10 | +BitwiseLeftShift_int64,"[32, 32], [32, 32]","int64, int64","ND, ND","[1, 100], [0, 5]","[32, 32]",int64,ND,"[16, 16]","[16, 16]" | ||
| 11 | +BitwiseLeftShift_uint64,"[32, 32], [32, 32]","uint64, uint64","ND, ND","[1, 100], [0, 5]","[32, 32]",uint64,ND,"[16, 16]","[16, 16]" | ||
| 12 | +BitwiseLeftShift_tail_int64,"[107, 145], [107, 145]","int64, int64","ND, ND","[1, 100], [1, 5]","[107, 145]",int64,ND,"[32, 32]","[16, 16]" | ||
| 13 | +BitwiseLeftShift_tail_uint64,"[107, 145], [107, 145]","uint64, uint64","ND, ND","[1, 100], [1, 5]","[107, 145]",uint64,ND,"[32, 32]","[16, 16]" | ||
| 14 | +BitwiseLeftShift_3d_int64,"[2, 32, 32], [2, 32, 32]","int64, int64","ND, ND","[1, 100], [1, 5]","[2, 32, 32]",int64,ND,"[2, 16, 16]","[2, 8, 8]" | ||
| 15 | +BitwiseLeftShift_3d_uint64,"[2, 32, 32], [2, 32, 32]","uint64, uint64","ND, ND","[1, 100], [1, 5]","[2, 32, 32]",uint64,ND,"[2, 16, 16]","[2, 8, 8]" | ||
| @@ -7,3 +7,5 @@ BitwiseLeftShifts_test_4,"[0, 384]",int16,ND,"[-1, 1]","[0, 384]",int16,ND,"[128 | |||
| 7 | BitwiseLeftShifts_test_5,"[3072, 384]",int16,ND,"[-1, 1]","[3072, 384]",int16,ND,"[128, 128]","[32, 32]",6,int16 | 7 | BitwiseLeftShifts_test_5,"[3072, 384]",int16,ND,"[-1, 1]","[3072, 384]",int16,ND,"[128, 128]","[32, 32]",6,int16 |
| 8 | BitwiseLeftShifts_test_6,"[98304, 384]",int16,ND,"[-1, 1]","[98304, 384]",int16,ND,"[6144, 96]","[128, 32]",7,int16 | 8 | BitwiseLeftShifts_test_6,"[98304, 384]",int16,ND,"[-1, 1]","[98304, 384]",int16,ND,"[6144, 96]","[128, 32]",7,int16 |
| 9 | BitwiseLeftShifts_test_7,"[64, 36864]",int16,ND,"[-1, 1]","[64, 36864]",int16,ND,"[32, 1024]","[32, 128]",7,int16 | 9 | BitwiseLeftShifts_test_7,"[64, 36864]",int16,ND,"[-1, 1]","[64, 36864]",int16,ND,"[32, 1024]","[32, 128]",7,int16 |
| 10 | +BitwiseLeftShifts_int64,"[32, 32]",int64,ND,"[1, 100]","[32, 32]",int64,ND,"[16, 16]","[16, 16]",3,int64 | ||
| 11 | +BitwiseLeftShifts_uint64,"[32, 32]",uint64,ND,"[1, 100]","[32, 32]",uint64,ND,"[16, 16]","[16, 16]",3,uint64 | ||
| @@ -7,3 +7,9 @@ BitwiseRightShift_test_4,"[16, 64, 32], [1, 64, 32]","int16, int16","ND, ND","[- | |||
| 7 | BitwiseRightShift_test_5,"[16, 64, 32, 1], [16, 64, 32, 16]","int16, int16","ND, ND","[-10, 10], [0, 7]"," [16, 64, 32, 16]",int16,ND,"[4, 16, 8, 2]","[4, 16, 8, 2]" | 7 | BitwiseRightShift_test_5,"[16, 64, 32, 1], [16, 64, 32, 16]","int16, int16","ND, ND","[-10, 10], [0, 7]"," [16, 64, 32, 16]",int16,ND,"[4, 16, 8, 2]","[4, 16, 8, 2]" |
| 8 | BitwiseRightShift_test_6,"[32, 32], [32, 32]","int8, int8","ND, ND","[-10, 10], [0, 7]","[32, 32]",int8,ND,"[16, 16]","[16, 16]" | 8 | BitwiseRightShift_test_6,"[32, 32], [32, 32]","int8, int8","ND, ND","[-10, 10], [0, 7]","[32, 32]",int8,ND,"[16, 16]","[16, 16]" |
| 9 | BitwiseRightShift_test_8,"[32, 32], [32, 32]","int32, int32","ND, ND","[-1000, 1000], [-1000, 1000]","[32, 32]",int32,ND,"[16, 16]","[16, 16]" | 9 | BitwiseRightShift_test_8,"[32, 32], [32, 32]","int32, int32","ND, ND","[-1000, 1000], [-1000, 1000]","[32, 32]",int32,ND,"[16, 16]","[16, 16]" |
| 10 | +BitwiseRightShift_int64,"[32, 32], [32, 32]","int64, int64","ND, ND","[1, 100], [0, 5]","[32, 32]",int64,ND,"[16, 16]","[16, 16]" | ||
| 11 | +BitwiseRightShift_uint64,"[32, 32], [32, 32]","uint64, uint64","ND, ND","[1, 100], [0, 5]","[32, 32]",uint64,ND,"[16, 16]","[16, 16]" | ||
| 12 | +BitwiseRightShift_tail_int64,"[107, 145], [107, 145]","int64, int64","ND, ND","[1, 100], [1, 5]","[107, 145]",int64,ND,"[32, 32]","[16, 16]" | ||
| 13 | +BitwiseRightShift_tail_uint64,"[107, 145], [107, 145]","uint64, uint64","ND, ND","[1, 100], [1, 5]","[107, 145]",uint64,ND,"[32, 32]","[16, 16]" | ||
| 14 | +BitwiseRightShift_3d_int64,"[2, 32, 32], [2, 32, 32]","int64, int64","ND, ND","[1, 100], [1, 5]","[2, 32, 32]",int64,ND,"[2, 16, 16]","[2, 8, 8]" | ||
| 15 | +BitwiseRightShift_3d_uint64,"[2, 32, 32], [2, 32, 32]","uint64, uint64","ND, ND","[1, 100], [1, 5]","[2, 32, 32]",uint64,ND,"[2, 16, 16]","[2, 8, 8]" | ||
| @@ -7,3 +7,5 @@ BitwiseRightShifts_test_4,"[0, 384]",int16,ND,"[-1, 1]","[0, 384]",int16,ND,"[12 | |||
| 7 | BitwiseRightShifts_test_5,"[3072, 384]",int16,ND,"[-1, 1]","[3072, 384]",int16,ND,"[128, 128]","[32, 32]",6,int16 | 7 | BitwiseRightShifts_test_5,"[3072, 384]",int16,ND,"[-1, 1]","[3072, 384]",int16,ND,"[128, 128]","[32, 32]",6,int16 |
| 8 | BitwiseRightShifts_test_6,"[98304, 384]",int16,ND,"[-1, 1]","[98304, 384]",int16,ND,"[6144, 96]","[128, 32]",7,int16 | 8 | BitwiseRightShifts_test_6,"[98304, 384]",int16,ND,"[-1, 1]","[98304, 384]",int16,ND,"[6144, 96]","[128, 32]",7,int16 |
| 9 | BitwiseRightShifts_test_7,"[64, 36864]",int16,ND,"[-1, 1]","[64, 36864]",int16,ND,"[32, 1024]","[32, 128]",7,int16 | 9 | BitwiseRightShifts_test_7,"[64, 36864]",int16,ND,"[-1, 1]","[64, 36864]",int16,ND,"[32, 1024]","[32, 128]",7,int16 |
| 10 | +BitwiseRightShifts_int64,"[32, 32]",int64,ND,"[1, 100]","[32, 32]",int64,ND,"[16, 16]","[16, 16]",3,int64 | ||
| 11 | +BitwiseRightShifts_uint64,"[32, 32]",uint64,ND,"[1, 100]","[32, 32]",uint64,ND,"[16, 16]","[16, 16]",3,uint64 | ||
| @@ -34,3 +34,5 @@ Clip_test_32,"[128,128,128],[128,1,128],[128,128,1]","fp32,fp32,fp32","ND,ND,ND" | |||
| 34 | Clip_test_33,"[128,128,128]","fp32","ND","[0,1]","[128,128,128]",fp32,ND,"[32,32,32]","[16,16,16]",1.0,fp32,2.0,fp32,6 | 34 | Clip_test_33,"[128,128,128]","fp32","ND","[0,1]","[128,128,128]",fp32,ND,"[32,32,32]","[16,16,16]",1.0,fp32,2.0,fp32,6 |
| 35 | Clip_test_34,"[128,128,128]","fp32","ND","[0,1]","[128,128,128]",fp32,ND,"[32,32,32]","[16,16,16]",1.0,fp32,2.0,fp32,7 | 35 | Clip_test_34,"[128,128,128]","fp32","ND","[0,1]","[128,128,128]",fp32,ND,"[32,32,32]","[16,16,16]",1.0,fp32,2.0,fp32,7 |
| 36 | Clip_test_35,"[128,128,128]","fp32","ND","[0,1]","[128,128,128]",fp32,ND,"[32,32,32]","[16,16,16]",1.0,fp32,2.0,fp32,8 | 36 | Clip_test_35,"[128,128,128]","fp32","ND","[0,1]","[128,128,128]",fp32,ND,"[32,32,32]","[16,16,16]",1.0,fp32,2.0,fp32,8 |
| 37 | +Clip_int64,"[128, 128]",int64,ND,"[-100, 100]","[128, 128]",int64,ND,"[32, 32]","[16, 16]",10,int64,90,int64,-1 | ||
| 38 | +Clip_tensor_int64,"[128, 128],[128, 128],[128, 128]","int64,int64,int64","ND,ND,ND","[-100, 100],[0, 10],[50, 100]","[128, 128]",int64,ND,"[32, 32]","[16, 16]",,,,,-1 | ||
| @@ -32,3 +32,15 @@ Compare_redline_iter_2_fp16_112_28_55_32_ne_bool_dense_dense,"[112,28,55,32]",fp | |||
| 32 | Compare_redline_iter_2_fp32_69_76_61_11_gt_bool_dense_dense,"[69,76,61,11]",fp32,ND,"[-1,1]",10,fp32,"[69,76,61,11]",bool,ND,gt,bool,"[32,4,25,3]","[1,30,1,376]" | 32 | Compare_redline_iter_2_fp32_69_76_61_11_gt_bool_dense_dense,"[69,76,61,11]",fp32,ND,"[-1,1]",10,fp32,"[69,76,61,11]",bool,ND,gt,bool,"[32,4,25,3]","[1,30,1,376]" |
| 33 | Compare_redline_iter_2_fp16_107_227_64_165_le_bit_dense_dense,"[107,227,64,168]",fp16,ND,"[-100,100]",0,fp16,"[107,227,64,21]",uint8,ND,le,bit,"[26,53,5,8]","[6,249,1,16]" | 33 | Compare_redline_iter_2_fp16_107_227_64_165_le_bit_dense_dense,"[107,227,64,168]",fp16,ND,"[-100,100]",0,fp16,"[107,227,64,21]",uint8,ND,le,bit,"[26,53,5,8]","[6,249,1,16]" |
| 34 | Compare_redline_iter_2_fp32_129_108_76_174_ne_bit_dense_dense,"[129,108,76,176]",fp32,ND,"[-100,100]",0,fp32,"[129,108,76,22]",uint8,ND,ne,bit,"[16,20,21,8]","[24,1,3,16]" | 34 | Compare_redline_iter_2_fp32_129_108_76_174_ne_bit_dense_dense,"[129,108,76,176]",fp32,ND,"[-100,100]",0,fp32,"[129,108,76,22]",uint8,ND,ne,bit,"[16,20,21,8]","[24,1,3,16]" |
| 35 | +Cmps_int64,"[32, 32]",int64,ND,"[-100, 100]",0,int64,"[32, 32]",bool,ND,gt,bool,"[16, 16]","[16, 16]" | ||
| 36 | +Cmps_uint64,"[32, 32]",uint64,ND,"[1, 100]",50,uint64,"[32, 32]",bool,ND,gt,bool,"[16, 16]","[16, 16]" | ||
| 37 | +Cmps_tail_ge_int64,"[107, 145]",int64,ND,"[-100, 100]",0,int64,"[107, 145]",bool,ND,ge,bool,"[32, 32]","[3, 8]" | ||
| 38 | +Cmps_tail_ge_uint64,"[107, 145]",uint64,ND,"[1, 100]",50,uint64,"[107, 145]",bool,ND,ge,bool,"[32, 32]","[3, 8]" | ||
| 39 | +Cmps_tail_le_int64,"[107, 145]",int64,ND,"[-100, 100]",0,int64,"[107, 145]",bool,ND,le,bool,"[32, 32]","[3, 8]" | ||
| 40 | +Cmps_tail_le_uint64,"[107, 145]",uint64,ND,"[1, 100]",50,uint64,"[107, 145]",bool,ND,le,bool,"[32, 32]","[3, 8]" | ||
| 41 | +Cmps_tail_eq_int64,"[107, 145]",int64,ND,"[-100, 100]",0,int64,"[107, 145]",bool,ND,eq,bool,"[32, 32]","[3, 8]" | ||
| 42 | +Cmps_tail_eq_uint64,"[107, 145]",uint64,ND,"[1, 100]",50,uint64,"[107, 145]",bool,ND,eq,bool,"[32, 32]","[3, 8]" | ||
| 43 | +Cmps_lt_int64,"[32, 32]",int64,ND,"[-100, 100]",0,int64,"[32, 32]",bool,ND,lt,bool,"[16, 16]","[16, 16]" | ||
| 44 | +Cmps_lt_uint64,"[32, 32]",uint64,ND,"[1, 100]",50,uint64,"[32, 32]",bool,ND,lt,bool,"[16, 16]","[16, 16]" | ||
| 45 | +Cmps_ne_int64,"[32, 32]",int64,ND,"[-100, 100]",0,int64,"[32, 32]",bool,ND,ne,bool,"[16, 16]","[16, 16]" | ||
| 46 | +Cmps_ne_uint64,"[32, 32]",uint64,ND,"[1, 100]",50,uint64,"[32, 32]",bool,ND,ne,bool,"[16, 16]","[16, 16]" | ||
| @@ -1,28 +1,38 @@ | |||
| 1 | -case_name,input_shape,input_dtype,input_format,input_datarange,output_shape,output_dtype,output_format,compare_op,mode,eq_num,view_shape,tile_shape,tile_block,total_size | 1 | +case_name,input_shape,input_dtype,input_format,input_datarange,output_shape,output_dtype,output_format,compare_op,mode,eq_num,view_shape,tile_shape |
| 2 | -Compare_test_0,"[33,53],[33,53]","fp16,fp16","ND,ND","[-100,100],[-100,100]","[33,53]",bool,ND,eq,bool,108,"[13,9]","[472,64]",1,9.77E-06 | 2 | +Compare_test_0,"[33,53],[33,53]","fp16,fp16","ND,ND","[-100,100],[-100,100]","[33,53]",bool,ND,eq,bool,108,"[13,9]","[472,64]" |
| 3 | -Compare_test_1,"[1,8],[115,8]","fp32,fp32","ND,ND","[-1,1],[-10,10]","[115,8]",bool,ND,eq,bool,280,"[20,1]","[638,24]",1,6.88E-06 | 3 | +Compare_test_1,"[1,8],[115,8]","fp32,fp32","ND,ND","[-1,1],[-10,10]","[115,8]",bool,ND,eq,bool,280,"[20,1]","[638,24]" |
| 4 | -Compare_test_2,"[17,1],[17,104]","fp16,fp16","ND,ND","[-100,100],[-10,10]","[17,13]",uint8,ND,ne,bit,161,"[6, 8]","[396,16]",1,3.74E-06 | 4 | +Compare_test_2,"[17,1],[17,104]","fp16,fp16","ND,ND","[-100,100],[-10,10]","[17,13]",uint8,ND,ne,bit,161,"[6, 8]","[396,16]" |
| 5 | -Compare_test_3,"[123,48],[123,1]","fp16,fp16","ND,ND","[-1,1],[-1,1]","[123,6]",uint8,ND,ne,bit,756,"[59, 8]","[540,16]",1,1.26E-05 | 5 | +Compare_test_3,"[123,48],[123,1]","fp16,fp16","ND,ND","[-1,1],[-1,1]","[123,6]",uint8,ND,ne,bit,756,"[59, 8]","[540,16]" |
| 6 | -Compare_test_4,"[71,82],[71,1]","fp16,fp16","ND,ND","[-1,1],[-10,10]","[71,82]",bool,ND,lt,bool,1271,"[19,27]","[219,16]",2,2.18E-05 | 6 | +Compare_test_4,"[71,82],[71,1]","fp16,fp16","ND,ND","[-1,1],[-10,10]","[71,82]",bool,ND,lt,bool,1271,"[19,27]","[219,16]" |
| 7 | -Compare_test_5,"[1,120],[122,120]","fp16,fp16","ND,ND","[-10,10],[-100,100]","[122,15]",uint8,ND,gt,bit,3152,"[5, 8]","[506,64]",1,3.09E-05 | 7 | +Compare_test_5,"[1,120],[122,120]","fp16,fp16","ND,ND","[-10,10],[-100,100]","[122,15]",uint8,ND,gt,bit,3152,"[5, 8]","[506,64]" |
| 8 | -Compare_test_6,"[84,81],[84,81]","fp32,fp32","ND,ND","[-1,1],[-1,1]","[84,81]",bool,ND,le,bool,1058,"[16,38]","[128,96]",1,7.60E-05 | 8 | +Compare_test_6,"[84,81],[84,81]","fp32,fp32","ND,ND","[-1,1],[-1,1]","[84,81]",bool,ND,le,bool,1058,"[16,38]","[128,96]" |
| 9 | -Compare_test_7,"[26,99],[26,1]","fp16,fp16","ND,ND","[-100,100],[-10,10]","[26,99]",bool,ND,le,bool,562,"[8,10]","[417,64]",1,9.64E-06 | 9 | +Compare_test_7,"[26,99],[26,1]","fp16,fp16","ND,ND","[-100,100],[-10,10]","[26,99]",bool,ND,le,bool,562,"[8,10]","[417,64]" |
| 10 | -Compare_test_8,"[49,68],[49,1]","fp32,fp32","ND,ND","[-1,1],[-10,10]","[49,68]",bool,ND,ge,bool,208,"[7,29]","[10,200]",1,2.50E-05 | 10 | +Compare_test_8,"[49,68],[49,1]","fp32,fp32","ND,ND","[-1,1],[-10,10]","[49,68]",bool,ND,ge,bool,208,"[7,29]","[10,200]" |
| 11 | -Compare_test_9,"[21,116,56],[21,116,56]","fp16,fp16","ND,ND","[-1,1],[-10,10]","[21,116,7]",uint8,ND,eq,bit,27176,"[7, 36, 8]","[204,6,16]",6,0.000539951 | 11 | +Compare_test_9,"[21,116,56],[21,116,56]","fp16,fp16","ND,ND","[-1,1],[-10,10]","[21,116,7]",uint8,ND,eq,bit,27176,"[7, 36, 8]","[204,6,16]" |
| 12 | -Compare_test_10,"[81,69,56],[81,69,56]","fp32,fp32","ND,ND","[-1,1],[-10,10]","[81,69,7]",uint8,ND,ne,bit,68957,"[31, 19, 8]","[226,7,8]",3,0.002477657 | 12 | +Compare_test_10,"[81,69,56],[81,69,56]","fp32,fp32","ND,ND","[-1,1],[-10,10]","[81,69,7]",uint8,ND,ne,bit,68957,"[31, 19, 8]","[226,7,8]" |
| 13 | -Compare_test_11,"[8,13,6],[8,13,6]","fp16,fp16","ND,ND","[-100,100],[-1,1]","[8,13,6]",bool,ND,gt,bool,190,"[2,4,3]","[6,321,16]",1,3.49E-06 | 13 | +Compare_test_11,"[8,13,6],[8,13,6]","fp16,fp16","ND,ND","[-100,100],[-1,1]","[8,13,6]",bool,ND,gt,bool,190,"[2,4,3]","[6,321,16]" |
| 14 | -Compare_test_12,"[21,126,104],[21,126,104]","fp32,fp32","ND,ND","[-100,100],[-100,100]","[21,126,13]",uint8,ND,le,bit,5638,"[5, 27, 8]","[4,81,48]",2,0.002178423 | 14 | +Compare_test_12,"[21,126,104],[21,126,104]","fp32,fp32","ND,ND","[-100,100],[-100,100]","[21,126,13]",uint8,ND,le,bit,5638,"[5, 27, 8]","[4,81,48]" |
| 15 | -Compare_test_13,"[50,5,1,3],[50,5,1,3]","fp16,fp16","ND,ND","[-1,1],[-1,1]","[50,5,1,3]",bool,ND,eq,bool,23,"[21,1,2,1]","[2,6,142,16]",11,4.19E-06 | 15 | +Compare_test_13,"[50,5,1,3],[50,5,1,3]","fp16,fp16","ND,ND","[-1,1],[-1,1]","[50,5,1,3]",bool,ND,eq,bool,23,"[21,1,2,1]","[2,6,142,16]" |
| 16 | -Compare_test_14,"[61,11,22,24],[61,11,22,24]","fp32,fp32","ND,ND","[-10,10],[-10,10]","[61,11,22,3]",uint8,ND,ge,bit,54302,"[30, 2, 3, 8]","[2,454,1,16]",45,0.00280463 | 16 | +Compare_test_14,"[61,11,22,24],[61,11,22,24]","fp32,fp32","ND,ND","[-10,10],[-10,10]","[61,11,22,3]",uint8,ND,ge,bit,54302,"[30, 2, 3, 8]","[2,454,1,16]" |
| 17 | -Compare_test_15,"[58,112],[1,112]","fp32,fp32","ND,ND","[-1,1],[-100,100]","[58,14]",uint8,ND,ge,bit,1940,"[15, 8]","[89,160]",1,2.76E-05 | 17 | +Compare_test_15,"[58,112],[1,112]","fp32,fp32","ND,ND","[-1,1],[-100,100]","[58,14]",uint8,ND,ge,bit,1940,"[15, 8]","[89,160]" |
| 18 | -Compare_test_16,"[96,6],[96,6]","fp16,fp16","ND,ND","[-1,1],[-10,10]","[96,6]",bool,ND,ge,bool,69,"[7,1]","[176,16]",1,3.22E-06 | 18 | +Compare_test_16,"[96,6],[96,6]","fp16,fp16","ND,ND","[-1,1],[-10,10]","[96,6]",bool,ND,ge,bool,69,"[7,1]","[176,16]" |
| 19 | -Compare_test_17,"[18,1],[18,16]","fp32,fp32","ND,ND","[-100,100],[-100,100]","[18,2]",uint8,ND,lt,bit,53,"[8, 8]","[60,248]",1,1.27E-06 | 19 | +Compare_test_17,"[18,1],[18,16]","fp32,fp32","ND,ND","[-100,100],[-100,100]","[18,2]",uint8,ND,lt,bit,53,"[8, 8]","[60,248]" |
| 20 | -Compare_test_18,"[60,82,26],[60,82,26]","fp32,fp32","ND,ND","[-10,10],[-1,1]","[60,82,26]",bool,ND,le,bool,6036,"[16,37,9]","[8,15,104]",6,0.001429617 | 20 | +Compare_test_18,"[60,82,26],[60,82,26]","fp32,fp32","ND,ND","[-10,10],[-1,1]","[60,82,26]",bool,ND,le,bool,6036,"[16,37,9]","[8,15,104]" |
| 21 | -Compare_test_19,"[7,116,8,96],[7,116,1,96]","fp32,fp32","ND,ND","[-100,100],[-10,10]","[7,116,8,96]",bool,ND,eq,bool,18064,"[2,11,4,14]","[373,1,1,24]",44,0.004936695 | 21 | +Compare_test_19,"[7,116,8,96],[7,116,1,96]","fp32,fp32","ND,ND","[-100,100],[-10,10]","[7,116,8,96]",bool,ND,eq,bool,18064,"[2,11,4,14]","[373,1,1,24]" |
| 22 | -Compare_test_20,"[32,32],[32,32]","bf16,bf16","ND,ND","[-1,1],[-1,1]","[32,32]",bool,ND,ne,bool,108,"[16,16]","[16,16]",1,0.0001 | 22 | +Compare_test_20,"[32,32],[32,32]","bf16,bf16","ND,ND","[-1,1],[-1,1]","[32,32]",bool,ND,ne,bool,108,"[16,16]","[16,16]" |
| 23 | -Compare_test_21,"[32,32],[32,32]","int16,int16","ND,ND","[-100,100],[-100,100]","[32,32]",bool,ND,eq,bool,108,"[16,16]","[16,16]",1,0.0001 | 23 | +Compare_test_21,"[32,32],[32,32]","int16,int16","ND,ND","[-100,100],[-100,100]","[32,32]",bool,ND,eq,bool,108,"[16,16]","[16,16]" |
| 24 | -Compare_test_22,"[32,32],[32,32]","int16,int16","ND,ND","[-100,100],[-100,100]","[32,32]",bool,ND,gt,bool,108,"[16,16]","[16,16]",1,0.0001 | 24 | +Compare_test_22,"[32,32],[32,32]","int16,int16","ND,ND","[-100,100],[-100,100]","[32,32]",bool,ND,gt,bool,108,"[16,16]","[16,16]" |
| 25 | -Compare_test_23,"[32,32],[32,32]","int16,int16","ND,ND","[-100,100],[-100,100]","[32,32]",bool,ND,ge,bool,108,"[16,16]","[16,16]",1,0.0001 | 25 | +Compare_test_23,"[32,32],[32,32]","int16,int16","ND,ND","[-100,100],[-100,100]","[32,32]",bool,ND,ge,bool,108,"[16,16]","[16,16]" |
| 26 | -Compare_test_24,"[32,32],[32,32]","int16,int16","ND,ND","[-100,100],[-100,100]","[32,32]",bool,ND,ne,bool,108,"[16,16]","[16,16]",1,0.0001 | 26 | +Compare_test_24,"[32,32],[32,32]","int16,int16","ND,ND","[-100,100],[-100,100]","[32,32]",bool,ND,ne,bool,108,"[16,16]","[16,16]" |
| 27 | -Compare_test_25,"[32,32],[32,32]","int16,int16","ND,ND","[-100,100],[-100,100]","[32,32]",bool,ND,le,bool,108,"[16,16]","[16,16]",1,0.0001 | 27 | +Compare_test_25,"[32,32],[32,32]","int16,int16","ND,ND","[-100,100],[-100,100]","[32,32]",bool,ND,le,bool,108,"[16,16]","[16,16]" |
| 28 | -Compare_test_26,"[32,32],[32,32]","int16,int16","ND,ND","[-100,100],[-100,100]","[32,32]",bool,ND,lt,bool,108,"[16,16]","[16,16]",1,0.0001 | 28 | +Compare_test_26,"[32,32],[32,32]","int16,int16","ND,ND","[-100,100],[-100,100]","[32,32]",bool,ND,lt,bool,108,"[16,16]","[16,16]" |
| 29 | +Compare_ge_int64,"[32,32],[32,32]","int64,int64","ND,ND","[-100,100],[-100,100]","[32,32]",bool,ND,ge,bool,108,"[16,16]","[16,16]" | ||
| 30 | +Compare_ge_uint64,"[32,32],[32,32]","uint64,uint64","ND,ND","[1,100],[1,100]","[32,32]",bool,ND,ge,bool,108,"[16,16]","[16,16]" | ||
| 31 | +Compare_tail_int64,"[107,145],[107,145]","int64,int64","ND,ND","[-100,100],[-100,100]","[107,145]",bool,ND,gt,bool,108,"[32,32]","[16,16]" | ||
| 32 | +Compare_tail_uint64,"[107,145],[107,145]","uint64,uint64","ND,ND","[1,100],[1,100]","[107,145]",bool,ND,gt,bool,108,"[32,32]","[16,16]" | ||
| 33 | +Compare_lt_int64,"[32,32],[32,32]","int64,int64","ND,ND","[-100,100],[-100,100]","[32,32]",bool,ND,lt,bool,108,"[16,16]","[16,16]" | ||
| 34 | +Compare_lt_uint64,"[32,32],[32,32]","uint64,uint64","ND,ND","[1,100],[1,100]","[32,32]",bool,ND,lt,bool,108,"[16,16]","[16,16]" | ||
| 35 | +Compare_le_int64,"[32,32],[32,32]","int64,int64","ND,ND","[-100,100],[-100,100]","[32,32]",bool,ND,le,bool,108,"[16,16]","[3,8]" | ||
| 36 | +Compare_le_uint64,"[32,32],[32,32]","uint64,uint64","ND,ND","[1,100],[1,100]","[32,32]",bool,ND,le,bool,108,"[16,16]","[3,8]" | ||
| 37 | +Compare_ne_int64,"[32,32],[32,32]","int64,int64","ND,ND","[-100,100],[-100,100]","[32,32]",bool,ND,ne,bool,108,"[16,16]","[16,16]" | ||
| 38 | +Compare_ne_uint64,"[32,32],[32,32]","uint64,uint64","ND,ND","[1,100],[1,100]","[32,32]",bool,ND,ne,bool,108,"[16,16]","[16,16]" | ||
| @@ -26,3 +26,9 @@ Div_test_24,"[496, 128, 64], [496, 128, 64]","int32, int32","ND, ND","[-100, 100 | |||
| 26 | Div_test_25,"[1024, 128], [1024, 128]","int32, int32","ND, ND","[-10, 10], [1, 1]","[1024, 128]",fp32,ND,"[128, 512]","[64, 64]" | 26 | Div_test_25,"[1024, 128], [1024, 128]","int32, int32","ND, ND","[-10, 10], [1, 1]","[1024, 128]",fp32,ND,"[128, 512]","[64, 64]" |
| 27 | Div_test_26,"[1024, 128], [1024, 128]","int32, int32","ND, ND","[16777217, 2147483647], [2, 10]","[1024, 128]",fp32,ND,"[128, 512]","[64, 64]" | 27 | Div_test_26,"[1024, 128], [1024, 128]","int32, int32","ND, ND","[16777217, 2147483647], [2, 10]","[1024, 128]",fp32,ND,"[128, 512]","[64, 64]" |
| 28 | Div_test_27,"[1024, 128], [1024, 128]","int32, int32","ND, ND","[-2147483648, -2147483648], [2, 10]","[1024, 128]",fp32,ND,"[128, 512]","[64, 64]" | 28 | Div_test_27,"[1024, 128], [1024, 128]","int32, int32","ND, ND","[-2147483648, -2147483648], [2, 10]","[1024, 128]",fp32,ND,"[128, 512]","[64, 64]" |
| 29 | +Div_int64,"[32, 32], [32, 32]","int64, int64","ND, ND","[-100, 100], [1, 100]","[32, 32]",int64,ND,"[16, 16]","[16, 16]" | ||
| 30 | +Div_uint64,"[32, 32], [32, 32]","uint64, uint64","ND, ND","[1, 100], [1, 100]","[32, 32]",uint64,ND,"[16, 16]","[16, 16]" | ||
| 31 | +Div_tail_int64,"[107, 145], [107, 145]","int64, int64","ND, ND","[-100, 100], [1, 100]","[107, 145]",int64,ND,"[32, 32]","[16, 16]" | ||
| 32 | +Div_tail_uint64,"[107, 145], [107, 145]","uint64, uint64","ND, ND","[1, 100], [1, 100]","[107, 145]",uint64,ND,"[32, 32]","[16, 16]" | ||
| 33 | +Div_3d_int64,"[2, 32, 32], [2, 32, 32]","int64, int64","ND, ND","[-100, 100], [1, 100]","[2, 32, 32]",int64,ND,"[2, 16, 16]","[2, 8, 8]" | ||
| 34 | +Div_3d_uint64,"[2, 32, 32], [2, 32, 32]","uint64, uint64","ND, ND","[1, 100], [1, 100]","[2, 32, 32]",uint64,ND,"[2, 16, 16]","[2, 8, 8]" | ||
| @@ -16,3 +16,5 @@ Divs_test_14,"[64, 128]",bf16,ND,"[-10, 10]","[64, 128]",fp32,ND,"[7, 43]","[192 | |||
| 16 | Divs_test_15,"[64, 128]",fp32,ND,"[-10, 10]","[64, 128]",fp32,ND,"[7, 43]","[192, 120]",-5,int16 | 16 | Divs_test_15,"[64, 128]",fp32,ND,"[-10, 10]","[64, 128]",fp32,ND,"[7, 43]","[192, 120]",-5,int16 |
| 17 | Divs_test_16,"[64, 128]",int16,ND,"[-100, 100]","[64, 128]",fp32,ND,"[7, 43]","[192, 120]",100,int32 | 17 | Divs_test_16,"[64, 128]",int16,ND,"[-100, 100]","[64, 128]",fp32,ND,"[7, 43]","[192, 120]",100,int32 |
| 18 | Divs_test_17,"[64, 128]",int16,ND,"[-100, 100]","[64, 128]",fp32,ND,"[7, 43]","[192, 120]",2147483647,int32 | 18 | Divs_test_17,"[64, 128]",int16,ND,"[-100, 100]","[64, 128]",fp32,ND,"[7, 43]","[192, 120]",2147483647,int32 |
| 19 | +Divs_int64,"[32, 32]",int64,ND,"[-100, 100]","[32, 32]",int64,ND,"[16, 16]","[16, 16]",3,int64 | ||
| 20 | +Divs_uint64,"[32, 32]",uint64,ND,"[1, 100]","[32, 32]",uint64,ND,"[16, 16]","[16, 16]",3,uint64 | ||
| @@ -25,3 +25,5 @@ FloorDiv_test_23,"[1024, 128], [1024, 128]","int8, int8","ND, ND","[-64, 63], [- | |||
| 25 | FloorDiv_test_24,"[1024, 128], [1024, 128]","uint8, uint8","ND, ND","[0, 127], [1, 16]","[1024, 128]",uint8,ND,"[128, 512]","[64, 64]" | 25 | FloorDiv_test_24,"[1024, 128], [1024, 128]","uint8, uint8","ND, ND","[0, 127], [1, 16]","[1024, 128]",uint8,ND,"[128, 512]","[64, 64]" |
| 26 | FloorDiv_test_25,"[16, 512], [16, 1]","int8, int8","ND, ND","[-64, 63], [1, 7]","[16, 512]",int8,ND,"[5, 152]","[33, 32]" | 26 | FloorDiv_test_25,"[16, 512], [16, 1]","int8, int8","ND, ND","[-64, 63], [1, 7]","[16, 512]",int8,ND,"[5, 152]","[33, 32]" |
| 27 | FloorDiv_test_26,"[1024, 128], [1024, 128]","int8, int8","ND, ND","[-64, 63], [0, 0]","[1024, 128]",int8,ND,"[128, 512]","[64, 64]" | 27 | FloorDiv_test_26,"[1024, 128], [1024, 128]","int8, int8","ND, ND","[-64, 63], [0, 0]","[1024, 128]",int8,ND,"[128, 512]","[64, 64]" |
| 28 | +FloorDiv_test_27,"[1024, 128], [1024, 128]","int64, int64","ND, ND","[1, 1000], [1, 100]","[1024, 128]",int64,ND,"[128, 510]","[33, 64]" | ||
| 29 | +FloorDiv_test_28,"[1024, 128], [1024, 128]","int64, int64","ND, ND","[-1000, -1], [1, 100]","[1024, 128]",int64,ND,"[49, 510]","[32, 64]" | ||
| @@ -8,3 +8,5 @@ FloorDivs_test_6,"[16, 33, 64]",bfloat,ND,"[-10, 10]","[16, 33, 64]",bfloat,ND," | |||
| 8 | FloorDivs_test_7,"[1024, 128]",int8,ND,"[-64, 63]","[1024, 128]",int8,ND,"[128, 512]","[64, 64]",-3,int8 | 8 | FloorDivs_test_7,"[1024, 128]",int8,ND,"[-64, 63]","[1024, 128]",int8,ND,"[128, 512]","[64, 64]",-3,int8 |
| 9 | FloorDivs_test_8,"[1024, 128]",uint8,ND,"[0, 127]","[1024, 128]",uint8,ND,"[128, 512]","[64, 64]",3,uint8 | 9 | FloorDivs_test_8,"[1024, 128]",uint8,ND,"[0, 127]","[1024, 128]",uint8,ND,"[128, 512]","[64, 64]",3,uint8 |
| 10 | FloorDivs_test_9,"[1024, 128]",int8,ND,"[-64, 63]","[1024, 128]",int8,ND,"[128, 512]","[64, 64]",0,int8 | 10 | FloorDivs_test_9,"[1024, 128]",int8,ND,"[-64, 63]","[1024, 128]",int8,ND,"[128, 512]","[64, 64]",0,int8 |
| 11 | +FloorDivs_test_10,"[1024, 128]",int64,ND,"[-100, 100]","[1024, 128]",int64,ND,"[128, 512]","[33, 64]",3,int64 | ||
| 12 | +FloorDivs_test_11,"[1024, 128]",int64,ND,"[-100, 100]","[1024, 128]",int64,ND,"[128, 512]","[32, 64]",-3,int64 | ||
| @@ -17,3 +17,7 @@ Full_test_14,"[3072, 28672]",fp32,ND,"[-100, 100]","[3072, 28672]",fp32,ND,"[256 | |||
| 17 | Full_test_15,"[16384, 512]",fp32,ND,"[-10, 10]","[16384, 512]",fp32,ND,"[16384, 512]","[128, 128]",-0.05,fp32 | 17 | Full_test_15,"[16384, 512]",fp32,ND,"[-10, 10]","[16384, 512]",fp32,ND,"[16384, 512]","[128, 128]",-0.05,fp32 |
| 18 | Full_test_16,"[32, 32]",fp16,ND,"[-100, 100]","[32, 32]",fp16,ND,"[32, 32]","[16, 16]",2,fp16 | 18 | Full_test_16,"[32, 32]",fp16,ND,"[-100, 100]","[32, 32]",fp16,ND,"[32, 32]","[16, 16]",2,fp16 |
| 19 | Full_test_17,"[32, 32]",bf16,ND,"[-100, 100]","[32, 32]",bf16,ND,"[32, 32]","[16, 16]",2,bf16 | 19 | Full_test_17,"[32, 32]",bf16,ND,"[-100, 100]","[32, 32]",bf16,ND,"[32, 32]","[16, 16]",2,bf16 |
| 20 | +Full_int64,"[32, 32]",int64,ND,"[-1, 1]","[32, 32]",int64,ND,"[16, 16]","[16, 16]",7,int64 | ||
| 21 | +Full_uint64,"[32, 32]",uint64,ND,"[-1, 1]","[32, 32]",uint64,ND,"[16, 16]","[16, 16]",7,uint64 | ||
| 22 | +Full_3d_int64,"[2, 16, 32]",int64,ND,"[-1, 1]","[2, 16, 32]",int64,ND,"[1, 16, 32]","[1, 16, 32]",7,int64 | ||
| 23 | +Full_3d_uint64,"[2, 16, 32]",uint64,ND,"[-1, 1]","[2, 16, 32]",uint64,ND,"[1, 16, 32]","[1, 16, 32]",7,uint64 | ||
| @@ -53,3 +53,5 @@ GatherElement_test_50,"[10, 10], [5, 9]","uint32, int32","ND, ND","[0,100], [0, | |||
| 53 | GatherElement_test_51,"[10, 10], [5, 9]","uint32, int32","ND, ND","[0,100], [0, 10]","[5, 9]",uint32,ND,"[10, 8]","[3, 16]",0 | 53 | GatherElement_test_51,"[10, 10], [5, 9]","uint32, int32","ND, ND","[0,100], [0, 10]","[5, 9]",uint32,ND,"[10, 8]","[3, 16]",0 |
| 54 | GatherElement_test_52,"[16, 16, 16], [8, 8, 8]","uint32, int32","ND, ND","[0,100], [0, 16]","[8, 8, 8]",uint32,ND,"[8, 16, 8]","[5, 16, 8]",1 | 54 | GatherElement_test_52,"[16, 16, 16], [8, 8, 8]","uint32, int32","ND, ND","[0,100], [0, 16]","[8, 8, 8]",uint32,ND,"[8, 16, 8]","[5, 16, 8]",1 |
| 55 | GatherElement_test_53,"[16, 16, 16, 16], [8, 8, 8, 8]","uint32, int32","ND, ND","[0,100], [0, 16]","[8, 8, 8, 8]",uint32,ND,"[8, 8, 8, 16]","[8, 9, 13, 16]",3 | 55 | GatherElement_test_53,"[16, 16, 16, 16], [8, 8, 8, 8]","uint32, int32","ND, ND","[0,100], [0, 16]","[8, 8, 8, 8]",uint32,ND,"[8, 8, 8, 16]","[8, 9, 13, 16]",3 |
| 56 | +GatherElement_int64,"[10, 10], [5, 9]","int64, int32","ND, ND","[-100, 100], [0, 10]","[5, 9]",int64,ND,"[10, 8]","[3, 8]",0 | ||
| 57 | +GatherElement_uint64,"[10, 10], [5, 9]","uint64, int32","ND, ND","[1, 100], [0, 10]","[5, 9]",uint64,ND,"[10, 8]","[3, 8]",0 | ||
| @@ -54,3 +54,9 @@ Maximum_test_16,"[32, 32], [32, 32]","int8, int8","ND, ND","[-10, 10], [-10, 10] | |||
| 54 | Maximum_test_17,"[32, 32], [32, 32]","uint8, uint8","ND, ND","[-10, 10], [-10, 10]","[32, 32]",uint8,ND,"[16, 16]","[16, 16]" | 54 | Maximum_test_17,"[32, 32], [32, 32]","uint8, uint8","ND, ND","[-10, 10], [-10, 10]","[32, 32]",uint8,ND,"[16, 16]","[16, 16]" |
| 55 | Maximum_test_18,"[32, 32], [32, 32]","uint16, uint16","ND, ND","[-100, 100], [-100, 100]","[32, 32]",uint16,ND,"[16, 16]","[16, 16]" | 55 | Maximum_test_18,"[32, 32], [32, 32]","uint16, uint16","ND, ND","[-100, 100], [-100, 100]","[32, 32]",uint16,ND,"[16, 16]","[16, 16]" |
| 56 | Maximum_test_19,"[32, 32], [32, 32]","uint32, uint32","ND, ND","[-1000, 1000], [-1000, 1000]","[32, 32]",uint32,ND,"[16, 16]","[16, 16]" | 56 | Maximum_test_19,"[32, 32], [32, 32]","uint32, uint32","ND, ND","[-1000, 1000], [-1000, 1000]","[32, 32]",uint32,ND,"[16, 16]","[16, 16]" |
| 57 | +Maximum_int64,"[32, 32], [32, 32]","int64, int64","ND, ND","[-100, 100], [-100, 100]","[32, 32]",int64,ND,"[16, 16]","[16, 16]" | ||
| 58 | +Maximum_uint64,"[32, 32], [32, 32]","uint64, uint64","ND, ND","[1, 100], [1, 100]","[32, 32]",uint64,ND,"[16, 16]","[16, 16]" | ||
| 59 | +Maximum_tail_int64,"[107, 145], [107, 145]","int64, int64","ND, ND","[-100, 100], [-100, 100]","[107, 145]",int64,ND,"[32, 32]","[16, 16]" | ||
| 60 | +Maximum_tail_uint64,"[107, 145], [107, 145]","uint64, uint64","ND, ND","[1, 100], [1, 100]","[107, 145]",uint64,ND,"[32, 32]","[16, 16]" | ||
| 61 | +Maximum_3d_int64,"[2, 32, 32], [2, 32, 32]","int64, int64","ND, ND","[-100, 100], [-100, 100]","[2, 32, 32]",int64,ND,"[2, 16, 16]","[2, 8, 8]" | ||
| 62 | +Maximum_3d_uint64,"[2, 32, 32], [2, 32, 32]","uint64, uint64","ND, ND","[1, 100], [1, 100]","[2, 32, 32]",uint64,ND,"[2, 16, 16]","[2, 8, 8]" | ||
| @@ -54,3 +54,9 @@ Minimum_test_16,"[32, 32], [32, 32]","int8, int8","ND, ND","[-10, 10], [-10, 10] | |||
| 54 | Minimum_test_17,"[32, 32], [32, 32]","uint8, uint8","ND, ND","[-10, 10], [-10, 10]","[32, 32]",uint8,ND,"[16, 16]","[16, 16]" | 54 | Minimum_test_17,"[32, 32], [32, 32]","uint8, uint8","ND, ND","[-10, 10], [-10, 10]","[32, 32]",uint8,ND,"[16, 16]","[16, 16]" |
| 55 | Minimum_test_18,"[32, 32], [32, 32]","uint16, uint16","ND, ND","[-100, 100], [-100, 100]","[32, 32]",uint16,ND,"[16, 16]","[16, 16]" | 55 | Minimum_test_18,"[32, 32], [32, 32]","uint16, uint16","ND, ND","[-100, 100], [-100, 100]","[32, 32]",uint16,ND,"[16, 16]","[16, 16]" |
| 56 | Minimum_test_19,"[32, 32], [32, 32]","uint32, uint32","ND, ND","[-1000, 1000], [-1000, 1000]","[32, 32]",uint32,ND,"[16, 16]","[16, 16]" | 56 | Minimum_test_19,"[32, 32], [32, 32]","uint32, uint32","ND, ND","[-1000, 1000], [-1000, 1000]","[32, 32]",uint32,ND,"[16, 16]","[16, 16]" |
| 57 | +Minimum_int64,"[32, 32], [32, 32]","int64, int64","ND, ND","[-100, 100], [-100, 100]","[32, 32]",int64,ND,"[16, 16]","[16, 16]" | ||
| 58 | +Minimum_uint64,"[32, 32], [32, 32]","uint64, uint64","ND, ND","[1, 100], [1, 100]","[32, 32]",uint64,ND,"[16, 16]","[16, 16]" | ||
| 59 | +Minimum_tail_int64,"[107, 145], [107, 145]","int64, int64","ND, ND","[-100, 100], [-100, 100]","[107, 145]",int64,ND,"[32, 32]","[16, 16]" | ||
| 60 | +Minimum_tail_uint64,"[107, 145], [107, 145]","uint64, uint64","ND, ND","[1, 100], [1, 100]","[107, 145]",uint64,ND,"[32, 32]","[16, 16]" | ||
| 61 | +Minimum_3d_int64,"[2, 32, 32], [2, 32, 32]","int64, int64","ND, ND","[-100, 100], [-100, 100]","[2, 32, 32]",int64,ND,"[2, 16, 16]","[2, 8, 8]" | ||
| 62 | +Minimum_3d_uint64,"[2, 32, 32], [2, 32, 32]","uint64, uint64","ND, ND","[1, 100], [1, 100]","[2, 32, 32]",uint64,ND,"[2, 16, 16]","[2, 8, 8]" | ||
| @@ -32,3 +32,9 @@ Mul_test_30,"[32, 32], [32, 32]","bf16, bf16","ND, ND","[-100, 100], [-10, 10]", | |||
| 32 | Mul_test_33,"[32, 32], [32, 32]","uint16, uint16","ND, ND","[-100, 100], [-100, 100]","[32, 32]",uint16,ND,"[16, 16]","[16, 16]" | 32 | Mul_test_33,"[32, 32], [32, 32]","uint16, uint16","ND, ND","[-100, 100], [-100, 100]","[32, 32]",uint16,ND,"[16, 16]","[16, 16]" |
| 33 | Mul_test_34,"[32, 32], [32, 32]","uint32, uint32","ND, ND","[-1000, 1000], [-1000, 1000]","[32, 32]",uint32,ND,"[16, 16]","[16, 16]" | 33 | Mul_test_34,"[32, 32], [32, 32]","uint32, uint32","ND, ND","[-1000, 1000], [-1000, 1000]","[32, 32]",uint32,ND,"[16, 16]","[16, 16]" |
| 34 | Mul_test_35,"[64], [1]","fp16, fp16","ND, ND","[1, 1], [2, 2]","[64]",fp16,ND,"[64]","[64]" | 34 | Mul_test_35,"[64], [1]","fp16, fp16","ND, ND","[1, 1], [2, 2]","[64]",fp16,ND,"[64]","[64]" |
| 35 | +Mul_int64,"[32, 32], [32, 32]","int64, int64","ND, ND","[-10, 10], [-10, 10]","[32, 32]",int64,ND,"[16, 16]","[16, 16]" | ||
| 36 | +Mul_uint64,"[32, 32], [32, 32]","uint64, uint64","ND, ND","[1, 10], [1, 10]","[32, 32]",uint64,ND,"[16, 16]","[16, 16]" | ||
| 37 | +Mul_tail_int64,"[107, 145], [107, 145]","int64, int64","ND, ND","[-10, 10], [-10, 10]","[107, 145]",int64,ND,"[32, 32]","[16, 16]" | ||
| 38 | +Mul_tail_uint64,"[107, 145], [107, 145]","uint64, uint64","ND, ND","[1, 10], [1, 10]","[107, 145]",uint64,ND,"[32, 32]","[16, 16]" | ||
| 39 | +Mul_3d_int64,"[2, 32, 32], [2, 32, 32]","int64, int64","ND, ND","[-10, 10], [-10, 10]","[2, 32, 32]",int64,ND,"[2, 16, 16]","[2, 8, 8]" | ||
| 40 | +Mul_3d_uint64,"[2, 32, 32], [2, 32, 32]","uint64, uint64","ND, ND","[1, 10], [1, 10]","[2, 32, 32]",uint64,ND,"[2, 16, 16]","[2, 8, 8]" | ||
| @@ -15,3 +15,5 @@ Muls_test_12,"[128, 128]",fp32,ND,"[-100, 100]","[128, 128]",fp32,ND,"[32, 32]", | |||
| 15 | Muls_test_13,"[16, 512]",fp32,ND,"[-100, 100]","[16, 512]",fp32,ND,"[2, 117]","[590, 16]",0.044194,fp32 | 15 | Muls_test_13,"[16, 512]",fp32,ND,"[-100, 100]","[16, 512]",fp32,ND,"[2, 117]","[590, 16]",0.044194,fp32 |
| 16 | Muls_test_14,"[2048, 1, 127]",fp32,ND,"[-1, 1]","[2048, 1, 127]",fp32,ND,"[638, 2, 59]","[3, 83, 56]",0.41667,fp32 | 16 | Muls_test_14,"[2048, 1, 127]",fp32,ND,"[-1, 1]","[2048, 1, 127]",fp32,ND,"[638, 2, 59]","[3, 83, 56]",0.41667,fp32 |
| 17 | Muls_test_15,"[16, 127, 128, 32]",fp32,ND,"[-10, 10]","[16, 127, 128, 32]",fp32,ND,"[7, 54, 6, 14]","[6, 12, 20, 8]",-1,fp32 | 17 | Muls_test_15,"[16, 127, 128, 32]",fp32,ND,"[-10, 10]","[16, 127, 128, 32]",fp32,ND,"[7, 54, 6, 14]","[6, 12, 20, 8]",-1,fp32 |
| 18 | +Muls_int64,"[32, 32]",int64,ND,"[-10, 10]","[32, 32]",int64,ND,"[16, 16]","[16, 16]",3,int64 | ||
| 19 | +Muls_uint64,"[32, 32]",uint64,ND,"[1, 10]","[32, 32]",uint64,ND,"[16, 16]","[16, 16]",3,uint64 | ||
| @@ -13,3 +13,6 @@ Neg_test_10,"[3072, 0]",fp32,ND,"[-1, 1]","[3072, 0]",fp32,ND,"[128, 128]","[32, | |||
| 13 | Neg_test_11,"[96, 12288]",int32,ND,"[-5, 5]","[96, 12288]",int32,ND,"[128, 128]","[32, 32]" | 13 | Neg_test_11,"[96, 12288]",int32,ND,"[-5, 5]","[96, 12288]",int32,ND,"[128, 128]","[32, 32]" |
| 14 | Neg_test_12,"[1, 8192]",fp32,ND,"[-1, 1]","[1, 8192]",fp32,ND,"[128, 128]","[32, 32]" | 14 | Neg_test_12,"[1, 8192]",fp32,ND,"[-1, 1]","[1, 8192]",fp32,ND,"[128, 128]","[32, 32]" |
| 15 | Neg_test_13,"[96, 8192]",fp16,ND,"[-1, 1]","[96, 8192]",fp16,ND,"[128, 128]","[32, 32]" | 15 | Neg_test_13,"[96, 8192]",fp16,ND,"[-1, 1]","[96, 8192]",fp16,ND,"[128, 128]","[32, 32]" |
| 16 | +Neg_int64,"[32, 32]",int64,ND,"[-100, 100]","[32, 32]",int64,ND,"[16, 16]","[16, 16]" | ||
| 17 | +Neg_tail_int64,"[107, 145]",int64,ND,"[-100, 100]","[107, 145]",int64,ND,"[32, 32]","[16, 16]" | ||
| 18 | +Neg_3d_int64,"[2, 32, 32]",int64,ND,"[-100, 100]","[2, 32, 32]",int64,ND,"[2, 16, 16]","[2, 8, 8]" | ||
| @@ -9,3 +9,5 @@ Range_redline_iter_3_2_fp32_fp32_fp32_2147483653_-1406_-399_dense,"[1],[1],[1]", | |||
| 9 | Range_redline_iter_3_2_fp32_fp32_int64_2147483655_-1280_-315_dense,"[1],[1],[1]","fp32,fp32,int64","ND,ND,ND","[0,0],[0,0],[0,0]",[6817413],fp32,ND,2147483655,-1280.11208,-315,[578340],[7312],0 | 9 | Range_redline_iter_3_2_fp32_fp32_int64_2147483655_-1280_-315_dense,"[1],[1],[1]","fp32,fp32,int64","ND,ND,ND","[0,0],[0,0],[0,0]",[6817413],fp32,ND,2147483655,-1280.11208,-315,[578340],[7312],0 |
| 10 | Range_redline_iter_3_1_int32_int32_fp16_-204_807_247_dense,"[1],[1],[1]","int32,int32,fp16","ND,ND,ND","[0,0],[0,0],[0,0]",[5],fp16,ND,-204,807,247,[1],[8],0 | 10 | Range_redline_iter_3_1_int32_int32_fp16_-204_807_247_dense,"[1],[1],[1]","int32,int32,fp16","ND,ND,ND","[0,0],[0,0],[0,0]",[5],fp16,ND,-204,807,247,[1],[8],0 |
| 11 | Range_redline_iter_3_1_int32_int32_bf16_-2000_3680_174_dense,"[1],[1],[1]","int32,int32,bf16","ND,ND,ND","[0,0],[0,0],[0,0]",[33],bf16,ND,-2000,3680,174.5386,[8],[32],0 | 11 | Range_redline_iter_3_1_int32_int32_bf16_-2000_3680_174_dense,"[1],[1],[1]","int32,int32,bf16","ND,ND,ND","[0,0],[0,0],[0,0]",[33],bf16,ND,-2000,3680,174.5386,[8],[32],0 |
| 12 | +Range_int64,"[1],[1],[1]","int64,int64,int64","ND,ND,ND","[0,0],[0,0],[0,0]",[5],int64,ND,0,10,2,[1],[8],0 | ||
| 13 | +Range_int64_large,"[1],[1],[1]","int64,int64,int64","ND,ND,ND","[0,0],[0,0],[0,0]",[10],int64,ND,2147483648,2147483658,1,[1],[8],0 | ||
| @@ -12,3 +12,5 @@ ReLU_test_9,"[128, 128]",fp32,ND,"[-1, 1]","[128, 128]",fp32,ND,"[40, 40]","[32, | |||
| 12 | ReLU_test_10,"[120, 120]",fp32,ND,"[-10, 10]","[120, 120]",fp32,ND,"[32, 32]","[32, 32]" | 12 | ReLU_test_10,"[120, 120]",fp32,ND,"[-10, 10]","[120, 120]",fp32,ND,"[32, 32]","[32, 32]" |
| 13 | ReLU_test_11,"[16,32]",int16,ND,"[-100,100]","[16,32]",int16,ND,"[16,32]","[16,32]" | 13 | ReLU_test_11,"[16,32]",int16,ND,"[-100,100]","[16,32]",int16,ND,"[16,32]","[16,32]" |
| 14 | ReLU_test_12,"[16,32]",int32,ND,"[-100,100]","[16,32]",int32,ND,"[16,32]","[16,32]" | 14 | ReLU_test_12,"[16,32]",int32,ND,"[-100,100]","[16,32]",int32,ND,"[16,32]","[16,32]" |
| 15 | +ReLU_test_13,"[16,32]",int64,ND,"[-100,100]","[16,32]",int64,ND,"[16,32]","[16,32]" | ||
| 16 | +ReLU_test_14,"[107,145]",int64,ND,"[-100,100]","[107,145]",int64,ND,"[32,32]","[16,16]" | ||
| @@ -13,3 +13,4 @@ RemainderRS_3D_align_fp32,"[16,16,16]",fp32,ND,"[-50,50]","[16,16,16]",fp32,ND," | |||
| 13 | RemainderRS_3D_unalign_fp16_fp32,"[24,24,24]",fp16,ND,"[-50,50]","[24,24,24]",fp16,ND,"[12,12,12]","[6,6,16]",114.5,fp32 | 13 | RemainderRS_3D_unalign_fp16_fp32,"[24,24,24]",fp16,ND,"[-50,50]","[24,24,24]",fp16,ND,"[12,12,12]","[6,6,16]",114.5,fp32 |
| 14 | RemainderRS_3D_align_int32,"[32,32,32]",int32,ND,"[1,10]","[32,32,32]",int32,ND,"[16,16,16]","[8,8,8]",54,int32 | 14 | RemainderRS_3D_align_int32,"[32,32,32]",int32,ND,"[1,10]","[32,32,32]",int32,ND,"[16,16,16]","[8,8,8]",54,int32 |
| 15 | RemainderRS_4D_unalign_fp32,"[12,12,12,12]",fp32,ND,"[1,50]","[12,12,12,12]",fp32,ND,"[6,6,6,6]","[3,3,3,16]",311.75,fp32 | 15 | RemainderRS_4D_unalign_fp32,"[12,12,12,12]",fp32,ND,"[1,50]","[12,12,12,12]",fp32,ND,"[6,6,6,6]","[3,3,3,16]",311.75,fp32 |
| 16 | +RemainderRS_int64,"[32, 32]",int64,ND,"[1, 100]","[32, 32]",int64,ND,"[16, 16]","[16, 16]",34,int64 | ||
| @@ -14,3 +14,4 @@ RemainderS_3D_unalign_fp16,"[24,24,24]",fp16,ND,"[-50,50]","[24,24,24]",fp16,ND, | |||
| 14 | RemainderS_3D_align_int32,"[32,32,32]",int32,ND,"[1,100]","[32,32,32]",int32,ND,"[16,16,16]","[8,8,8]",5,int32 | 14 | RemainderS_3D_align_int32,"[32,32,32]",int32,ND,"[1,100]","[32,32,32]",int32,ND,"[16,16,16]","[8,8,8]",5,int32 |
| 15 | RemainderS_4D_align_bf16,"[8,8,8,8]",bf16,ND,"[1,20]","[8,8,8,8]",bf16,ND,"[4,4,4,4]","[2,2,2,8]",3.75,fp32 | 15 | RemainderS_4D_align_bf16,"[8,8,8,8]",bf16,ND,"[1,20]","[8,8,8,8]",bf16,ND,"[4,4,4,4]","[2,2,2,8]",3.75,fp32 |
| 16 | RemainderS_4D_unalign_int16,"[12,12,12,12]",int16,ND,"[1,50]","[12,12,12,12]",int16,ND,"[6,6,6,6]","[3,3,3,16]",3,int32 | 16 | RemainderS_4D_unalign_int16,"[12,12,12,12]",int16,ND,"[1,50]","[12,12,12,12]",int16,ND,"[6,6,6,6]","[3,3,3,16]",3,int32 |
| 17 | +RemainderS_int64,"[32, 32]",int64,ND,"[1, 100]","[32, 32]",int64,ND,"[16, 16]","[16, 16]",3,int64 | ||
| @@ -18,3 +18,6 @@ Remainder_3D_2,"[10,10,20], [10,10,20]","bf16, bf16","ND, ND","[-100,-1], [1,100 | |||
| 18 | Remainder_3D_3,"[10,10,20], [10,10,20]","int32, int32","ND, ND","[-100,-1], [1,100]","[10,10,20]",int32,ND,"[10,10,10]","[3, 8, 8]" | 18 | Remainder_3D_3,"[10,10,20], [10,10,20]","int32, int32","ND, ND","[-100,-1], [1,100]","[10,10,20]",int32,ND,"[10,10,10]","[3, 8, 8]" |
| 19 | Remainder_3D_4,"[10,10,20], [10,10,20]","int16, int16","ND, ND","[-100,-1], [1,100]","[10,10,20]",int16,ND,"[10,10,10]","[3, 8, 16]" | 19 | Remainder_3D_4,"[10,10,20], [10,10,20]","int16, int16","ND, ND","[-100,-1], [1,100]","[10,10,20]",int16,ND,"[10,10,10]","[3, 8, 16]" |
| 20 | Remainder_4D_0,"[10,10,20,18], [10,10,20,18]","int16, int16","ND, ND","[-100,-1], [1,100]","[10,10,20,18]",int16,ND,"[10,10,10,18]","[3, 8, 8,16]" | 20 | Remainder_4D_0,"[10,10,20,18], [10,10,20,18]","int16, int16","ND, ND","[-100,-1], [1,100]","[10,10,20,18]",int16,ND,"[10,10,10,18]","[3, 8, 8,16]" |
| 21 | +Remainder_int64,"[32, 32], [32, 32]","int64, int64","ND, ND","[1, 100], [1, 100]","[32, 32]",int64,ND,"[16, 16]","[16, 16]" | ||
| 22 | +Remainder_tail_int64,"[107, 145], [107, 145]","int64, int64","ND, ND","[1, 100], [1, 100]","[107, 145]",int64,ND,"[32, 32]","[16, 16]" | ||
| 23 | +Remainder_3d_int64,"[2, 32, 32], [2, 32, 32]","int64, int64","ND, ND","[1, 100], [1, 100]","[2, 32, 32]",int64,ND,"[2, 16, 16]","[2, 8, 8]" | ||
| @@ -14,3 +14,5 @@ Round_test_11,"[128, 128]",fp32,ND,"[0, 0]","[128, 128]",fp32,ND,"[128, 128]","[ | |||
| 14 | Round_test_12,"[120, 120]",int32,ND,"[0, 1]","[120, 120]",int32,ND,"[40, 40]","[32, 32]",0 | 14 | Round_test_12,"[120, 120]",int32,ND,"[0, 1]","[120, 120]",int32,ND,"[40, 40]","[32, 32]",0 |
| 15 | Round_test_13,"[128, 128]",int32,ND,"[0, 1]","[128, 128]",int32,ND,"[40, 40]","[32, 32]",-1 | 15 | Round_test_13,"[128, 128]",int32,ND,"[0, 1]","[128, 128]",int32,ND,"[40, 40]","[32, 32]",-1 |
| 16 | Round_test_14,"[120, 120]",int16,ND,"[0, 1]","[120, 120]",int16,ND,"[32, 32]","[32, 32]",-2 | 16 | Round_test_14,"[120, 120]",int16,ND,"[0, 1]","[120, 120]",int16,ND,"[32, 32]","[32, 32]",-2 |
| 17 | +Round_test_15,"[128, 128]",int64,ND,"[-100, 100]","[128, 128]",int64,ND,"[32, 32]","[32, 32]",0 | ||
| 18 | +Round_test_16,"[107, 145]",int64,ND,"[-100, 100]","[107, 145]",int64,ND,"[32, 32]","[16, 16]",0 | ||
| @@ -7,3 +7,5 @@ SBitwiseLeftShift_test_4,"[0, 384]",int16,ND,"[-10, 10]","[0, 384]",int16,ND,"[1 | |||
| 7 | SBitwiseLeftShift_test_5,"[3072, 384]",int16,ND,"[-10, 10]","[3072, 384]",int16,ND,"[128, 128]","[32, 32]",17,int16 | 7 | SBitwiseLeftShift_test_5,"[3072, 384]",int16,ND,"[-10, 10]","[3072, 384]",int16,ND,"[128, 128]","[32, 32]",17,int16 |
| 8 | SBitwiseLeftShift_test_6,"[98304, 384]",int16,ND,"[-10, 10]","[98304, 384]",int16,ND,"[6144, 96]","[128, 32]",50,int16 | 8 | SBitwiseLeftShift_test_6,"[98304, 384]",int16,ND,"[-10, 10]","[98304, 384]",int16,ND,"[6144, 96]","[128, 32]",50,int16 |
| 9 | SBitwiseLeftShift_test_7,"[64, 36864]",int16,ND,"[-10, 10]","[64, 36864]",int16,ND,"[32, 1024]","[32, 128]",17,int16 | 9 | SBitwiseLeftShift_test_7,"[64, 36864]",int16,ND,"[-10, 10]","[64, 36864]",int16,ND,"[32, 1024]","[32, 128]",17,int16 |
| 10 | +SBitwiseLeftShift_int64,"[32, 32]",int64,ND,"[1, 5]","[32, 32]",int64,ND,"[16, 16]","[16, 16]",100,int64 | ||
| 11 | +SBitwiseLeftShift_uint64,"[32, 32]",uint64,ND,"[1, 5]","[32, 32]",uint64,ND,"[16, 16]","[16, 16]",100,uint64 | ||
| @@ -7,3 +7,5 @@ SBitwiseRightShift_test_4,"[0, 384]",int16,ND,"[-10, 10]","[0, 384]",int16,ND,"[ | |||
| 7 | SBitwiseRightShift_test_5,"[3072, 384]",int16,ND,"[-10, 10]","[3072, 384]",int16,ND,"[128, 128]","[32, 32]",17,int16 | 7 | SBitwiseRightShift_test_5,"[3072, 384]",int16,ND,"[-10, 10]","[3072, 384]",int16,ND,"[128, 128]","[32, 32]",17,int16 |
| 8 | SBitwiseRightShift_test_6,"[98304, 384]",int16,ND,"[-10, 10]","[98304, 384]",int16,ND,"[6144, 96]","[128, 32]",50,int16 | 8 | SBitwiseRightShift_test_6,"[98304, 384]",int16,ND,"[-10, 10]","[98304, 384]",int16,ND,"[6144, 96]","[128, 32]",50,int16 |
| 9 | SBitwiseRightShift_test_7,"[64, 36864]",int16,ND,"[-10, 10]","[64, 36864]",int16,ND,"[32, 1024]","[32, 128]",17,int16 | 9 | SBitwiseRightShift_test_7,"[64, 36864]",int16,ND,"[-10, 10]","[64, 36864]",int16,ND,"[32, 1024]","[32, 128]",17,int16 |
| 10 | +SBitwiseRightShift_int64,"[32, 32]",int64,ND,"[1, 5]","[32, 32]",int64,ND,"[16, 16]","[16, 16]",100,int64 | ||
| 11 | +SBitwiseRightShift_uint64,"[32, 32]",uint64,ND,"[1, 5]","[32, 32]",uint64,ND,"[16, 16]","[16, 16]",100,uint64 | ||
| @@ -34,3 +34,4 @@ ScatterNonInplace_test_31,"[3,10],[1,9],[2,9]","int8,int64,int8","ND,ND,ND","[-1 | |||
| 34 | ScatterNonInplace_test_32,"[3,10],[1,9],[2,9]","uint8,int64,uint8","ND,ND,ND","[0,10],[0,3],[0,10]","[3,10]",uint8,ND,"[3,8]","[3,8]",0,add | 34 | ScatterNonInplace_test_32,"[3,10],[1,9],[2,9]","uint8,int64,uint8","ND,ND,ND","[0,10],[0,3],[0,10]","[3,10]",uint8,ND,"[3,8]","[3,8]",0,add |
| 35 | ScatterNonInplace_test_33,"[3,10],[1,9],[2,9]","int16,int64,int16","ND,ND,ND","[-100,100],[0,3],[-100,100]","[3,10]",int16,ND,"[3,8]","[3,8]",0,multiply | 35 | ScatterNonInplace_test_33,"[3,10],[1,9],[2,9]","int16,int64,int16","ND,ND,ND","[-100,100],[0,3],[-100,100]","[3,10]",int16,ND,"[3,8]","[3,8]",0,multiply |
| 36 | ScatterNonInplace_test_34,"[3,10],[1,9],[2,9]","int32,int64,int32","ND,ND,ND","[-100,100],[0,3],[-100,100]","[3,10]",int32,ND,"[3,8]","[3,8]",0, | 36 | ScatterNonInplace_test_34,"[3,10],[1,9],[2,9]","int32,int64,int32","ND,ND,ND","[-100,100],[0,3],[-100,100]","[3,10]",int32,ND,"[3,8]","[3,8]",0, |
| 37 | +ScatterTensor_int64,"[3,10],[1,9],[2,9]","int64,int64,int64","ND,ND,ND","[-100,100],[0,3],[-100,100]","[3,10]",int64,ND,"[3,8]","[3,8]",0, | ||
| @@ -22,3 +22,5 @@ ScatterNonInplace_test_19,"[128, 512],[128, 512]","uint8,int64","ND,ND","[0,10], | |||
| 22 | ScatterNonInplace_test_20,"[128, 512],[128, 512]","int16,int64","ND,ND","[-100,100],[0,128]","[128, 512]",int16,ND,"[128, 128]","[128, 64]",0,1.0,,-1 | 22 | ScatterNonInplace_test_20,"[128, 512],[128, 512]","int16,int64","ND,ND","[-100,100],[0,128]","[128, 512]",int16,ND,"[128, 128]","[128, 64]",0,1.0,,-1 |
| 23 | ScatterNonInplace_test_21,"[128, 512],[128, 512]","int32,int64","ND,ND","[-100,100],[0,128]","[128, 512]",int32,ND,"[128, 128]","[128, 64]",0,1.0,,-1 | 23 | ScatterNonInplace_test_21,"[128, 512],[128, 512]","int32,int64","ND,ND","[-100,100],[0,128]","[128, 512]",int32,ND,"[128, 128]","[128, 64]",0,1.0,,-1 |
| 24 | ScatterNonInplace_test_22,"[128, 512],[128, 512]","bf16,int64","ND,ND","[-1,1],[0,128]","[128, 512]",bf16,ND,"[128, 128]","[128, 64]",0,1.0,,-1 | 24 | ScatterNonInplace_test_22,"[128, 512],[128, 512]","bf16,int64","ND,ND","[-1,1],[0,128]","[128, 512]",bf16,ND,"[128, 128]","[128, 64]",0,1.0,,-1 |
| 25 | +Scatter_int64,"[128, 512],[128, 512]","int64,int64","ND,ND","[-100,100],[0,128]","[128, 512]",int64,ND,"[128, 128]","[128, 64]",0,1.0,,-1 | ||
| 26 | +Scatter_3d_int64,"[8, 32, 64],[8, 32, 64]","int64,int64","ND,ND","[-100,100],[0,8]","[8, 32, 64]",int64,ND,"[8, 32, 64]","[8, 16, 64]",0,1.0,,-1 | ||
| @@ -18,4 +18,6 @@ Sign_test_15,"[8, 8, 8]",fp16,ND,"[-10.0, 10.0]","[8, 8, 8]",fp16,ND,"[8, 8, 8]" | |||
| 18 | Sign_test_16,"[32, 32, 32]",int16,ND,"[-32, 32]","[32, 32, 32]",int16,ND,"[32, 32, 32]","[16, 16, 16]" | 18 | Sign_test_16,"[32, 32, 32]",int16,ND,"[-32, 32]","[32, 32, 32]",int16,ND,"[32, 32, 32]","[16, 16, 16]" |
| 19 | Sign_test_17,"[64, 64]",int8,ND,"[-64, 63]","[64, 64]",int8,ND,"[64, 64]","[16, 16]" | 19 | Sign_test_17,"[64, 64]",int8,ND,"[-64, 63]","[64, 64]",int8,ND,"[64, 64]","[16, 16]" |
| 20 | Sign_test_18,"[64, 16]",fp32,ND,"[-100.0, 100.0]","[64, 16]",fp32,ND,"[64, 16]","[32, 16]" | 20 | Sign_test_18,"[64, 16]",fp32,ND,"[-100.0, 100.0]","[64, 16]",fp32,ND,"[64, 16]","[32, 16]" |
| 21 | -Sign_test_19,"[4096, 2]",bf16,ND,"[-1.0, 1.0]","[4096, 2]",bf16,ND,"[128, 64]","[64, 16]" | 21 | +Sign_test_19,"[4096, 2]",bf16,ND,"[-1.0, 1.0]","[4096, 2]",bf16,ND,"[128, 64]","[64, 16]" |
| 22 | +Sign_test_20,"[64, 64]",int64,ND,"[-100, 100]","[64, 64]",int64,ND,"[64, 64]","[16, 16]" | ||
| 23 | +Sign_test_21,"[107, 145]",int64,ND,"[-100, 100]","[107, 145]",int64,ND,"[32, 32]","[16, 16]" | ||
| @@ -9,3 +9,11 @@ Sub_test_7,"[32, 32], [32, 32]","int8, int8","ND, ND","[-10, 10], [-10, 10]","[3 | |||
| 9 | Sub_test_8,"[32, 32], [32, 32]","uint8, uint8","ND, ND","[-10, 10], [-10, 10]","[32, 32]",uint8,ND,"[16, 16]","[16, 16]" | 9 | Sub_test_8,"[32, 32], [32, 32]","uint8, uint8","ND, ND","[-10, 10], [-10, 10]","[32, 32]",uint8,ND,"[16, 16]","[16, 16]" |
| 10 | Sub_test_9,"[32, 32], [32, 32]","uint16, uint16","ND, ND","[-100, 100], [-100, 100]","[32, 32]",uint16,ND,"[16, 16]","[16, 16]" | 10 | Sub_test_9,"[32, 32], [32, 32]","uint16, uint16","ND, ND","[-100, 100], [-100, 100]","[32, 32]",uint16,ND,"[16, 16]","[16, 16]" |
| 11 | Sub_test_10,"[32, 32], [32, 32]","uint32, uint32","ND, ND","[-1000, 1000], [-1000, 1000]","[32, 32]",uint32,ND,"[16, 16]","[16, 16]" | 11 | Sub_test_10,"[32, 32], [32, 32]","uint32, uint32","ND, ND","[-1000, 1000], [-1000, 1000]","[32, 32]",uint32,ND,"[16, 16]","[16, 16]" |
| 12 | +Sub_int64,"[32, 32], [32, 32]","int64, int64","ND, ND","[-100, 100], [-100, 100]","[32, 32]",int64,ND,"[16, 16]","[16, 16]" | ||
| 13 | +Sub_uint64,"[32, 32], [32, 32]","uint64, uint64","ND, ND","[1, 100], [1, 100]","[32, 32]",uint64,ND,"[16, 16]","[16, 16]" | ||
| 14 | +Sub_tail_int64,"[107, 145], [107, 145]","int64, int64","ND, ND","[-100, 100], [-100, 100]","[107, 145]",int64,ND,"[32, 32]","[16, 16]" | ||
| 15 | +Sub_tail_uint64,"[107, 145], [107, 145]","uint64, uint64","ND, ND","[1, 100], [1, 100]","[107, 145]",uint64,ND,"[32, 32]","[16, 16]" | ||
| 16 | +Sub_3d_int64,"[2, 32, 32], [2, 32, 32]","int64, int64","ND, ND","[-100, 100], [-100, 100]","[2, 32, 32]",int64,ND,"[2, 16, 16]","[2, 8, 8]" | ||
| 17 | +Sub_3d_uint64,"[2, 32, 32], [2, 32, 32]","uint64, uint64","ND, ND","[1, 100], [1, 100]","[2, 32, 32]",uint64,ND,"[2, 16, 16]","[2, 8, 8]" | ||
| 18 | +Sub_bc_int64,"[4, 1], [1, 8]","int64, int64","ND, ND","[-100, 100], [-100, 100]","[4, 8]",int64,ND,"[4, 8]","[4, 8]" | ||
| 19 | +Sub_bc_uint64,"[4, 1], [1, 8]","uint64, uint64","ND, ND","[1, 100], [1, 100]","[4, 8]",uint64,ND,"[4, 8]","[4, 8]" | ||
| @@ -19,3 +19,5 @@ Subs_test_17,"[2048, 28672]",fp32,ND,"[-1, 1]","[2048, 28672]",fp32,ND,"[1024, 1 | |||
| 19 | Subs_test_18,"[96, 36864]",fp32,ND,"[-1, 1]","[96, 36864]",fp32,ND,"[32, 1024]","[32, 128]",1,fp32 | 19 | Subs_test_18,"[96, 36864]",fp32,ND,"[-1, 1]","[96, 36864]",fp32,ND,"[32, 1024]","[32, 128]",1,fp32 |
| 20 | Subs_test_19,"[96, 32768]",fp32,ND,"[-1, 1]","[96, 32768]",fp32,ND,"[32, 1024]","[32, 128]",1,fp32 | 20 | Subs_test_19,"[96, 32768]",fp32,ND,"[-1, 1]","[96, 32768]",fp32,ND,"[32, 1024]","[32, 128]",1,fp32 |
| 21 | Subs_test_20,"[786432, 384]",fp32,ND,"[-1, 1]","[786432, 384]",fp32,ND,"[32768, 128]","[128, 32]",1,fp32 | 21 | Subs_test_20,"[786432, 384]",fp32,ND,"[-1, 1]","[786432, 384]",fp32,ND,"[32768, 128]","[128, 32]",1,fp32 |
| 22 | +Subs_int64,"[32, 32]",int64,ND,"[-100, 100]","[32, 32]",int64,ND,"[16, 16]","[16, 16]",5,int64 | ||
| 23 | +Subs_uint64,"[32, 32]",uint64,ND,"[1, 100]","[32, 32]",uint64,ND,"[16, 16]","[16, 16]",5,uint64 | ||
| @@ -95,3 +95,13 @@ RowSum_int16_48_300_safe_keepdim_True,"[48, 300]",int16,ND,"[50, 50]","[48, 1]", | |||
| 95 | RowSum_int16_48_300_safe_keepdim_False,"[48, 300]",int16,ND,"[50, 50]","[48]",int16,ND,"[48, 300]","[48, 320]",[-1],False | 95 | RowSum_int16_48_300_safe_keepdim_False,"[48, 300]",int16,ND,"[50, 50]","[48]",int16,ND,"[48, 300]","[48, 320]",[-1],False |
| 96 | RowSum_int32_12_1200_overflow_keepdim_True,"[12, 1200]",int32,ND,"[2000000, 2000000]","[12, 1]",int32,ND,"[12, 1200]","[12, 1280]",[-1],True | 96 | RowSum_int32_12_1200_overflow_keepdim_True,"[12, 1200]",int32,ND,"[2000000, 2000000]","[12, 1]",int32,ND,"[12, 1200]","[12, 1280]",[-1],True |
| 97 | RowSum_int32_12_1200_overflow_keepdim_False,"[12, 1200]",int32,ND,"[2000000, 2000000]","[12]",int32,ND,"[12, 1200]","[12, 1280]",[-1],False | 97 | RowSum_int32_12_1200_overflow_keepdim_False,"[12, 1200]",int32,ND,"[2000000, 2000000]","[12]",int32,ND,"[12, 1200]","[12, 1280]",[-1],False |
| 98 | +Sum_int64,"[32, 32]",int64,ND,"[-100, 100]","[32, 1]",int64,ND,"[16, 32]","[16, 32]",[-1],True | ||
| 99 | +Sum_uint64,"[32, 32]",uint64,ND,"[1, 100]","[32, 1]",uint64,ND,"[16, 32]","[16, 32]",[-1],True | ||
| 100 | +Sum_tail_int64,"[107, 145]",int64,ND,"[-100, 100]","[107, 1]",int64,ND,"[32, 145]","[32, 145]",[-1],True | ||
| 101 | +Sum_tail_uint64,"[107, 145]",uint64,ND,"[1, 100]","[107, 1]",uint64,ND,"[32, 145]","[32, 145]",[-1],True | ||
| 102 | +Sum_3d_dim0_nokeep_int64,"[31, 17, 63]",int64,ND,"[-128, 127]","[17, 63]",int64,ND,"[31, 17, 31]","[16, 17, 32]",[0],False | ||
| 103 | +Sum_3d_dim0_nokeep_uint64,"[31, 17, 63]",uint64,ND,"[1, 100]","[17, 63]",uint64,ND,"[31, 17, 31]","[16, 17, 32]",[0],False | ||
| 104 | +Sum_2d_last_nokeep_int64,"[32, 64]",int64,ND,"[-100, 100]","[32]",int64,ND,"[16, 64]","[16, 32]",[-1],False | ||
| 105 | +Sum_2d_last_nokeep_uint64,"[32, 64]",uint64,ND,"[1, 100]","[32]",uint64,ND,"[16, 64]","[16, 32]",[-1],False | ||
| 106 | +Sum_2d_dim0_keep_int64,"[16, 64]",int64,ND,"[-100, 100]","[1, 64]",int64,ND,"[16, 32]","[16, 32]",[0],True | ||
| 107 | +Sum_2d_dim0_keep_uint64,"[16, 64]",uint64,ND,"[1, 100]","[1, 64]",uint64,ND,"[16, 32]","[16, 32]",[0],True | ||
| @@ -21,3 +21,5 @@ TriL_test_18,"[8, 8, 32, 32, 8]","int32","ND","[-10, 10]","[8, 8, 32, 32, 8]",in | |||
| 21 | TriL_test_19,"[8, 8, 32, 32, 8]","int32","ND","[-10, 10]","[8, 8, 32, 32, 8]",int32,ND,"[2, 4, 16, 16, 4]","[3, 1, 9, 2, 8]",6 | 21 | TriL_test_19,"[8, 8, 32, 32, 8]","int32","ND","[-10, 10]","[8, 8, 32, 32, 8]",int32,ND,"[2, 4, 16, 16, 4]","[3, 1, 9, 2, 8]",6 |
| 22 | TriL_test_20,"[20, 32]","uint16","ND","[0, 100]","[20, 32]",uint16,ND,"[8, 20]","[3, 16]",0 | 22 | TriL_test_20,"[20, 32]","uint16","ND","[0, 100]","[20, 32]",uint16,ND,"[8, 20]","[3, 16]",0 |
| 23 | TriL_test_21,"[20, 32]","uint32","ND","[0, 100]","[20, 32]",uint32,ND,"[8, 20]","[3, 16]",0 | 23 | TriL_test_21,"[20, 32]","uint32","ND","[0, 100]","[20, 32]",uint32,ND,"[8, 20]","[3, 16]",0 |
| 24 | +TriL_test_22,"[20, 32]","int64","ND","[-100, 100]","[20, 32]",int64,ND,"[8, 20]","[3, 16]",0 | ||
| 25 | +TriL_test_23,"[20, 32]","uint64","ND","[0, 100]","[20, 32]",uint64,ND,"[8, 20]","[3, 16]",0 | ||
| @@ -21,3 +21,5 @@ TriU_test_18,"[8, 8, 32, 32, 8]","int32","ND","[-10, 10]","[8, 8, 32, 32, 8]",in | |||
| 21 | TriU_test_19,"[8, 8, 32, 32, 8]","int32","ND","[-10, 10]","[8, 8, 32, 32, 8]",int32,ND,"[2, 4, 16, 16, 4]","[3, 1, 9, 2, 8]",6 | 21 | TriU_test_19,"[8, 8, 32, 32, 8]","int32","ND","[-10, 10]","[8, 8, 32, 32, 8]",int32,ND,"[2, 4, 16, 16, 4]","[3, 1, 9, 2, 8]",6 |
| 22 | TriU_test_20,"[20, 32]","uint16","ND","[0, 100]","[20, 32]",uint16,ND,"[8, 20]","[3, 16]",0 | 22 | TriU_test_20,"[20, 32]","uint16","ND","[0, 100]","[20, 32]",uint16,ND,"[8, 20]","[3, 16]",0 |
| 23 | TriU_test_21,"[20, 32]","uint32","ND","[0, 100]","[20, 32]",uint32,ND,"[8, 20]","[3, 16]",0 | 23 | TriU_test_21,"[20, 32]","uint32","ND","[0, 100]","[20, 32]",uint32,ND,"[8, 20]","[3, 16]",0 |
| 24 | +TriU_test_22,"[20, 32]","int64","ND","[-100, 100]","[20, 32]",int64,ND,"[8, 20]","[3, 16]",0 | ||
| 25 | +TriU_test_23,"[20, 32]","uint64","ND","[0, 100]","[20, 32]",uint64,ND,"[8, 20]","[3, 16]",0 | ||
| @@ -36,3 +36,9 @@ Where_test_33,"[32,32],[32,32],[32,32]","bool,int16,int16","ND,ND,ND","[-100,100 | |||
| 36 | Where_test_34,"[32,32],[32,32],[32,32]","bool,bf16,bf16","ND,ND,ND","[-1,1],[-1,1],[-1,1]","[32,32]",bf16,ND,1,bool,0.0,1.0,fp32,"[16,16]","[16,16]" | 36 | Where_test_34,"[32,32],[32,32],[32,32]","bool,bf16,bf16","ND,ND,ND","[-1,1],[-1,1],[-1,1]","[32,32]",bf16,ND,1,bool,0.0,1.0,fp32,"[16,16]","[16,16]" |
| 37 | Where_test_35,"[32,32],[32,32],[32,32]","bool,int8,int8","ND,ND,ND","[-10,10],[-10,10],[-10,10]","[32,32]",int8,ND,1,bool,0.0,1.0,fp32,"[16,16]","[16,16]" | 37 | Where_test_35,"[32,32],[32,32],[32,32]","bool,int8,int8","ND,ND,ND","[-10,10],[-10,10],[-10,10]","[32,32]",int8,ND,1,bool,0.0,1.0,fp32,"[16,16]","[16,16]" |
| 38 | Where_test_36,"[32,32],[32,32],[32,32]","bool,uint8,uint8","ND,ND,ND","[0,10],[0,10],[0,10]","[32,32]",uint8,ND,1,bool,0.0,1.0,fp32,"[16,16]","[16,16]" | 38 | Where_test_36,"[32,32],[32,32],[32,32]","bool,uint8,uint8","ND,ND,ND","[0,10],[0,10],[0,10]","[32,32]",uint8,ND,1,bool,0.0,1.0,fp32,"[16,16]","[16,16]" |
| 39 | +Where_int64,"[32, 32], [32, 32], [32, 32]","bool, int64, int64","ND, ND, ND","[0, 0], [-100, 100], [-100, 100]","[32, 32]",int64,ND,0,int32,64,32,int64,"[16, 16]","[16, 16]" | ||
| 40 | +Where_uint64,"[32, 32], [32, 32], [32, 32]","bool, uint64, uint64","ND, ND, ND","[0, 0], [1, 100], [1, 100]","[32, 32]",uint64,ND,0,int32,64,32,uint64,"[16, 16]","[16, 16]" | ||
| 41 | +Where_tail_int64,"[107, 145], [107, 145], [107, 145]","bool, int64, int64","ND, ND, ND","[0, 0], [-100, 100], [-100, 100]","[107, 145]",int64,ND,0,int32,64,32,int64,"[32, 32]","[16, 16]" | ||
| 42 | +Where_tail_uint64,"[107, 145], [107, 145], [107, 145]","bool, uint64, uint64","ND, ND, ND","[0, 0], [1, 100], [1, 100]","[107, 145]",uint64,ND,0,int32,64,32,uint64,"[32, 32]","[16, 16]" | ||
| 43 | +Where_flag1_int64,"[32, 32], [32, 32], [32, 32]","bool, int64, int64","ND, ND, ND","[0, 0], [-100, 100], [-100, 100]","[32, 32]",int64,ND,1,int32,64,32,int64,"[16, 16]","[16, 16]" | ||
| 44 | +Where_flag1_uint64,"[32, 32], [32, 32], [32, 32]","bool, uint64, uint64","ND, ND, ND","[0, 0], [1, 100], [1, 100]","[32, 32]",uint64,ND,1,int32,64,32,uint64,"[16, 16]","[16, 16]" | ||
Mframework/tests/ut/codegen/src/test_dynamic/test_codegen_dyn_vector/test_codegen_dyn_scalar.cpp+46-0
| @@ -21,6 +21,7 @@ | |||
| 21 | #include "interface/configs/config_manager.h" | 21 | #include "interface/configs/config_manager.h" |
| 22 | #include "interface/operation/operation.h" | 22 | #include "interface/operation/operation.h" |
| 23 | #include "tilefwk/data_type.h" | 23 | #include "tilefwk/data_type.h" |
| 24 | +#include "tilefwk/platform.h" | ||
| 24 | #include "codegen/codegen.h" | 25 | #include "codegen/codegen.h" |
| 25 | #include "codegen/symbol_mgr/codegen_symbol.h" | 26 | #include "codegen/symbol_mgr/codegen_symbol.h" |
| 26 | #include "codegen/npu/cloudnpu/codegen_cloudnpu.h" | 27 | #include "codegen/npu/cloudnpu/codegen_cloudnpu.h" |
| @@ -127,4 +128,49 @@ TEST_F(TestCodegenDynScalar, TestAddsTileTensor) | |||
| 127 | )!!!"; | 128 | )!!!"; |
| 128 | CheckStringExist(expect, res); | 129 | CheckStringExist(expect, res); |
| 129 | } | 130 | } |
| 131 | + | ||
| 132 | +TEST_F(TestCodegenDynScalar, TestDivsTileTensor) | ||
| 133 | +{ | ||
| 134 | + const bool isA5 = Platform::Instance().GetSoc().GetNPUArch() == NPUArch::DAV_3510; | ||
| 135 | + int s = 32; | ||
| 136 | + if (isA5) { | ||
| 137 | + Tensor t0(DT_INT64, {-1, s}, "t0"); // [32*8, 32] | ||
| 138 | + Tensor out(DT_INT64, {-1, s}, "out"); | ||
| 139 | + TileShape::Current().SetVecTile({128, 64}); | ||
| 140 | + | ||
| 141 | + auto funcName = "DIVS_TILETENSOR"; | ||
| 142 | + FUNCTION(funcName, {t0}, {out}) | ||
| 143 | + { | ||
| 144 | + auto shape0 = GetInputShape(t0, 0); | ||
| 145 | + auto loop1 = (shape0 + s - 1) / s; | ||
| 146 | + LOOP(funcName, FunctionType::DYNAMIC_LOOP, idx, LoopRange(loop1)) | ||
| 147 | + { | ||
| 148 | + Tensor t0s = View(t0, {s, s}, {idx * s, 0}); | ||
| 149 | + auto t = Div(t0s, Element(DT_INT64, 3.0)); | ||
| 150 | + Assemble(t, {idx * s, 0}, out); | ||
| 151 | + } | ||
| 152 | + } | ||
| 153 | + | ||
| 154 | +#if ENABLE_HIDDENLOOP | ||
| 155 | + auto function = Program::GetInstance().GetFunctionByRawName(FUNCTION_PREFIX + funcName + SUB_FUNC_SUFFIX + | ||
| 156 | + HIDDEN_FUNC_SUFFIX); | ||
| 157 | +#else | ||
| 158 | + auto function = Program::GetInstance().GetFunctionByRawName(FUNCTION_PREFIX + funcName + SUB_FUNC_SUFFIX); | ||
| 159 | +#endif | ||
| 160 | + std::string res = GenCodeByFunction(*function); | ||
| 161 | + std::string | ||
| 162 | + expect = R"!!!(TDivS<pto::DivAlgorithm::DEFAULT, LastUse2Dim<0, 1>, int64_t>(ubTensor_2, ubTensor_0, 3); | ||
| 163 | +)!!!"; | ||
| 164 | + CheckStringExist(expect, res); | ||
| 165 | + } else { | ||
| 166 | + Tensor t1(DT_INT64, {-1, s}, "t1"); | ||
| 167 | + Tensor out1(DT_INT64, {-1, s}, "out1"); | ||
| 168 | + EXPECT_THROW( | ||
| 169 | + FUNCTION("DIVS_TILETENSOR_A3", {t1}, {out1}) { | ||
| 170 | + auto t = Div(t1, Element(DT_INT64, 3.0)); | ||
| 171 | + (void)t; | ||
| 172 | + }, | ||
| 173 | + npu::tile_fwk::Error); | ||
| 174 | + } | ||
| 175 | +} | ||
| 130 | } // namespace npu::tile_fwk | 176 | } // namespace npu::tile_fwk |
| @@ -2417,7 +2417,7 @@ TEST_F(DynamicOpsTest, BitwiseRightShifts) | |||
| 2417 | int64_t b = 8; | 2417 | int64_t b = 8; |
| 2418 | int64_t s = 8; | 2418 | int64_t s = 8; |
| 2419 | Tensor self(DT_INT16, {b, s}, "self"); | 2419 | Tensor self(DT_INT16, {b, s}, "self"); |
| 2420 | - Element other(DT_INT16, 1); | 2420 | + Element other(DT_INT32, 1); |
| 2421 | Tensor out(DT_INT16, {b, s}, "out"); | 2421 | Tensor out(DT_INT16, {b, s}, "out"); |
| 2422 | 2422 | ||
| 2423 | ProgramData::GetInstance().AppendInputs({ | 2423 | ProgramData::GetInstance().AppendInputs({ |
| @@ -2451,7 +2451,7 @@ TEST_F(DynamicOpsTest, BitwiseLeftShifts) | |||
| 2451 | int64_t b = 8; | 2451 | int64_t b = 8; |
| 2452 | int64_t s = 8; | 2452 | int64_t s = 8; |
| 2453 | Tensor self(DT_INT16, {b, s}, "self"); | 2453 | Tensor self(DT_INT16, {b, s}, "self"); |
| 2454 | - Element other(DT_INT16, 1); | 2454 | + Element other(DT_INT32, 1); |
| 2455 | Tensor out(DT_INT16, {b, s}, "out"); | 2455 | Tensor out(DT_INT16, {b, s}, "out"); |
| 2456 | 2456 | ||
| 2457 | ProgramData::GetInstance().AppendInputs({ | 2457 | ProgramData::GetInstance().AppendInputs({ |
| @@ -2484,7 +2484,7 @@ TEST_F(DynamicOpsTest, SBitwiseRightShift) | |||
| 2484 | config::SetVerifyOption(KEY_PASS_VERIFY_SAVE_TENSOR, true); | 2484 | config::SetVerifyOption(KEY_PASS_VERIFY_SAVE_TENSOR, true); |
| 2485 | int64_t b = 8; | 2485 | int64_t b = 8; |
| 2486 | int64_t s = 8; | 2486 | int64_t s = 8; |
| 2487 | - Element self(DT_INT16, 4); | 2487 | + Element self(DT_INT32, 4); |
| 2488 | Tensor other(DT_INT16, {b, s}, "self"); | 2488 | Tensor other(DT_INT16, {b, s}, "self"); |
| 2489 | Tensor out(DT_INT16, {b, s}, "out"); | 2489 | Tensor out(DT_INT16, {b, s}, "out"); |
| 2490 | 2490 | ||
| @@ -2518,7 +2518,7 @@ TEST_F(DynamicOpsTest, SBitwiseLeftShift) | |||
| 2518 | config::SetVerifyOption(KEY_PASS_VERIFY_SAVE_TENSOR, true); | 2518 | config::SetVerifyOption(KEY_PASS_VERIFY_SAVE_TENSOR, true); |
| 2519 | int64_t b = 8; | 2519 | int64_t b = 8; |
| 2520 | int64_t s = 8; | 2520 | int64_t s = 8; |
| 2521 | - Element self(DT_INT16, 4); | 2521 | + Element self(DT_INT32, 4); |
| 2522 | Tensor other(DT_INT16, {b, s}, "self"); | 2522 | Tensor other(DT_INT16, {b, s}, "self"); |
| 2523 | Tensor out(DT_INT16, {b, s}, "out"); | 2523 | Tensor out(DT_INT16, {b, s}, "out"); |
| 2524 | 2524 | ||
| @@ -3357,19 +3357,19 @@ TEST_F(DynamicOpsTest, RangeFp32AndInt64) | |||
| 3357 | config::SetVerifyOption(KEY_PASS_VERIFY_SAVE_TENSOR, true); | 3357 | config::SetVerifyOption(KEY_PASS_VERIFY_SAVE_TENSOR, true); |
| 3358 | int64_t size = 5; | 3358 | int64_t size = 5; |
| 3359 | Tensor outFp32(DT_FP32, {size}, "outFp32"); | 3359 | Tensor outFp32(DT_FP32, {size}, "outFp32"); |
| 3360 | - Tensor outInt64(DT_INT32, {size}, "outInt64"); | 3360 | + Tensor outInt32(DT_INT32, {size}, "outInt32"); |
| 3361 | std::vector<float> goldenFp32 = {1.0f, 3.0f, 5.0f, 7.0f, 9.0f}; | 3361 | std::vector<float> goldenFp32 = {1.0f, 3.0f, 5.0f, 7.0f, 9.0f}; |
| 3362 | std::vector<int32_t> goldenInt64 = {1, 3, 5, 7, 9}; | 3362 | std::vector<int32_t> goldenInt64 = {1, 3, 5, 7, 9}; |
| 3363 | ProgramData::GetInstance().AppendInputs({}); | 3363 | ProgramData::GetInstance().AppendInputs({}); |
| 3364 | ProgramData::GetInstance().AppendOutputs({ | 3364 | ProgramData::GetInstance().AppendOutputs({ |
| 3365 | RawTensorData::CreateConstantTensor<float>(outFp32, 0.0f), | 3365 | RawTensorData::CreateConstantTensor<float>(outFp32, 0.0f), |
| 3366 | - RawTensorData::CreateConstantTensor<int32_t>(outInt64, 0), | 3366 | + RawTensorData::CreateConstantTensor<int32_t>(outInt32, 0), |
| 3367 | }); | 3367 | }); |
| 3368 | ProgramData::GetInstance().AppendGoldens({ | 3368 | ProgramData::GetInstance().AppendGoldens({ |
| 3369 | RawTensorData::CreateTensor<float>(outFp32, goldenFp32), | 3369 | RawTensorData::CreateTensor<float>(outFp32, goldenFp32), |
| 3370 | - RawTensorData::CreateTensor<int32_t>(outInt64, goldenInt64), | 3370 | + RawTensorData::CreateTensor<int32_t>(outInt32, goldenInt64), |
| 3371 | }); | 3371 | }); |
| 3372 | - FUNCTION("main", {}, {outFp32, outInt64}) | 3372 | + FUNCTION("main", {}, {outFp32, outInt32}) |
| 3373 | { | 3373 | { |
| 3374 | LOOP("L0", FunctionType::DYNAMIC_LOOP, i, LoopRange(1)) | 3374 | LOOP("L0", FunctionType::DYNAMIC_LOOP, i, LoopRange(1)) |
| 3375 | { | 3375 | { |
| @@ -3378,10 +3378,10 @@ TEST_F(DynamicOpsTest, RangeFp32AndInt64) | |||
| 3378 | Element endF(DT_FP32, 10.0f); | 3378 | Element endF(DT_FP32, 10.0f); |
| 3379 | Element stepF(DT_FP32, 2.0f); | 3379 | Element stepF(DT_FP32, 2.0f); |
| 3380 | outFp32 = Range(startF, endF, stepF); | 3380 | outFp32 = Range(startF, endF, stepF); |
| 3381 | - Element startI(DT_INT64, static_cast<int64_t>(1)); | 3381 | + Element startI(DT_INT32, static_cast<int64_t>(1)); |
| 3382 | - Element endI(DT_INT64, static_cast<int64_t>(10)); | 3382 | + Element endI(DT_INT32, static_cast<int64_t>(10)); |
| 3383 | - Element stepI(DT_INT64, static_cast<int64_t>(2)); | 3383 | + Element stepI(DT_INT32, static_cast<int64_t>(2)); |
| 3384 | - outInt64 = Range(startI, endI, stepI); | 3384 | + outInt32 = Range(startI, endI, stepI); |
| 3385 | } | 3385 | } |
| 3386 | } | 3386 | } |
| 3387 | }); | 3387 | }); |
| @@ -176,6 +176,21 @@ TEST_F(OperationOpsTest, Axpy_UnsupportedSelfDim) | |||
| 176 | FUNCTION("AxpyUnsupportedSelfDim", {self, other}) { EXPECT_THROW(Axpy(self, other, 1.0f), std::exception); } | 176 | FUNCTION("AxpyUnsupportedSelfDim", {self, other}) { EXPECT_THROW(Axpy(self, other, 1.0f), std::exception); } |
| 177 | } | 177 | } |
| 178 | 178 | ||
| 179 | +TEST_F(OperationOpsTest, Add_Int64BroadcastRejected) | ||
| 180 | +{ | ||
| 181 | + Tensor self(DT_INT64, {4, 8}); | ||
| 182 | + Tensor other(DT_INT64, {1, 8}); // broadcast on axis 0 | ||
| 183 | + FUNCTION("AddInt64Broadcast", {self, other}) { EXPECT_THROW(Add(self, other), std::exception); } | ||
| 184 | +} | ||
| 185 | + | ||
| 186 | +TEST_F(OperationOpsTest, Clip_Int64BroadcastRejected) | ||
| 187 | +{ | ||
| 188 | + Tensor input(DT_INT64, {4, 8}); | ||
| 189 | + Tensor minT(DT_INT64, {4, 1}); // broadcast on axis 0 | ||
| 190 | + Tensor maxT(DT_INT64, {1, 8}); // broadcast on axis 1 | ||
| 191 | + FUNCTION("ClipInt64Broadcast", {input, minT, maxT}) { EXPECT_THROW(Clip(input, minT, maxT), std::exception); } | ||
| 192 | +} | ||
| 193 | + | ||
| 179 | TEST_F(OperationOpsTest, Axpy_UnsupportedOtherDim) | 194 | TEST_F(OperationOpsTest, Axpy_UnsupportedOtherDim) |
| 180 | { | 195 | { |
| 181 | std::vector<int64_t> shape4d = {4, 8, 16, 32}; | 196 | std::vector<int64_t> shape4d = {4, 8, 16, 32}; |
| @@ -487,8 +487,7 @@ def scatter_( | |||
| 487 | raise PyptoError(0xF00001, TypeError(f"index tensor must be of int32 or int64, but got {index.dtype}")) | 487 | raise PyptoError(0xF00001, TypeError(f"index tensor must be of int32 or int64, but got {index.dtype}")) |
| 488 | scatter_mode = get_scatter_mode(reduce) | 488 | scatter_mode = get_scatter_mode(reduce) |
| 489 | if isinstance(src, (int, float)): | 489 | if isinstance(src, (int, float)): |
| 490 | - src_float = float(src) | 490 | + input.Move(pypto_impl.Scatter(input, index, pypto_impl.Element(input.dtype, src), dim, scatter_mode)) |
| 491 | - input.Move(pypto_impl.Scatter(input, index, pypto_impl.Element(input.dtype, src_float), dim, scatter_mode)) | ||
| 492 | return input | 491 | return input |
| 493 | elif isinstance(src, pypto_impl.Element): | 492 | elif isinstance(src, pypto_impl.Element): |
| 494 | input.Move(pypto_impl.Scatter(input, index, src, dim, scatter_mode)) | 493 | input.Move(pypto_impl.Scatter(input, index, src, dim, scatter_mode)) |
| @@ -511,8 +510,7 @@ def scatter( | |||
| 511 | raise PyptoError(0xF00001, TypeError(f"index tensor must be of int32 or int64, but got {index.dtype}")) | 510 | raise PyptoError(0xF00001, TypeError(f"index tensor must be of int32 or int64, but got {index.dtype}")) |
| 512 | scatter_mode = get_scatter_mode(reduce) | 511 | scatter_mode = get_scatter_mode(reduce) |
| 513 | if isinstance(src, (int, float)): | 512 | if isinstance(src, (int, float)): |
| 514 | - src_float = float(src) | 513 | + return pypto_impl.Scatter(input, index, pypto_impl.Element(input.dtype, src), dim, scatter_mode) |
| 515 | - return pypto_impl.Scatter(input, index, pypto_impl.Element(input.dtype, src_float), dim, scatter_mode) | ||
| 516 | elif isinstance(src, pypto_impl.Element): | 514 | elif isinstance(src, pypto_impl.Element): |
| 517 | return pypto_impl.Scatter(input, index, src, dim, scatter_mode) | 515 | return pypto_impl.Scatter(input, index, src, dim, scatter_mode) |
| 518 | elif isinstance(src, pypto_impl.Tensor): | 516 | elif isinstance(src, pypto_impl.Tensor): |
| @@ -30,8 +30,11 @@ _INT_DTYPE_MAP = { | |||
| 30 | DataType.DT_INT8: np.int8, | 30 | DataType.DT_INT8: np.int8, |
| 31 | DataType.DT_INT16: np.int16, | 31 | DataType.DT_INT16: np.int16, |
| 32 | DataType.DT_INT32: np.int32, | 32 | DataType.DT_INT32: np.int32, |
| 33 | + DataType.DT_INT64: np.int64, | ||
| 33 | DataType.DT_UINT8: np.uint8, | 34 | DataType.DT_UINT8: np.uint8, |
| 34 | DataType.DT_UINT16: np.uint16, | 35 | DataType.DT_UINT16: np.uint16, |
| 36 | + DataType.DT_UINT32: np.uint32, | ||
| 37 | + DataType.DT_UINT64: np.uint64, | ||
| 35 | } | 38 | } |
| 36 | 39 | ||
| 37 | 40 | ||
| @@ -0,0 +1,63 @@ | |||
| 1 | +#!/usr/bin/env python3 | ||
| 2 | +# coding: utf-8 | ||
| 3 | +# Copyright (c) 2026 Huawei Technologies Co., Ltd. | ||
| 4 | +# This program is free software, you can redistribute it and/or modify it under the terms and conditions of | ||
| 5 | +# CANN Open Software License Agreement Version 2.0 (the "License"). | ||
| 6 | +# Please refer to the License for details. You may not use this file except in compliance with the License. | ||
| 7 | +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
| 8 | +# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| 9 | +# See LICENSE in the root of the software repository for the full text of the License. | ||
| 10 | +# ----------------------------------------------------------------------------------------------------------- | ||
| 11 | +import pypto | ||
| 12 | + | ||
| 13 | +B, S = 4, 5 | ||
| 14 | +IDX0, IDX1 = 2, 5 | ||
| 15 | + | ||
| 16 | + | ||
| 17 | +def make_case(input_dtype=pypto.DT_FP32, index_dtype=pypto.DT_INT64, dim=0, src_dtype=pypto.DT_FP32): | ||
| 18 | + """Build input/index/src tensors for a 2-dim scatter case on the given axis.""" | ||
| 19 | + index_shape = [IDX0, IDX1] if dim == 0 else [B, 2] | ||
| 20 | + src_shape = list(index_shape) | ||
| 21 | + x = pypto.tensor([B, S], input_dtype, "x") | ||
| 22 | + index = pypto.tensor(index_shape, index_dtype, "index") | ||
| 23 | + src = pypto.tensor(src_shape, src_dtype, "src") | ||
| 24 | + return x, index, src | ||
| 25 | + | ||
| 26 | + | ||
| 27 | +def test_scatter_inplace_scalar_src(): | ||
| 28 | + x, index, _ = make_case() | ||
| 29 | + with pypto.function("SCATTER_INPLACE_SCALAR", x, index): | ||
| 30 | + pypto.set_vec_tile_shapes(4, 16) | ||
| 31 | + res = pypto.scatter_(x, 0, index, 2.0) | ||
| 32 | + assert res.base() is x.base() | ||
| 33 | + assert x.shape == [B, S] | ||
| 34 | + assert x.dtype == pypto.DT_FP32 | ||
| 35 | + | ||
| 36 | + | ||
| 37 | +def test_scatter_inplace_int_scalar_src(): | ||
| 38 | + x, index, _ = make_case(input_dtype=pypto.DT_INT32) | ||
| 39 | + with pypto.function("SCATTER_INPLACE_INT_SCALAR", x, index): | ||
| 40 | + pypto.set_vec_tile_shapes(4, 16) | ||
| 41 | + res = pypto.scatter_(x, 0, index, 3) | ||
| 42 | + assert res.base() is x.base() | ||
| 43 | + assert x.dtype == pypto.DT_INT32 | ||
| 44 | + | ||
| 45 | + | ||
| 46 | +def test_scatter_inplace_tensor_src(): | ||
| 47 | + x, index, src = make_case() | ||
| 48 | + with pypto.function("SCATTER_INPLACE_TENSOR", x, index, src): | ||
| 49 | + pypto.set_vec_tile_shapes(4, 16) | ||
| 50 | + res = pypto.scatter_(x, 0, index, src) | ||
| 51 | + assert res.base() is x.base() | ||
| 52 | + assert x.shape == [B, S] | ||
| 53 | + | ||
| 54 | + | ||
| 55 | +def test_scatter_out_of_place_returns_new_base(): | ||
| 56 | + x, index, _ = make_case() | ||
| 57 | + with pypto.function("SCATTER_OUT_OF_PLACE", x, index): | ||
| 58 | + pypto.set_vec_tile_shapes(4, 16) | ||
| 59 | + res = pypto.scatter(x, 0, index, 2.0) | ||
| 60 | + assert isinstance(res, pypto.tensor) | ||
| 61 | + assert res.base() is not x.base() | ||
| 62 | + assert res.shape == [B, S] | ||
| 63 | + assert res.dtype == pypto.DT_FP32 | ||
🟡 Medium Priority
本 PR 在 Add_st_test_cases.csv 中新增了两条广播用例 Add_bc_int64 / Add_bc_uint64(shape "[4, 1], [1, 8]",输出 "[4, 8]"),但同一 PR 在 binary.cpp 的 Add 路径(第 407 行)新增了 CheckInt64Broadcast 校验:当 dtype 为 DT_INT64/DT_UINT64 且 GetBroadcastAxes 非空时直接抛出 ERR_PARAM_DTYPE_UNSUPPORTED("broadcast is not supported for int64/uint64 dtype on current device")。[4,1] 与 [1,8] 在第 0、1 两个轴维度都不同,broadcastAxes 非空,因此这两条用例会在参数校验阶段被拒绝,无法产出 golden 结果,ST 测试将失败(或在测试框架容忍异常的情况下成为无效用例)。这构成了同一 PR 内代码与测试的相互矛盾:要么 CheckInt64Broadcast 过度严格(若 A5 硬件实际支持 int64/uint64 广播,应放开该校验以匹配新增测试),要么这两条用例本身是错误添加(应删除,否则 CI 失败)。
建议:确认 A5 设备上 int64/uint64 广播的实际能力:若支持,需同步放宽 operation_common.cpp 中 CheckInt64Broadcast 的校验(例如仅在确实不支持的架构上禁止),使代码与这两条新增测试保持一致;若不支持,则删除 Add_bc_int64 / Add_bc_uint64 两条用例,避免 ST 用例必然失败。