Skip to content

[Phi] Migrate cholesky_solve op to phi #40387

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

Merged
merged 1 commit into from
Mar 11, 2022

Conversation

zhwesky2010
Copy link
Contributor

@zhwesky2010 zhwesky2010 commented Mar 9, 2022

PR types

Function optimization

PR changes

OPs

Describe

[Phi] migrate cholesky_solve op to phi.

@zhwesky2010 zhwesky2010 changed the title [Phi]migrate cholesky_solve op to phi [Phi] Migrate cholesky_solve op to phi Mar 9, 2022
@paddle-bot-old
Copy link

paddle-bot-old bot commented Mar 9, 2022

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

@zhwesky2010 zhwesky2010 changed the title [Phi] Migrate cholesky_solve op to phi 【Phi】 Migrate cholesky_solve op to phi Mar 9, 2022
@PaddlePaddle PaddlePaddle locked and limited conversation to collaborators Mar 10, 2022
@PaddlePaddle PaddlePaddle unlocked this conversation Mar 10, 2022
phi::funcs::ForRange<Context> out_for_range(dev_ctx, out->numel());
phi::funcs::ConjFunctor<T> out_functor(
out->data<T>(), out->numel(), out->data<T>());
out_for_range(out_functor);
Copy link
Contributor

@MingMingShangTian MingMingShangTian Mar 10, 2022

Choose a reason for hiding this comment

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

这里可以直接调用phi::ConjKernel

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

#include "paddle/phi/kernels/transpose_kernel.h"

// See Note [ Why still include the fluid headers? ]
#include "paddle/fluid/operators/tril_triu_op.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

#40007 这个PR 将会删除这个头文件了,你看下如何解冲突?

Copy link
Contributor Author

@zhwesky2010 zhwesky2010 Mar 11, 2022

Choose a reason for hiding this comment

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

这个CI要过了,那个需要重新push,先合这个吧避免delay进度

DenseTensor out_conj;
out_conj.Resize(out.dims());
phi::funcs::ForRange<Context> out_for_range(dev_ctx, out.numel());
phi::funcs::ConjFunctor<T> out_functor(
Copy link
Contributor

Choose a reason for hiding this comment

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

可以用phi::ConjKernel

Copy link
Contributor Author

Choose a reason for hiding this comment

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

共轭均已修改

commonterm.data<T>(),
commonterm.numel(),
dev_ctx.template Alloc<T>(&commonterm_conj));
commonterm_for_range(commonterm_functor);
Copy link
Contributor

Choose a reason for hiding this comment

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

同上

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

const auto H = y_bst_dims_vec[y_bst_ndim - 2];
const auto W = y_bst_dims_vec[y_bst_ndim - 1];
phi::funcs::ForRange<Context> y_for_range(dev_ctx, dy_bst.numel());
paddle::operators::TrilTriuCompute<T> tril_triu_functor(
Copy link
Contributor

Choose a reason for hiding this comment

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

TrilTriu 也正在迁移,看下如何避免冲突

Copy link
Contributor Author

Choose a reason for hiding this comment

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

看下谁先过CI吧

Copy link
Contributor

@YuanRisheng YuanRisheng left a comment

Choose a reason for hiding this comment

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

这个op添加了benchmark脚本了吗

@zhwesky2010
Copy link
Contributor Author

这个op添加了benchmark脚本了吗

已经合入了

@zhwesky2010 zhwesky2010 changed the title 【Phi】 Migrate cholesky_solve op to phi [Phi] Migrate cholesky_solve op to phi Mar 10, 2022
Copy link
Contributor

@MingMingShangTian MingMingShangTian 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

@zhwesky2010 zhwesky2010 merged commit e24ca55 into PaddlePaddle:develop Mar 11, 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.

4 participants