-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PTen] Add full kernel in pten (incomplete) #36930
Merged
Merged
Changes from 161 commits
Commits
Show all changes
163 commits
Select commit
Hold shift + click to select a range
3f545c4
initial tensor design & sign kernel demo
chenwhql 1f4ea40
add move constructor for meta & add lodtensor
chenwhql 44bf926
add dirs & sign xpu kernel
chenwhql b20689d
add mean cpu&cuda kernel impl
chenwhql 79d2a1a
move sign & mean xpu & npu kernel
chenwhql 434136f
add selected_rows basic impl
chenwhql 6c6ee22
refactor design, BaseTensor to DenseTensor, etc.
chenwhql 013c3fb
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
chenwhql 33bba06
add scale mkldnn kernel
chenwhql d895a11
polish xpu & npu impl details
chenwhql 62ebf01
fix mkldnn reuse compile failed
chenwhql 7c09726
change tensor operation lib name
chenwhql 7ae7f2f
resolve conflit with develop
chenwhql 288efc2
rename util filename
chenwhql be3ddd5
add more comments
chenwhql 3386c49
change TensorImplInterface to TensorInterface
chenwhql 4ef6be5
add kernel key and factory
chenwhql b69066e
remove MKLDNNTensorMeta, add MKLDNNDenseTensor
chenwhql 1d4f90e
resolve conflict with develop
chenwhql c732d57
change XXDeviceContext to XXContext
chenwhql 374345f
add base kernel registrar utils & test on sign
chenwhql bbb6473
resolve conflict with develop
chenwhql 0e18ff4
replace boost::any by paddle::any
chenwhql 805896b
fix several ci failed
chenwhql fc4442b
fix npu compile error
chenwhql cefe30a
add ordered map util
chenwhql aa3e79b
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
chenwhql a1753a0
fix multiple ordered_map compile errors
chenwhql 05a82e7
move dev into include dir
chenwhql 90e9090
support sign op in static op run
chenwhql a94eefd
fix static op run error
chenwhql 19da152
resolve confilt with develop
chenwhql 021a505
fix new executor compile failed
chenwhql f24e45e
add dygraph branch & remove sign_op.h
chenwhql 44acc84
fix test_infer_no_need_buffer_slots
chenwhql 2b66ab4
fix rocm compile link error
chenwhql 2a5ce9b
fix unitybuild error & clear glog
chenwhql 39b7d06
fix npu compile failed
chenwhql d4dec61
skip quant trans test
chenwhql 461f146
fix part windows compile problem
chenwhql 35aee9a
Merge branch 'develop' into op2func_refactor
chenwhql ddfbbdd
fix xpu enforce error
chenwhql 57bcd67
Merge branch 'op2func_refactor' of https://github.com/chenwhql/Paddle…
chenwhql 7d82352
fix inference test failed
chenwhql d55bb4b
Merge branch 'op2func_refactor' of https://github.com/chenwhql/Paddle…
chenwhql d9476dd
Merge branch 'develop' into op2func_refactor
chenwhql 193ee9d
remove ordered_map to solve quant failed
chenwhql f2db581
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
chenwhql db6ff09
fix part of rcom compile faild
chenwhql 80bf6b8
Merge branch 'op2func_refactor' of https://github.com/chenwhql/Paddle…
chenwhql 9031ab3
add more register kernels
chenwhql f7bbaca
revert scale kernel temporarily
chenwhql cea19d0
Merge branch 'develop' into op2func_refactor
chenwhql 568bebd
fix code format error
chenwhql 0eedc92
add new kernel registrar marco
chenwhql 509d13e
rename top to tcmpt
chenwhql 7146f92
revert xpu, npu, mkldnn impl & remove op def
chenwhql 321b141
add kernel args parse functor to auto parse args
chenwhql 57a14c6
resolve confilt with develop
chenwhql c3ebfea
revert some change & add scale kernels
chenwhql b67de9c
add op proto in dygraph kernelcontext building
chenwhql 13c02aa
polish kernel dispatch logic & nameing rule
chenwhql 1987ce9
fix scale kernel match error
chenwhql 33a4c41
fix scale test failed
chenwhql c32fde9
add mean API and unittest
chenwhql a4e53ef
test mean api success
chenwhql 1d9f33f
add branch to solve compiled error
chenwhql b0cf02c
skip clang format error
chenwhql 95a612e
add mean skip rule in op_library
chenwhql 83d6f77
add dot kernel, api and unittest (#6)
MingMingShangTian dad5e61
remove old kernel and add symbol link
chenwhql 027f0b2
resolve conflit with tianyu
chenwhql 8add5e4
fix dot compiled failed
chenwhql 01b5ded
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
chenwhql 71a3403
add merco for module declare
chenwhql 4663033
fix npu and xpu compile error
chenwhql be15b02
revert sign, mean, scale, dot kernel removing
chenwhql 8371096
add comment for keeping old kernel impl
chenwhql f1f6c8e
fix mutable_data error
chenwhql 5547b44
fix bfloat16 conflit
chenwhql dd3323d
fix inference undef error
chenwhql 65e68c6
Merge branch 'op2func_refactor' of https://github.com/chenwhql/Paddle…
chenwhql caaed19
adapt to msvc compile rules
chenwhql c9a3f38
Merge branch 'op2func_refactor' of https://github.com/chenwhql/Paddle…
chenwhql 46b7762
polish comment for template inst
chenwhql 4253f49
add cmake template instantiation for win
chenwhql 4e871ea
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
chenwhql 395a50f
Merge branch 'develop' into op2func_refactor
chenwhql 817f052
fix backend to place device id bug
chenwhql 7f640a6
Merge branch 'op2func_refactor' of https://github.com/chenwhql/Paddle…
chenwhql bf0f99b
fix ifdef error
chenwhql 73de891
Op2functor (#7)
MingMingShangTian e9b219d
fill_any_like kernel refactor (#10)
zyfncg 9789890
skip dtype for fill_any_like
chenwhql 9b33270
add attrs for kernel key constrcut
chenwhql aa6ed57
add use_pt_kernel Flags to control whether to use pt kernel (#13)
MingMingShangTian 9db8e4a
fix mutable_data cuda place error
chenwhql 12c1178
Merge branch 'develop' into op2func_refactor
chenwhql c882b5c
move high level apis into hapi
chenwhql e30ca2a
Merge branch 'op2func_refactor' of https://github.com/chenwhql/Paddle…
chenwhql 46ba70c
remove selectedrows adapting temporarily
chenwhql 073aef3
Support Scalar in Tensor Compute Library (#14)
zyfncg 06789ba
resolve conflit with yunfei
chenwhql 3f5f789
remove mkldnn tensor & polish details
chenwhql 2309149
use flat_hash_map and small_vector in kernel factory
chenwhql 6ce92e5
Refactor flatten kernel (#12)
YuanRisheng e0322d5
Revert "use flat_hash_map and small_vector in kernel factory"
chenwhql d3ab655
Move cpu, cuda and other device code into kernels (#15)
zyfncg ddc7de8
Perfect unitests (#16)
YuanRisheng 37791f7
replace with flat_hash_map, small_vector (#19)
MingMingShangTian 28a6374
Perfect unitests (#20)
YuanRisheng e3e2b50
refactor execution adapting impl
chenwhql e0710fd
resolve conflits
chenwhql ff19bd0
fix insert conflit
chenwhql 1dd0145
Fix CI bug of test_yolov3 (#21)
zyfncg b77d1ee
add the tensor base class, test=develop (#17)
Shixiaowei02 320b5f1
[no-verify] commit backend and tensor signature changes
chenwhql 5b2999f
resolve conflit with xiaowei
chenwhql 466ce03
Rename tcmpt to pten (#23)
zyfncg beec280
remove k of all enum var
chenwhql a49fd44
resolve conflit with yunfei
chenwhql 373f9c1
Merge branch 'develop' into op2func_refactor
chenwhql ce210b4
remove kernel_instantiate (#26)
MingMingShangTian 4e71d15
remove symbols and spatial_tensor
chenwhql 04cf058
change common to functions
chenwhql ab8db2d
readd share tensor impl methods
chenwhql f1c9661
add a candidate dense tensor class, test=develop (#28)
Shixiaowei02 d3674e9
change all Pt to Pten
chenwhql 4e2c0dd
Merge branch 'op2func_refactor' of https://github.com/chenwhql/Paddle…
chenwhql bbe59bc
resolve conflit with xiaowei
chenwhql 76a588e
Op2functor opt1 (#27)
MingMingShangTian fb224ab
polish kernel factory and kernel registry
chenwhql 252fb79
fix operator test error msg mismatch
chenwhql 19b1095
remove tensor signature and backend set member
chenwhql 24ef6c5
move scalar and polish enforce
chenwhql 1685b67
revert dtype layout change to fix error
chenwhql 7b7e988
fix enum operator override error
chenwhql 52fead0
add several base unittests
chenwhql 2ff2721
add pten utils tests
chenwhql e3ed2c6
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
chenwhql b5c77e5
polish some details
chenwhql 5240ac0
Dev/op2func refactor 3 (#30)
chenwhql 5fb285c
Merge branch 'op2func_refactor' of https://github.com/chenwhql/Paddle…
chenwhql 3276897
Merge branch 'develop' into op2func_refactor
chenwhql 558a848
polish some details
chenwhql 72910fa
Merge branch 'op2func_refactor' of https://github.com/chenwhql/Paddle…
chenwhql 8f100da
polish kernel signature details
chenwhql be9df70
fix a bug about offsets of the tensor, test=develop (#31)
chenwhql a83e9c7
polish some details
chenwhql 9584c40
add fill_constant kernel in pten
zyfncg 4d77b09
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
zyfncg dfb7f37
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
zyfncg 7058f22
fix bug of full api (c++)
zyfncg 2163b8f
remove the support for SelectRows in new fill_constant kernel
zyfncg f0c9c0c
fix bug of setting fill_any_like kernel key
zyfncg 7166d62
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
zyfncg fdd0ff8
merge code confilct
zyfncg b2d74cb
modify fill_constant GetExpectedKernelType
zyfncg 8579d63
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
zyfncg b657296
fix fill_constant KernelType bug
zyfncg 8bd9c10
polish code of build pten KernelContext
zyfncg e278bb3
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
zyfncg 5d8a3f6
refactor code of fill_constant in pten
zyfncg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,5 +15,6 @@ limitations under the License. */ | |
#pragma once | ||
|
||
// See Note: [ How do we organize the kernel directory ] | ||
#include "paddle/pten/infershape/0_nary.h" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 不建议使用数字命名文件,使用小写字母和下划线,这里是不是直接叫 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done, 已修改为nary |
||
#include "paddle/pten/infershape/binary.h" | ||
#include "paddle/pten/infershape/unary.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. */ | ||
|
||
// See Note [ Why still include the fluid headers? ] | ||
#include "paddle/pten/infershape/0_nary.h" | ||
|
||
namespace pten { | ||
|
||
DenseTensorMeta FullInferShape(const std::vector<int64_t>& shape, | ||
DataType dtype, | ||
DataLayout layout) { | ||
const auto& out_dims = paddle::framework::make_ddim(shape); | ||
return {dtype, out_dims, layout}; | ||
} | ||
|
||
} // namespace pten |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. */ | ||
|
||
#pragma once | ||
|
||
// See Note [ Why still include the fluid headers? ] | ||
#include "paddle/pten/core/tensor_meta.h" | ||
|
||
namespace pten { | ||
|
||
// Common InferShape Functions for 0-nary operators(no input tensor), The format | ||
// like: | ||
// | ||
// 1. DenseTensorMeta [OpName]InferShape( ...) | ||
// NOTE: The name "InferShape" may be not appropriate. "InferMeta" may be good. | ||
// Because functions in this file | ||
// not only can infer shape, but alse need infer lod or other useful data. | ||
|
||
DenseTensorMeta FullInferShape(const std::vector<int64_t>& shape, | ||
DataType dtype, | ||
DataLayout layout); | ||
|
||
} // namespace pten |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
cc_library(0_nary SRCS 0_nary.cc DEPS convert_utils) | ||
cc_library(unary SRCS unary.cc DEPS convert_utils) | ||
cc_library(binary SRCS binary.cc DEPS convert_utils) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我们统一使用小写的overloaded name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.