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

split_op for npu #34699

Merged
merged 5 commits into from
Aug 11, 2021
Merged

split_op for npu #34699

merged 5 commits into from
Aug 11, 2021

Conversation

sljlp
Copy link
Contributor

@sljlp sljlp commented Aug 8, 2021

PR types

Performance optimization

PR changes

OPs

Describe

implementation of split_op for npu

@paddle-bot-old
Copy link

paddle-bot-old bot commented Aug 8, 2021

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


if (ctx.HasInput("AxisTensor")) {
// TODO(liupeng51):
PADDLE_THROW(platform::errors::NotFound(
Copy link
Contributor

Choose a reason for hiding this comment

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

用platform::errors::Unimplemented吧

}
if (ctx.HasInput("SectionsTensorList")) {
// TODO(liupeng51):
PADDLE_THROW(platform::errors::NotFound(
Copy link
Contributor

Choose a reason for hiding this comment

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

platform::errors::Unimplemented

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

static_cast<int>(in->dims().size())));

auto sections_tensor_list =
ctx.MultiInput<framework::Tensor>("SectionsTensorList");
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.

现在不支持, 以后需要支持吧

static_cast<int>(in->dims().size())));

// TODO(liupeng51):
// auto sections_tensor_list =
Copy link
Contributor

Choose a reason for hiding this comment

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

先删了吧

std::vector<int> sections = ctx.Attr<std::vector<int>>("sections");
int axis = ctx.Attr<int>("axis");

// auto in_dims = in->dims();
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

@gongweibao gongweibao requested a review from zhiqiu August 11, 2021 03:33
Comment on lines 1 to 10
/* 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. */
Copy link
Contributor

Choose a reason for hiding this comment

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

Plz check the copyright format.

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

}

PADDLE_ENFORCE_EQ(
axis >= 0 && axis < in->dims().size(), true,
Copy link
Contributor

Choose a reason for hiding this comment

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

Axis could be negative.

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

Copy link
Contributor

@gongweibao gongweibao left a comment

Choose a reason for hiding this comment

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

LGTM

@gongweibao gongweibao merged commit d45d311 into PaddlePaddle:develop Aug 11, 2021
@sljlp sljlp deleted the split_op_for_npu branch August 11, 2021 11:29
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