1. 01 11月, 2021 4 次提交
    • C
      Paddle Tensor Operation Library initial implementation (#34425) · b9fdd3bc
      Chen Weihang 提交于
      * initial tensor design & sign kernel demo
      
      * add move constructor for meta & add lodtensor
      
      * add dirs & sign xpu kernel
      
      * add mean cpu&cuda kernel impl
      
      * move sign & mean xpu & npu kernel
      
      * add selected_rows basic impl
      
      * refactor design, BaseTensor to DenseTensor, etc.
      
      * add scale mkldnn kernel
      
      * polish xpu & npu impl details
      
      * fix mkldnn reuse compile failed
      
      * change tensor operation lib name
      
      * rename util filename
      
      * add more comments
      
      * change TensorImplInterface to TensorInterface
      
      * add kernel key and factory
      
      * remove MKLDNNTensorMeta, add MKLDNNDenseTensor
      
      * change XXDeviceContext to XXContext
      
      * add base kernel registrar utils & test on sign
      
      * replace boost::any by paddle::any
      
      * fix several ci failed
      
      * fix npu compile error
      
      * add ordered map util
      
      * fix multiple ordered_map compile errors
      
      * move dev into include dir
      
      * support sign op in static op run
      
      * fix static op run error
      
      * fix new executor compile failed
      
      * add dygraph branch & remove sign_op.h
      
      * fix test_infer_no_need_buffer_slots
      
      * fix rocm compile link error
      
      * fix unitybuild error & clear glog
      
      * fix npu compile failed
      
      * skip quant trans test
      
      * fix part windows compile problem
      
      * fix xpu enforce error
      
      * fix inference test failed
      
      * remove ordered_map to solve quant failed
      
      * fix part of rcom compile faild
      
      * add more register kernels
      
      * revert scale kernel temporarily
      
      * fix code format error
      
      * add new kernel registrar marco
      
      * rename top to tcmpt
      
      * revert xpu, npu, mkldnn impl & remove op def
      
      * add kernel args parse functor to auto parse args
      
      * revert some change & add scale kernels
      
      * add op proto in dygraph kernelcontext building
      
      * polish kernel dispatch logic & nameing rule
      
      * fix scale kernel match error
      
      * fix scale test failed
      
      * add mean API and unittest
      
      * test mean api success
      
      * add branch to solve compiled error
      
      * skip clang format error
      
      * add mean skip rule in op_library
      
      * add dot kernel, api and unittest (#6)
      
      * remove old kernel and add symbol link
      
      * fix dot compiled failed
      
      * add merco for module declare
      
      * fix npu and xpu compile error
      
      * revert sign, mean, scale, dot kernel removing
      
      * add comment for keeping old kernel impl
      
      * fix mutable_data error
      
      * fix bfloat16 conflit
      
      * fix inference undef error
      
      * adapt to msvc compile rules
      
      * polish comment for template inst
      
      * add cmake template instantiation for win
      
      * fix backend to place device id bug
      
      * fix ifdef error
      
      * Op2functor (#7)
      
      * add kernel args maker class
      
      * make args maker non-const
      
      * remove debug log
      
      * modify codes by review options
      
      * split constructPrKernelContext function
      
      * fix output name bug
      
      * fix test_mean_op test_sign_op failed
      
      * fill_any_like kernel refactor (#10)
      
      * fill_any_like kernel refactor
      
      * remove useless code of full_like c++ api
      
      * skip dtype for fill_any_like
      
      * add attrs for kernel key constrcut
      
      * add use_pt_kernel Flags to control whether to use pt kernel (#13)
      
      * add use_pt_kernel Flags to control whether to use pt kernel
      
      * change the default value to true for cheking pt kernels
      
      * fix mutable_data cuda place error
      
      * move high level apis into hapi
      
      * remove selectedrows adapting temporarily
      
      * Support Scalar in Tensor Compute Library (#14)
      
      * fill_any_like kernel refactor
      
      * remove useless code of full_like c++ api
      
      * Support Scalar in Tensor Compute Library
      
      * add scalar in dygraph and static graph mode
      
      * keep the basic type for attr, instead of using scalar for all
      
      * merge the code
      
      * remove mkldnn tensor & polish details
      
      * use flat_hash_map and small_vector in kernel factory
      
      * Refactor flatten kernel (#12)
      
      * refactor flatten kernel
      
      * update infershape function
      
      * fix compile bugs
      
      * fix bugs when merge
      
      * fix compiler bugs
      
      * fix bugs when run test_flatten_api
      
      * fix bugs when run test
      
      * Revert "use flat_hash_map and small_vector in kernel factory"
      
      This reverts commit 23091495cfdd3df8cc1be592d30f09ea66a7c72b.
      
      * Move cpu, cuda and other device code into kernels (#15)
      
      * fill_any_like kernel refactor
      
      * remove useless code of full_like c++ api
      
      * Support Scalar in Tensor Compute Library
      
      * add scalar in dygraph and static graph mode
      
      * keep the basic type for attr, instead of using scalar for all
      
      * merge the code
      
      * start refactor matmul
      
      * move cpu, cuda and other device modules into kernels
      
      * merge code
      
      * polish code in operator.cc
      
      * Perfect unitests (#16)
      
      * perfect unittest
      
      * update license
      
      * replace with flat_hash_map, small_vector (#19)
      
      * fix small_vector build error on windows platform
      
      * replace with flat_hash_map, small_vector
      
      * remove todo
      
      * Perfect unitests (#20)
      
      * perfect unittest
      
      * update license
      
      * fix bug when run tcmpt_utils_test
      
      * refactor execution adapting impl
      
      * fix insert conflit
      
      * Fix CI bug of test_yolov3 (#21)
      
      * fill_any_like kernel refactor
      
      * remove useless code of full_like c++ api
      
      * Support Scalar in Tensor Compute Library
      
      * add scalar in dygraph and static graph mode
      
      * keep the basic type for attr, instead of using scalar for all
      
      * merge the code
      
      * start refactor matmul
      
      * move cpu, cuda and other device modules into kernels
      
      * merge code
      
      * polish code in operator.cc
      
      * Fix CI bug of test_yolov3
      
      * add the tensor base class, test=develop (#17)
      
      * update the tensor base class, test=develop
      
      * remove two funcs, test=develop
      
      * update the error msg, test=develop
      Co-authored-by: NChen Weihang <chenweihang@baidu.com>
      
      * [no-verify] commit backend and tensor signature changes
      
      * Rename tcmpt to pten (#23)
      
      * rename tcmpt to pten
      
      * update omitted files for rename to pten
      
      * update omitted file for rename to pten
      
      * remove k of all enum var
      
      * remove kernel_instantiate (#26)
      
      * remove symbols and spatial_tensor
      
      * change common to functions
      
      * readd share tensor impl methods
      
      * add a candidate dense tensor class, test=develop (#28)
      
      * change all Pt to Pten
      
      * resolve conflit with xiaowei
      
      * Op2functor opt1 (#27)
      
      * replace to small vector and change to const &
      
      * add std::move
      Co-authored-by: NChen Weihang <chenweihang@baidu.com>
      
      * polish kernel factory and kernel registry
      
      * fix operator test error msg mismatch
      
      * remove tensor signature and backend set member
      
      * move scalar and polish enforce
      
      * revert dtype layout change to fix error
      
      * fix enum operator override error
      
      * add several base unittests
      
      * add pten utils tests
      
      * polish some details
      
      * Dev/op2func refactor 3 (#30)
      
      * add a candidate dense tensor class, test=develop
      
      * remove TensorBase::backend(), test=develop
      
      * remove some ops, test=develop
      
      * cherry-pick the pr of tensor meta, test=develop
      
      * moves the dense tensor and some ops, test=develop
      
      * update the linalg operator, test=develop
      
      * update other operators, test=develop
      
      * fix errors, test=develop
      
      * fix bugs, test=develop
      
      * try to resolve the problem of windows ci, test=develop
      
      * updates codes, test=develop
      
      * fix the tensor_utils.cc, test=develop
      
      * modify the dense tensor, test=develop
      
      * fix the data type, test=develop
      Co-authored-by: Nshixiaowei02 <39303645+Shixiaowei02@users.noreply.github.com>
      
      * polish some details
      
      * polish kernel signature details
      
      * fix a bug about offsets of the tensor, test=develop (#31)
      Co-authored-by: Nshixiaowei02 <39303645+Shixiaowei02@users.noreply.github.com>
      
      * polish some details
      Co-authored-by: Nchentianyu03 <ctychentianyu@gmail.com>
      Co-authored-by: Nzyfncg <1370305206@qq.com>
      Co-authored-by: NYuanRisheng <yuanrisheng@baidu.com>
      Co-authored-by: N石晓伟 <39303645+Shixiaowei02@users.noreply.github.com>
      b9fdd3bc
    • J
    • Z
    • C
      add cinn_launch_op for using CINN to optimize graph (#36600) · 0a963ee9
      CtfGo 提交于
      增加CinnLaunchOp,负责执行Cinn子图编译的结果,要点如下:
      1. 在子图划分的BuildCinnPass中,每个子图在原图中会被替换为该CinnLaunchOp,由它来调用Cinn进行子图编译、执行的功能。
      2. CinnLaunchOp的输入/输出即为子图的输入和输出,另外增加`compilation_key`属性,它可由该属性key从全局Cache中获取子图对象、编译结果,该属性由BuildCinnPass在创建Op时进行设置
      3. CinnLaunchOp功能实现的流程为:
              - 从全局Cache中获取子图对象
              - 从全局Cache中获取子图编译结果,未命中cache时进行即时编译
              - 根据编译结果的变量信息(数据类型、shape)初始化运行时数据,分配内存/显存
              - 将运行时数据打包为参数,调用cinn的可执行对象runtime program进行计算
              - 子图运行结果通过参数指针同步到paddle侧的tensor
      0a963ee9
  2. 29 10月, 2021 2 次提交
  3. 28 10月, 2021 4 次提交
  4. 27 10月, 2021 3 次提交
  5. 26 10月, 2021 5 次提交
  6. 25 10月, 2021 2 次提交
    • Z
      Create CinnCompiler class for compiling subgraphs found by build_cinn_pass. (#36562) · 4c460378
      Zhen Wang 提交于
      * Init the functions of CinnCompiler.
      
      * Add the unit test for CinnCompiler.
      
      * Fix some compilation errors.
      
      * Update the UT of cinn_compiler.
      
      * Use Decomposer&OpFusion passes in CinnCompiler::CompileGraph.
      
      * Update some comments.
      
      * Uncomment some includes in build_cinn_pass.cc.
      
      * Use refs instead of ptrs as returned types of FindGraph & Compile in
      CinnCompiler.
      
      * Use the merged CinnGraphSymbolization functions in CinnCompiler.
      4c460378
    • L
      [new-exec] Add events waiter (#36480) · cdb9bfa3
      liutiexing 提交于
      * add align for WorkQueue
      
      * add spinlock
      
      * merge develop
      
      * merge
      
      * Add EventsWaiter
      
      * update
      
      * update
      
      * update Error MSG
      
      * update EventsWaiter
      cdb9bfa3
  7. 24 10月, 2021 1 次提交
  8. 23 10月, 2021 3 次提交
    • J
      add cinn graph symbolization (#36417) · bbd4bd73
      jiangcheng 提交于
      * add cinn graph symbolization
      
      * fix some bug
      
      * add paddle scope to cinn scope
      
      * add paddle scope to CINN scope in Symbolization, and add feed op when build cinn pass
      
      * fix some bug
      
      * fix some bug by review advices
      
      * optimize code problem
      
      * revert build_cinn_pass and move the change to https://github.com/PaddlePaddle/Paddle/pull/36503
      
      * fix some bug after co-compilation
      
      * perfect single test script
      
      * remove scope and rename feed_target to input_tensor
      
      * using std::unordered_map instead of absl::flat_hash_map
      
      * fix single test bug
      
      * revert to preverion for WITH_CINN has add in later PR
      
      * full error information for CI
      
      * full enfore information for CI pass
      bbd4bd73
    • J
      Add transformer of paddle desc and cinn desc (#36100) · 3cb6f65e
      jiangcheng 提交于
      * add transformer of paddle desc and cinn desc
      
      * change LOG(FATAL) to PADDLE_THROW for ci
      
      * full error imformation for ci
      
      * fix some problem as review advice
      
      * fix some bug
      
      * move vat type utils to tansform_desc header file
      
      * add if NOT WITH_CINN control whether compile
      
      * build_strategy check whether open WITH_CINN
      
      * add control WITH_CINN in cmake
      3cb6f65e
    • H
      New Paddle-CINN Compile PR (#36584) · ab732884
      Huihuang Zheng 提交于
      This PR added some changes to match the CINN change for compilation. It also tried to fix JiangCheng's Problem in PR: https://github.com/PaddlePaddle/Paddle/pull/36100
      
      These changes include:
      1. Set `CINN_GIT_TAG` to a newer tag
      2. CINN now just `make cinnapi -j`
      3. We have to add `-DPY_VERSION=${PY_VERSION} -DWITH_TESTING=ON` to CINN cmake args
      4. For CINN's third party dependencies, we could just include headers without target_link_libraries
      5. Moved `cinn.cmake` from `paddle/cmake` to `paddle/cmake/external` to match old style. External folder contains `lite`, which is the same level of `cinn`
      6. CINN added `-DNAMESPACE=cinn_gflags` in `gflags.cmake` to have different gflag namespaces between CINN and Paddle. It solved re-define problem.
      7. Change namespace of `::google::` in gflags to `::GFLAGS_NAMESPACE`
      ab732884
  9. 22 10月, 2021 1 次提交
    • L
      [hapi] support dygraph amp O2 (#36441) · 08248db0
      Leo Chen 提交于
      * [hapi] support dygrapg amp O2
      
      * fix problem of static pure fp16 in hapi
      
      * fix bug
      
      * fix format
      
      * fix ut
      
      * follow comments
      
      * update ut
      
      * update amp save/load
      
      * fix ut
      
      * refine code format
      08248db0
  10. 21 10月, 2021 4 次提交
  11. 20 10月, 2021 5 次提交
    • D
      [heterps]fix heterps pipeline training (#36512) · ded3e705
      danleifeng 提交于
      * split into PreBuildTask and BuildPull; slove endpass bug;test=develop
      
      * change buildcpu into prebuild and buildcpu into build;test=develop
      ded3e705
    • W
      fix fc fuse proble (#36568) · fc5db55a
      Wilber 提交于
      fc5db55a
    • S
      Add FasterTokenizer Operator (#34491) · 3f2d6a3f
      Steffy-zxf 提交于
      Add Tokenizer related functionalities for Transformer model in order that the process of training and predicting is consistent.
      
      * support the text string as an input Tensor
      * support the "VOCAB"unordered_map<wstring, int> as an input Tensor to lookup tokens
      * Tokenizer used for BERT. This tokenizer applies an end-to-end, text string to wordpiece tokenization.
      * It first applies basic tokenization, followed by wordpiece tokenization.
      3f2d6a3f
    • H
      Add CINN Compile Option (#36292) · 6524fa8d
      Huihuang Zheng 提交于
      Add CINN compile option in CMake.
      
      Now you can use CINN in Paddle by `-DWITH_CINN=ON` when `cmake`
      
      To test it, you can run `make cinn_lib_test -j` and `ctest -R cinn_lib_test`. 
      
      Note:
      1. You should set
      ```
      export runtime_include_dir=${CINN_SOURCE_DIR}/cinn/runtime/cuda 
      ```
      When run test, the `${CINN_SOURCE_DIR}` should be set based on your CINN directory.
      
      2. CINN is under developing now, you may have to change `CINN_GIT_TAG` to the git commit you need.
      6524fa8d
    • A
      Add kQueueSync.synchronize_run_ logic (#36546) · 127488ba
      Aurelius84 提交于
      127488ba
  12. 19 10月, 2021 3 次提交
  13. 18 10月, 2021 1 次提交
  14. 15 10月, 2021 2 次提交
    • Z
      Add ResNetUnit Python API (#35426) · 12882b2f
      Zhang Zheng 提交于
      12882b2f
    • J
      Add BuildCinnPass (#36345) · b3f02c57
      jiangcheng 提交于
      * Add CinnSubgraphSearchPass
      
      * solve CI problem of subgraph order not same
      
      * fix some bug by review advices
      
      * ensure the independently of subgraph, that mean the subgraph should not have link to out-graph
      
      * rename cinn_subgraph_search_pass to build_cinn_pass and delete paddle_to_cinn_pass
      
      * add flag to control wheter append build cinn pass
      
      * remove AppendPass at ParallelExecutorPassBuilder
      
      * rename paddle_to_cinn_pass to build_cinn_pass in build_strategy and close test_run_from_cinn
      b3f02c57