1. 18 9月, 2021 2 次提交
  2. 17 9月, 2021 2 次提交
    • Z
      change to PADDLE_DEFINE_EXPORTED (#35841) · d22914fd
      Zeng Jinle 提交于
      d22914fd
    • W
      GeneratePass for Python Pass (#35708) · f6db9806
      wuhuanzhou 提交于
      #### 背景
      
      #35602 提供Python侧开发子图替换类Pass的方式:
      
      - 利用Paddle Python API或者辅助类型定义子图program用来匹配/替换图;
      - Python侧注册Pass时,将注册函数最终转换为protobuf定义的PassDesc数据形式,供C++侧进行解析完成Pass实例注册。
      
      本PR即为根据PassDesc规则描述解析生成Pass实例。
      
      #### 方案设计
      
      ##### Pass规则验证
      
      在以往的Pass开发中,会存在随着算子迭代引发的匹配失效或者错误匹配的问题,该问题可以通过扫描算子支持的参数设置及参数类型等来判断是否应该使用该Pass或者给出提示需要修改Pass代码。
      
      当前Pass开发中提供了算子兼容性OpCompatSensiblePass用于解决上述问题。但同时还存在不足:由于以往Pass开发在运行时才能获取到pattern信息,所以需要在执行Pass时才可以判断。
      
      使用PassDesc表示的Pass可以在执行Pass前验证上述问题,这个过程在VerifyDesc中完成。
      
      ##### 根据匹配子图构造pattern
      
      GeneratePass对于图匹配和替换使用GraphPatternDecetor完成,构造匹配pattern实际上就是将对应对象成员PDPattern中添加PDNode和边关系。该过程在函数`InitGeneratePattern`中完成,该函数没有作为GeneratePass的成员方法,主要出于后续可能开发新的Decetor考虑,GeneratePass与Decetor的操作是没有关联的。
      
      初始化pattern主要通过遍历匹配子图program的全部算子实现:
      
      1. 添加当前算子对应PDNode及限制条件(算子类型、属性限制等);
      2. 遍历当前算子对应输入并从pattern中尝试获取PDNode:
         - 在pattern中获取到PDNode且为输出节点:表示属于匹配子图的中间节点,将该PDNode设置为中间节点;
         - 在pattern中没有获取到PDNode:添加该输入PDNode并设置作为输入节点;
         - 设置输入到算子的边关系;
      3. 遍历当前算子对应输出:
         - 在pattern中获取到PDNode且为输入节点:表示属于匹配子图的中间节点,将该PDNode设置为中间节点;
         - 在pattern中没有获取到PDNode:添加该输入PDNode并设置作为输出节点;
         - 设置算子到输出的边关系;
      
      ##### 根据替换子图操作graph
      
      替换子图操作的过程在`GetGenerateRewrite`函数中完成,与`InitGeneratePattern`类似没有作为GeneratePass的成员方法。
      
      生成替换子图操作过程如下:
      
      1. 判断冗余替换子图;
      2. 遍历替换子图program的全部算子添加替换子图Node:
         1. 添加当前算子的Node及属性设置;
         2. 遍历当前算子对应输入,添加中间variable节点;
         3. 遍历当前算子对应输出,添加中间variable节点;
         4. 添加输入/输出节点与算子节点的边关系;
      3. 删除匹配图中属于中间节点的Node;
      
      ##### 优化子图验证
      
      对于替换子图或者替换后的计算图是否可以正确运行等,可以在执行Pass时验证,从而防止在后续执行计算图时出现异常。
      
      当前Pass执行直接修改计算图,验证失败时无法很好的完成还原操作,目前子图验证暂时默认成功,留到后续改进。
      f6db9806
  3. 14 9月, 2021 1 次提交
  4. 13 9月, 2021 1 次提交
  5. 11 9月, 2021 1 次提交
  6. 08 9月, 2021 1 次提交
    • Z
      Enable program passes on Fleet APIs (#34955) · 5f369881
      Zeng Jinle 提交于
      * add fleet api for program pass
      
      * turn on apply pass for CI test
      
      * fix disable fuse_all_optimizer bug
      
      * try to test ci
      
      * fix CI
      
      * fill unspecified op role
      
      * fix fuse_allreduce
      
      * add ut to improve coverage
      
      * remove useless change
      
      * improve c++ coverage
      
      * follow some comments
      
      * test ir pass pipeline
      
      * update doc
      
      * reduce ut time again
      5f369881
  7. 07 9月, 2021 1 次提交
  8. 06 9月, 2021 1 次提交
  9. 31 8月, 2021 1 次提交
  10. 30 8月, 2021 1 次提交
  11. 27 8月, 2021 1 次提交
  12. 26 8月, 2021 2 次提交
  13. 24 8月, 2021 1 次提交
  14. 23 8月, 2021 1 次提交
  15. 17 8月, 2021 2 次提交
    • C
      Copy boost optional to Paddle (#34780) · 9be41447
      chentianyu03 提交于
      * copy boost optional.hpp to paddle
      
      * copy boost optional.hpp to paddle
      
      * move directions
      
      * del fluid/utils
      
      * modify .hpp to .h
      
      * move directions
      
      * modify to paddle::optional
      
      * add modification description
      
      * format code stype for the files in paddle/utils
      
      * format code stype
      9be41447
    • Z
      Add some passes which can be applied to Program (#34730) · 8046e33d
      Zeng Jinle 提交于
      * add inplace passes and tests
      
      * update
      
      * fix use_cuda undefined
      fix compile error of op compat
      
      * add more ut
      
      * fix CPU CI error
      
      * check adam unique
      
      * fix mac/windows ci, improve coverage
      
      * fix ci error
      
      * follow weihang's comment
      
      * fix BlockDesc::MoveFrom
      
      * follow qiuliang's comment
      
      * update
      
      * follow huihuang's comments
      8046e33d
  16. 16 8月, 2021 1 次提交
  17. 11 8月, 2021 1 次提交
  18. 10 8月, 2021 1 次提交
    • C
      copy boost/any.hpp to utils and replace boost::any with self defined any (#34613) · 12892929
      chentianyu03 提交于
      * add any.hpp to utils and replace boost::any with self defined paddle::any
      
      * add copy any.hpp to custom op depends
      
      * modify any.hpp include path
      
      * remove boost from setup.py.in
      
      * add copy any.hpp to custom op depends
      
      * move any.hpp to paddle/utils/ dirs
      
      * move any.h to extension/include direction
      
      * copy utils to right directions
      12892929
  19. 06 8月, 2021 2 次提交
  20. 05 8月, 2021 2 次提交
  21. 02 8月, 2021 2 次提交
  22. 30 7月, 2021 2 次提交
    • H
      Revert of PR34452 (#34516) · 72a9c8ff
      Huihuang Zheng 提交于
      72a9c8ff
    • J
      Added reshape, reshape2, squeeze and squeeze2 BF16/FP32 FWD/BWD kernels (#34219) · 22c4c189
      jakpiase 提交于
      * test version of matmul_v2
      
      * added matmul_v2 grad kernel
      
      * minor changes
      
      * minor changes
      
      * minor change for CI approval
      
      * CI fix
      
      * CI fix
      
      * added squeeze and squeeze2 kernels
      
      * CI fix
      
      * CI fix
      
      * CI fix
      
      * disabled tests when compiled with cuda
      
      * added setting format_tag by strides
      
      * added sigmoid BF16 FWD/BWD and gelu BF16 BWD
      
      * changes after review
      
      * Revert "added sigmoid BF16 FWD/BWD and gelu BF16 BWD"
      
      This reverts commit 6e3f76720b545abfcff9f6052b46b73a1e745cae.
      
      * Revert "Merge branch 'matmul_v2_grad' into squeeze2_op"
      
      This reverts commit 06fcf67843a4a7884eccdf67a02a03575e1d4cb8, reversing
      changes made to 6e3f76720b545abfcff9f6052b46b73a1e745cae.
      
      * minor change
      
      * added reshape1/2 kernels
      
      * moved some functions into private block
      
      * CI fix
      
      * CI fix
      
      * CI fix
      22c4c189
  23. 29 7月, 2021 2 次提交
  24. 28 7月, 2021 2 次提交
  25. 22 7月, 2021 1 次提交
  26. 21 7月, 2021 1 次提交
  27. 20 7月, 2021 1 次提交
  28. 16 7月, 2021 1 次提交
  29. 15 7月, 2021 2 次提交