[NNAdapter][KunlunxinXTCL] add new kunlunxin_xtcl ops#9368
Merged
hong19860320 merged 11 commits intoPaddlePaddle:developfrom Sep 5, 2022
Merged
Conversation
test=xtcl test=develop
|
Thanks for your contribution! |
zhupengyang
reviewed
Aug 23, 2022
lite/backends/nnadapter/nnadapter/src/driver/kunlunxin_xtcl/converter/arg_min_max.cc
Outdated
Show resolved
Hide resolved
lite/backends/nnadapter/nnadapter/src/driver/kunlunxin_xtcl/converter/binary_logical_op.cc
Outdated
Show resolved
Hide resolved
lite/backends/nnadapter/nnadapter/src/driver/kunlunxin_xtcl/converter/deformable_conv2d.cc
Outdated
Show resolved
Hide resolved
lite/backends/nnadapter/nnadapter/src/driver/kunlunxin_xtcl/converter/expand.cc
Outdated
Show resolved
Hide resolved
lite/backends/nnadapter/nnadapter/src/driver/kunlunxin_xtcl/converter/gelu.cc
Outdated
Show resolved
Hide resolved
lite/backends/nnadapter/nnadapter/src/driver/kunlunxin_xtcl/converter/layer_normalization.cc
Outdated
Show resolved
Hide resolved
lite/backends/nnadapter/nnadapter/src/driver/kunlunxin_xtcl/converter/resize_linear.cc
Outdated
Show resolved
Hide resolved
test=xtcl test=develop
test=xtcl test=develop
zhupengyang
reviewed
Aug 23, 2022
lite/backends/nnadapter/nnadapter/src/driver/kunlunxin_xtcl/CMakeLists.txt
Outdated
Show resolved
Hide resolved
lite/backends/nnadapter/nnadapter/src/driver/kunlunxin_xtcl/converter/expand.cc
Outdated
Show resolved
Hide resolved
test=xtcl test=develop
test=xtcl test=develop
test=xtcl test=develop
Collaborator
hong19860320
left a comment
There was a problem hiding this comment.
主要是一些代码格式上的问题,给了一些建议,可以参考把相关的文件都修改下。
cmake/functions.cmake
Outdated
| target_link_libraries(${TARGET} ${cuda_deps}) | ||
| endif() | ||
|
|
||
| if(NNADAPTER_WITH_KUNLUNXIN_XTCL) |
Collaborator
There was a problem hiding this comment.
Paddle-Lite/lite/tests/api/CMakeLists.txt
Line 42 in 2a07ee3
| int ConvertArgMinMax(Converter* converter, core::Operation* operation) { | ||
| ARG_MIN_MAX_OPERATION_EXTRACT_INPUTS_OUTPUTS | ||
|
|
||
| // not support 'in_shape_size == 1' |
| if (!input_expr.defined()) { | ||
| input_expr = converter->ConvertOperand(input_operand); | ||
| } | ||
|
|
| << OperationTypeToString(operation->type) | ||
| << " is found."; | ||
| } | ||
|
|
| if (!input_expr.defined()) { | ||
| input_expr = converter->ConvertOperand(input_operand); | ||
| } | ||
|
|
| if (!input_expr.defined()) { | ||
| input_expr = converter->ConvertOperand(input_operand); | ||
| } | ||
| // shape |
| ConvertToXTCLArray<xtcl::Integer>(shape_data, shape_count), | ||
| ConvertToXTCLDataType(value_operand->type.precision)); | ||
| converter->UpdateExprMap(output_operand, fill_expr); | ||
|
|
| auto shape_count = | ||
| shape_operand->length / static_cast<uint32_t>(sizeof(int32_t)); | ||
| auto shape_data = reinterpret_cast<int32_t*>(shape_operand->buffer); | ||
|
|
| auto fill_like_expr = | ||
| converter->builder()->CreateFullLike(input_expr, value_constant_expr); | ||
| converter->UpdateExprMap(output_operand, fill_like_expr); | ||
|
|
| } | ||
| } | ||
|
|
||
| // paddle: data type of output is same as fill_value |
test=xtcl test=develop
test=xtcl test=develop
test=xtcl test=develop
test=xtcl test=develop
test=xtcl test=develop
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
test=xtcl
test=develop