Skip to content
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

[Unify Tensors PR #7] Merged LoDTensor with Tensor, test=allcases #38880

Merged

Conversation

jim19930609
Copy link
Contributor

@jim19930609 jim19930609 commented Jan 11, 2022

PR types

Others

PR changes

Others

Describe

Previous works on constructing new tensor library "pten" introduced another Tensor type namely "DenseTensor", which temporarily co-exists with framework::Tensor and LoDTensor. In this series of PRs, we attempt to replace legacy "framework::Tensor and LoDTensor" by the newly implemented "DenseTensor", so as to facilitate the progress of "pten" joining original framework.

Merged C++ level LoDTensor into Tensor, so that all previous accesses to LoDTensor will be re-routed to Tensor. Same merge also happens at pybind level, where we merged all pybind methods of core.LoDTensor to core.Tensor. After that, we further patched core.LoDTensor method to core.Tensor so as to guarantee API compatibility.

image

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@jim19930609 jim19930609 changed the title Merged LoDTensor with Tensor,test=allcases [Unify Tensors PR #7] Merged LoDTensor with Tensor, test=allcases Jan 11, 2022
@jim19930609 jim19930609 force-pushed the merge_using_lod_tensor_as_tensor branch from 064eb19 to d4f0596 Compare January 12, 2022 02:31
@jim19930609 jim19930609 requested review from TCChenlong and chenwhql and removed request for TCChenlong January 13, 2022 02:05
Copy link
Contributor

@JiabinYang JiabinYang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some comment

paddle/fluid/operators/mkldnn/fc_mkldnn_op.cc Show resolved Hide resolved
paddle/fluid/operators/math/beam_search.cc Show resolved Hide resolved
@@ -31,7 +31,7 @@ void SetLoD(DstLoD* dst, const SrcLoD& src) {
}
}

std::unique_ptr<pten::DenseTensor> MakePtenDenseTensor(
std::unique_ptr<pten::DenseTensor> MakePtenDenseTensorOrig(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad name

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do u mean by Orig

Copy link
Contributor Author

@jim19930609 jim19930609 Jan 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to MakePtenDenseTensorBase().

Basically, these functions under "/pten/api/" will be removed after Tensor Unification. So I simply renamed some of the conflicting functions to avoid modifying their contents (which is throw-away work)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

k,then give some comment on them to show they are throw-away work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or not, since this PR is urgent...

paddle/pten/api/lib/utils/tensor_utils.h Outdated Show resolved Hide resolved
paddle/pten/api/lib/utils/tensor_utils.h Show resolved Hide resolved
Copy link
Contributor

@JiabinYang JiabinYang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@chenwhql chenwhql left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@XiaoguangHu01 XiaoguangHu01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jim19930609 jim19930609 merged commit 88966b2 into PaddlePaddle:develop Jan 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants