Code Monkey home page Code Monkey logo

Comments (6)

HydrogenSulfate avatar HydrogenSulfate commented on July 28, 2024

F.interpolate存在diff好像是符合预期的,可以试下在CPU上运行上述程序,印象里CPU的结果能跟torch的GPU对齐。

from paddlescience.

Yang-Changhui avatar Yang-Changhui commented on July 28, 2024

好的,谢谢。但是,这段测试代码,经过判断条件后,并没有进入generalize_padding函数,没有用到F.interpolate,这个能麻烦您再看一下吗

from paddlescience.

HydrogenSulfate avatar HydrogenSulfate commented on July 28, 2024

好的,谢谢。但是,这段测试代码,经过判断条件后,并没有进入generalize_padding函数,没有用到F.interpolate,这个能麻烦您再看一下吗

可以使用这个工具具体定位一下是具体哪一层导致的diff,https://github.com/PaddlePaddle/PaDiff

from paddlescience.

Yang-Changhui avatar Yang-Changhui commented on July 28, 2024

@HydrogenSulfate 你好,设置"rtol":1e-6,"atol":1e-6,显示linear层有误差,但是linear的权重是一样的;
设置"rtol":1e-4,"atol":1e-7,可以 通过;但是使用reprod_log误差在相同的机器上为0.001,之前torch使用3060,paddle使用A100,误差为0.0006
image

from paddlescience.

HydrogenSulfate avatar HydrogenSulfate commented on July 28, 2024

@HydrogenSulfate 你好,设置"rtol":1e-6,"atol":1e-6,显示linear层有误差,但是linear的权重是一样的; 设置"rtol":1e-4,"atol":1e-7,可以 通过;但是使用reprod_log误差在相同的机器上为0.001,之前torch使用3060,paddle使用A100,误差为0.0006 image

  1. 确认对于同样的输入,F.pad在上述代码中是否能产生完全一致的结果
  2. 含有XXXNorm层时,输出的diff达到1e-4是有可能的,可以尝试把双方的norm层全部注释掉再对齐

from paddlescience.

HydrogenSulfate avatar HydrogenSulfate commented on July 28, 2024

@HydrogenSulfate 你好,设置"rtol":1e-6,"atol":1e-6,显示linear层有误差,但是linear的权重是一样的; 设置"rtol":1e-4,"atol":1e-7,可以 通过;但是使用reprod_log误差在相同的机器上为0.001,之前torch使用3060,paddle使用A100,误差为0.0006 image

  1. 确认对于同样的输入,F.pad在上述代码中是否能产生完全一致的结果
  2. 含有XXXNorm层时,输出的diff达到1e-4是有可能的,可以尝试把双方的norm层全部注释掉再对齐

另外对齐的时候尽量使用同样的卡,避免GPU硬件不同带来的的影响

from paddlescience.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.