未验证 提交 7507956b 编写于 作者: X xiaoxiaohehe001 提交者: GitHub

release_ (#48383)

上级 91b65e58
...@@ -931,6 +931,7 @@ int MultiHeadMatmulV2FusePass::BuildFusionV2(Graph* graph, ...@@ -931,6 +931,7 @@ int MultiHeadMatmulV2FusePass::BuildFusionV2(Graph* graph,
scope->EraseVars({mul1_w->Name(), mul2_w->Name()}); scope->EraseVars({mul1_w->Name(), mul2_w->Name()});
scope->EraseVars({eltadd1_b->Name(), eltadd2_b->Name()}); scope->EraseVars({eltadd1_b->Name(), eltadd2_b->Name()});
paddle::memory::Release(platform::CPUPlace());
auto reshape_desc = reshape2->Op(); auto reshape_desc = reshape2->Op();
int head_number = int head_number =
...@@ -1398,6 +1399,7 @@ int MultiHeadMatmulV3FusePass::BuildFusionV3(Graph* graph, ...@@ -1398,6 +1399,7 @@ int MultiHeadMatmulV3FusePass::BuildFusionV3(Graph* graph,
sizeof(float) * wq_tensor->numel()); sizeof(float) * wq_tensor->numel());
scope->EraseVars({mul1_w->Name(), mul2_w->Name()}); scope->EraseVars({mul1_w->Name(), mul2_w->Name()});
paddle::memory::Release(platform::CPUPlace());
phi::DenseTensor tmp_combined_bias_tensor; phi::DenseTensor tmp_combined_bias_tensor;
tmp_combined_bias_tensor.Resize(combined_bias_dims); tmp_combined_bias_tensor.Resize(combined_bias_dims);
......
...@@ -888,6 +888,7 @@ int TrtMultiHeadMatmulV2FusePass::BuildFusionV2(Graph* graph, ...@@ -888,6 +888,7 @@ int TrtMultiHeadMatmulV2FusePass::BuildFusionV2(Graph* graph,
sizeof(float) * wq_tensor->numel()); sizeof(float) * wq_tensor->numel());
scope->EraseVars({mul1_w->Name(), mul2_w->Name()}); scope->EraseVars({mul1_w->Name(), mul2_w->Name()});
paddle::memory::Release(platform::CPUPlace());
phi::DenseTensor tmp_combined_bias_tensor; phi::DenseTensor tmp_combined_bias_tensor;
tmp_combined_bias_tensor.Resize(combined_bias_dims); tmp_combined_bias_tensor.Resize(combined_bias_dims);
...@@ -910,6 +911,7 @@ int TrtMultiHeadMatmulV2FusePass::BuildFusionV2(Graph* graph, ...@@ -910,6 +911,7 @@ int TrtMultiHeadMatmulV2FusePass::BuildFusionV2(Graph* graph,
sizeof(float) * bq_tensor->numel()); sizeof(float) * bq_tensor->numel());
scope->EraseVars({eltadd1_b->Name(), eltadd2_b->Name()}); scope->EraseVars({eltadd1_b->Name(), eltadd2_b->Name()});
paddle::memory::Release(platform::CPUPlace());
auto reshape_desc = reshape2->Op(); auto reshape_desc = reshape2->Op();
int head_number = int head_number =
...@@ -1408,6 +1410,7 @@ int TrtMultiHeadMatmulV3FusePass::BuildFusionV3(Graph* graph, ...@@ -1408,6 +1410,7 @@ int TrtMultiHeadMatmulV3FusePass::BuildFusionV3(Graph* graph,
sizeof(float) * wq_tensor->numel()); sizeof(float) * wq_tensor->numel());
scope->EraseVars({mul1_w->Name(), mul2_w->Name()}); scope->EraseVars({mul1_w->Name(), mul2_w->Name()});
paddle::memory::Release(platform::CPUPlace());
phi::DenseTensor tmp_combined_bias_tensor; phi::DenseTensor tmp_combined_bias_tensor;
tmp_combined_bias_tensor.Resize(combined_bias_dims); tmp_combined_bias_tensor.Resize(combined_bias_dims);
...@@ -1430,6 +1433,7 @@ int TrtMultiHeadMatmulV3FusePass::BuildFusionV3(Graph* graph, ...@@ -1430,6 +1433,7 @@ int TrtMultiHeadMatmulV3FusePass::BuildFusionV3(Graph* graph,
sizeof(float) * bq_tensor->numel()); sizeof(float) * bq_tensor->numel());
scope->EraseVars({eltadd1_b->Name(), eltadd2_b->Name()}); scope->EraseVars({eltadd1_b->Name(), eltadd2_b->Name()});
paddle::memory::Release(platform::CPUPlace());
auto reshape_desc = reshape2->Op(); auto reshape_desc = reshape2->Op();
int head_number = int head_number =
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册