| Files | Last commit | Last update |
|---|---|---|
[CANNBot]add FresnelSin operator Co-authored-by: handsomeRobot_SK<suke13@huawei.com> Co-authored-by: handsomeRobot_SK<2034073486@qq.com> # message auto-generated for no-merge-commit merge: !3644 merge master into master [CANNBot]add FresnelSin operator Created-by: handsomeRobot_SK Commit-by: handsomeRobot_SK Merged-by: cann-robot Description: # feat: add FresnelSin operator ## 概述 新增 FresnelSin 算子,计算 **Fresnel 正弦积分** \[ S(x) = \int_0^x \sin\left(\frac{\pi t^2}{2}\right) dt \] 对标 TensorFlow 的 tf.math.special.fresnel_sin 实现。 --- ## 支持规格 | 项目 | 说明 | |------------|-------------------------------| | 数据类型 | float16, float32, bfloat16 | | 目标芯片 | Ascend 950 (arch35) | | 接口类型 | GE IR(无 ACLNN) | --- ## 算法实现 基于 Cephes 库 fresnl.c 的分段逼近策略: - **小值分支**(\(x^2 < 2.5625\)): 有理逼近 \[ S(|x|) = |x|^3 \cdot \frac{P_S(x^*)}{Q_S(x^*)} \] 其中 \(x^* = x^2\),\(P_S\)、\(Q_S\) 为特定多项式系数。 - **渐近分支**(\(x^2 \ge 2.5625\)): \[ S(|x|) = 0.5 - \frac{f \cdot \cos(z) + g \cdot \sin(z)}{\pi |x|} \] 其中 \(z = \frac{\pi x^2}{2}\),\(f\)、\(g\) 由辅助函数计算。 - **特殊值处理**: - NaN → NaN - ±Inf → ±0.5 - **符号恢复**:利用奇函数性质 \(S(-x) = -S(x)\) 保证数值正确。 --- ## 新增文件 | 文件路径 | 说明 | |----------|------| | math/fresnel_sin/CMakeLists.txt | 构建配置 | | math/fresnel_sin/op_graph/fresnel_sin_proto.h | GE IR 算子注册 | | math/fresnel_sin/op_host/fresnel_sin_def.cpp | 算子定义(dtype/format/config) | | math/fresnel_sin/op_host/fresnel_sin_infershape.cpp | 形状推导(输出 = 输入) | | math/fresnel_sin/op_host/arch35/fresnel_sin_tiling_arch35.cpp | Tiling 策略(多核分块 + UB 规划) | | math/fresnel_sin/op_kernel/arch35/fresnel_sin.h | Kernel 核心实现(Cephes 系数 + Horner 求值) | | math/fresnel_sin/op_kernel/arch35/fresnel_sin_tiling_data.h | Tiling 数据结构 | | math/fresnel_sin/op_kernel/arch35/fresnel_sin_tiling_key.h | 模板参数声明 | | math/fresnel_sin/op_kernel/fresnel_sin_apt.cpp | Kernel 入口 | | math/fresnel_sin/examples/test_geir_fresnel_sin.cpp | GE IR 精度验证(10 个 L1 用例) | | math/fresnel_sin/examples/arch35/test_geir_fresnel_sin.cpp | arch35 精度验证 | --- ## 精度标准 | dtype | rtol | |------------|--------| | float32 | 1e-4 | | float16 | 1e-3 | | bfloat16 | 4e-3 | --- ## UB Buffer 规划 - 输入队列 qIn :1 × sizeof(T) - 输出队列 qOut :1 × sizeof(T) - 计算队列 calcQ :8 × sizeof(float) - 掩码队列 maskQ :3 × sizeof(uint8_t) See merge request: cann/ops-math!3644 | 4 months ago | |
legacy下线:为AdaCast/SignBitsUnpack/Sinh/Spence/Tan新增tiling/infer调试日志+op_graph InferDataType迁移 Co-authored-by: zhouxuan78<zhouxuan78@huawei.com> # message auto-generated for no-merge-commit merge: !4498 merge master into master legacy下线:为AdaCast/SignBitsUnpack/Sinh/Spence/Tan新增tiling/infer调试日志+op_graph InferDataType迁移 Created-by: zhouxuan78 Commit-by: zhouxuan78 Merged-by: cann-robot Description: ## 描述 Legacy包下线整改:为AdaCast/SignBitsUnpack/Sinh/Spence/Tan 5个算子新增tiling/infer调试日志,补充spence op_graph InferDataType迁移。 ## 变更内容 - tiling入口新增OP_LOGD锚点日志,TilingData新增OP_LOGI日志 - InferShape新增OP_LOGI输出日志 - 补充spence_graph_infer.cpp(InferDataType迁移到op_graph,IMPL_OP注册) ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> ## 测试 <!-- 描述您如何测试这些更改。--> ## 文档更新 <!-- 如果有文档更新,请在这里描述。--> ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他:Legacy包下线整改 See merge request: cann/ops-math!4498 | 2 months ago | |
[CANNBot]add FresnelSin operator Co-authored-by: handsomeRobot_SK<suke13@huawei.com> Co-authored-by: handsomeRobot_SK<2034073486@qq.com> # message auto-generated for no-merge-commit merge: !3644 merge master into master [CANNBot]add FresnelSin operator Created-by: handsomeRobot_SK Commit-by: handsomeRobot_SK Merged-by: cann-robot Description: # feat: add FresnelSin operator ## 概述 新增 FresnelSin 算子,计算 **Fresnel 正弦积分** \[ S(x) = \int_0^x \sin\left(\frac{\pi t^2}{2}\right) dt \] 对标 TensorFlow 的 tf.math.special.fresnel_sin 实现。 --- ## 支持规格 | 项目 | 说明 | |------------|-------------------------------| | 数据类型 | float16, float32, bfloat16 | | 目标芯片 | Ascend 950 (arch35) | | 接口类型 | GE IR(无 ACLNN) | --- ## 算法实现 基于 Cephes 库 fresnl.c 的分段逼近策略: - **小值分支**(\(x^2 < 2.5625\)): 有理逼近 \[ S(|x|) = |x|^3 \cdot \frac{P_S(x^*)}{Q_S(x^*)} \] 其中 \(x^* = x^2\),\(P_S\)、\(Q_S\) 为特定多项式系数。 - **渐近分支**(\(x^2 \ge 2.5625\)): \[ S(|x|) = 0.5 - \frac{f \cdot \cos(z) + g \cdot \sin(z)}{\pi |x|} \] 其中 \(z = \frac{\pi x^2}{2}\),\(f\)、\(g\) 由辅助函数计算。 - **特殊值处理**: - NaN → NaN - ±Inf → ±0.5 - **符号恢复**:利用奇函数性质 \(S(-x) = -S(x)\) 保证数值正确。 --- ## 新增文件 | 文件路径 | 说明 | |----------|------| | math/fresnel_sin/CMakeLists.txt | 构建配置 | | math/fresnel_sin/op_graph/fresnel_sin_proto.h | GE IR 算子注册 | | math/fresnel_sin/op_host/fresnel_sin_def.cpp | 算子定义(dtype/format/config) | | math/fresnel_sin/op_host/fresnel_sin_infershape.cpp | 形状推导(输出 = 输入) | | math/fresnel_sin/op_host/arch35/fresnel_sin_tiling_arch35.cpp | Tiling 策略(多核分块 + UB 规划) | | math/fresnel_sin/op_kernel/arch35/fresnel_sin.h | Kernel 核心实现(Cephes 系数 + Horner 求值) | | math/fresnel_sin/op_kernel/arch35/fresnel_sin_tiling_data.h | Tiling 数据结构 | | math/fresnel_sin/op_kernel/arch35/fresnel_sin_tiling_key.h | 模板参数声明 | | math/fresnel_sin/op_kernel/fresnel_sin_apt.cpp | Kernel 入口 | | math/fresnel_sin/examples/test_geir_fresnel_sin.cpp | GE IR 精度验证(10 个 L1 用例) | | math/fresnel_sin/examples/arch35/test_geir_fresnel_sin.cpp | arch35 精度验证 | --- ## 精度标准 | dtype | rtol | |------------|--------| | float32 | 1e-4 | | float16 | 1e-3 | | bfloat16 | 4e-3 | --- ## UB Buffer 规划 - 输入队列 qIn :1 × sizeof(T) - 输出队列 qOut :1 × sizeof(T) - 计算队列 calcQ :8 × sizeof(float) - 掩码队列 maskQ :3 × sizeof(uint8_t) See merge request: cann/ops-math!3644 | 4 months ago |
| Files | Last commit | Last update |
|---|---|---|
| 4 months ago | ||
| 2 months ago | ||
| 4 months ago |