PaddlePaddle / Paddle

PArallel Distributed Deep LEarning: Machine Learning Framework from Industrial Practice (『飞桨』核心框架,深度学习&机器学习高性能单机、分布式训练和跨平台部署)
http://www.paddlepaddle.org/
Apache License 2.0
22.14k stars 5.56k forks source link

单测系统test/legacy_test/eager_op_test.py似乎未对低精度算子执行有效测试 #56407

Open Difers opened 1 year ago

Difers commented 1 year ago

bug描述 Describe the Bug

问题复现:

  1. 准备一段本不能通过测试的示例 此处采用#53078/commits/modify the test_lerp_op.py,其本应在bf16单测中出错
  2. 替换当前的单测文件 此处替换的即test_lerp_op.py
  3. 执行测试,发现测试未出错

    问题探索:

    • check_grad_with_place函数下: if user_defined_grads is None and self.is_compared_with_fp32():分支逻辑处理似乎有误
    • 个人理解的测试逻辑: numeric_grads: 计算数值微分作为参考 analytic_grads: 得到paddle微分计算结果
    • 当前问题: 对于低精度算子(fp16,bf16)的测试,都会进入if user_defined_grads is None and self.is_compared_with_fp32()分支下,导致: numeric_grads与analytic_grads计算结果相同,因此未能进行有效测试 6_KAC(RZ}0AEV@`SD)M`G@E

其他补充信息 Additional Supplementary Information

No response

shiyutang commented 1 year ago

你好,这部分单测文件我已经在paddle develop找不到了 python/paddle/fluid/tests/unittests/test_lerp_op.py

Ligoml commented 1 year ago

你好,这个单测现在 release2.5 和 develop 分支中都没有了,请问是基于哪个分支测试的呢?

Difers commented 1 year ago

目前单测文件已被迁移到test/legacy_test/test_lerp_op.py