Skip to content

Commit bd3899d

Browse files
committed
Set node_fusion_options.drop_constant_initializers to true for node_fusion_options
1 parent c103394 commit bd3899d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

plugin_execution_providers/tensorrt/tensorrt_execution_provider.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,9 @@ OrtStatus* ORT_API_CALL TensorrtExecutionProvider::GetCapabilityImpl(OrtEp* this
10331033
OrtNodeFusionOptions node_fusion_options = {};
10341034
node_fusion_options.ort_version_supported = ORT_API_VERSION;
10351035

1036+
// Set "drop constant initializers" to true as TRT doesn't need ORT to provide constant initializers
1037+
// as inputs to the fused/compiled node at inference time. This allows ORT to release unused initializers.
1038+
node_fusion_options.drop_constant_initializers = true;
10361039
RETURN_IF_ERROR(ep->ep_api.EpGraphSupportInfo_AddNodesToFuse(graph_support_info, supported_nodes.data(),
10371040
supported_nodes.size(), &node_fusion_options));
10381041
number_of_trt_nodes += static_cast<int>(group.first.size());

0 commit comments

Comments
 (0)