Skip to content

Conversation

@bukejiyu
Copy link
Contributor

@bukejiyu bukejiyu commented Jan 17, 2025

PR Category

Inference

PR Types

Others

Description

pcard-71500
pir-convert:
1.pd.embedding
2.pd.unbind
3.pd.logsigmoid

@bukejiyu bukejiyu changed the title [pir-inference]pir convert [pir-inference]support embedding、unbind、logsigmoid pir-trt convert Jan 17, 2025
axis = int(axis)

size_tensors = []
newDims_tensors = []
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.

改成了 new_shape_tenosr

}
};

class EmbeddingOpPattern
Copy link
Contributor

Choose a reason for hiding this comment

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

lookup_table只支持动态shape,pir-trt默认支持动态shape,这个应该是无条件进入trt

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

}
};

class UnbindOpPattern
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

newDims_tensor = trt_concat(network, newDims_tensors)
stride = trt.Dims([1] * rank)
outputs = []
output_size = len(paddle_op.results()[0].type().as_vec_type().as_list())
Copy link
Contributor

Choose a reason for hiding this comment

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

pir下get_output_names()应该能显示output_size

Copy link
Contributor Author

@bukejiyu bukejiyu Jan 20, 2025

Choose a reason for hiding this comment

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

这个应该不行吧,这个op只有一个输出pir::VectorType, 要先dyn_cast成pir::VectorType,才能获取size

Copy link
Contributor

Choose a reason for hiding this comment

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

哦哦好的

@lizexu123 lizexu123 merged commit 26f0fa9 into PaddlePaddle:develop Jan 21, 2025
31 checks passed
@lizexu123 lizexu123 changed the title [pir-inference]support embedding、unbind、logsigmoid pir-trt convert 【Paddle TensorRT No.45,No.58,No.44】support embedding、unbind、logsigmoid pir-trt convert Jan 21, 2025
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.

3 participants