Skip to content

[NNAdapter][KunlunxinXTCL] add new kunlunxin_xtcl ops#9368

Merged
hong19860320 merged 11 commits intoPaddlePaddle:developfrom
daydayup-lh:lihuan/add_nnadpter_op_kunlunxin_xtcl
Sep 5, 2022
Merged

[NNAdapter][KunlunxinXTCL] add new kunlunxin_xtcl ops#9368
hong19860320 merged 11 commits intoPaddlePaddle:developfrom
daydayup-lh:lihuan/add_nnadpter_op_kunlunxin_xtcl

Conversation

@daydayup-lh
Copy link
Contributor

test=xtcl
test=develop

@paddle-bot
Copy link

paddle-bot bot commented Aug 22, 2022

Thanks for your contribution!

@CLAassistant
Copy link

CLAassistant commented Aug 22, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@zhupengyang zhupengyang left a comment

Choose a reason for hiding this comment

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

关注下 xpu CI 挂了

shentanyue
shentanyue previously approved these changes Aug 23, 2022
Copy link
Collaborator

@shentanyue shentanyue left a comment

Choose a reason for hiding this comment

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

意见同上,其余未发现问题。

Copy link
Collaborator

@hong19860320 hong19860320 left a comment

Choose a reason for hiding this comment

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

主要是一些代码格式上的问题,给了一些建议,可以参考把相关的文件都修改下。

target_link_libraries(${TARGET} ${cuda_deps})
endif()

if(NNADAPTER_WITH_KUNLUNXIN_XTCL)
Copy link
Collaborator

Choose a reason for hiding this comment

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

set(LINK_FLAGS "-Wl,--version-script ${PADDLE_SOURCE_DIR}/lite/core/lite.map")
已经加了,这里就不用加

int ConvertArgMinMax(Converter* converter, core::Operation* operation) {
ARG_MIN_MAX_OPERATION_EXTRACT_INPUTS_OUTPUTS

// not support 'in_shape_size == 1'
Copy link
Collaborator

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.

好的,我修改下

if (!input_expr.defined()) {
input_expr = converter->ConvertOperand(input_operand);
}

Copy link
Collaborator

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.

好的,我修改下

<< OperationTypeToString(operation->type)
<< " is found.";
}

Copy link
Collaborator

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.

好的,我修改下

if (!input_expr.defined()) {
input_expr = converter->ConvertOperand(input_operand);
}

Copy link
Collaborator

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.

好的,我修改下

if (!input_expr.defined()) {
input_expr = converter->ConvertOperand(input_operand);
}
// shape
Copy link
Collaborator

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.

好的,我修改下

ConvertToXTCLArray<xtcl::Integer>(shape_data, shape_count),
ConvertToXTCLDataType(value_operand->type.precision));
converter->UpdateExprMap(output_operand, fill_expr);

Copy link
Collaborator

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.

好的,我修改下

auto shape_count =
shape_operand->length / static_cast<uint32_t>(sizeof(int32_t));
auto shape_data = reinterpret_cast<int32_t*>(shape_operand->buffer);

Copy link
Collaborator

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.

好的,我修改下

auto fill_like_expr =
converter->builder()->CreateFullLike(input_expr, value_constant_expr);
converter->UpdateExprMap(output_operand, fill_like_expr);

Copy link
Collaborator

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.

好的,我修改下

}
}

// paddle: data type of output is same as fill_value
Copy link
Collaborator

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.

好的,我修改下

Copy link
Collaborator

@hong19860320 hong19860320 left a comment

Choose a reason for hiding this comment

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

LGTM

@hong19860320 hong19860320 merged commit 545fbd2 into PaddlePaddle:develop Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants