Skip to content

Commit

Permalink
change function name
Browse files Browse the repository at this point in the history
  • Loading branch information
chilo-ms committed Nov 3, 2023
1 parent df7ef46 commit 993b2ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2199,13 +2199,14 @@ TensorrtExecutionProvider::GetCapability(const GraphViewer& graph,
// If the model consists of only a single "EPContext" contrib op, it means TRT EP can fetch the precompiled engine info from the node and

Check warning on line 2199 in onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc

View workflow job for this annotation

GitHub Actions / cpplint

[cpplint] onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc#L2199

Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4]
Raw output
onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc:2199:  Line ends in whitespace.  Consider deleting these extra spaces.  [whitespace/end_of_line] [4]

Check warning on line 2199 in onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc

View workflow job for this annotation

GitHub Actions / cpplint

[cpplint] onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc#L2199

Lines should be <= 120 characters long [whitespace/line_length] [2]
Raw output
onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc:2199:  Lines should be <= 120 characters long  [whitespace/line_length] [2]
// load the engine directly without having to go through the processes of graph proto reconstruction, calling TRT parser and engine compilation.

Check warning on line 2200 in onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc

View workflow job for this annotation

GitHub Actions / cpplint

[cpplint] onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc#L2200

Lines should be <= 120 characters long [whitespace/line_length] [2]
Raw output
onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc:2200:  Lines should be <= 120 characters long  [whitespace/line_length] [2]
// So, simply return the ComputeCapability here.
if (HasPrecompiledEngine(graph)) {
if (IsValidEPContextNode(graph)) {
if (IsFusedGraphHasCtxNode(graph)) {
if (IsValidCtxNode(graph)) {
SubGraph_t supported_node_vector = {{0}, false};
std::unique_ptr<IndexedSubGraph> sub_graph = GetSubGraph(supported_node_vector, graph, TRTGenerateId(graph), 0);
result.push_back(ComputeCapability::Create(std::move(sub_graph)));
} else {
LOGS_DEFAULT(ERROR) << "[TensorRT EP] It's not a valid EP context contrib op";
}
LOGS_DEFAULT(ERROR) << "[TensorRT EP] It's not a valid EP context contrib op";
return result;
}

Expand Down Expand Up @@ -3674,7 +3675,7 @@ common::Status TensorrtExecutionProvider::Compile(const std::vector<FusedNodeAnd
}

Status status;
if (HasPrecompiledEngine(graph_body_viewer)) {
if (IsFusedGraphHasCtxNode(graph_body_viewer)) {
status = CreateNodeComputeFromPrecompiledEngine(graph_body_viewer, fused_node, input_map, output_map, node_compute_funcs);

Check warning on line 3679 in onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc

View workflow job for this annotation

GitHub Actions / cpplint

[cpplint] onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc#L3679

Lines should be <= 120 characters long [whitespace/line_length] [2]
Raw output
onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc:3679:  Lines should be <= 120 characters long  [whitespace/line_length] [2]
} else {
status = CreateNodeComputeFromOrtGraph(graph_body_viewer, fused_node, input_map, output_map, node_compute_funcs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ bool ParseProfileShapes(std::string profile_shapes_string, std::unordered_map<st
*
* Note: Please see more details about "EPContext" contrib op in contrib_defs.cc
*/
bool HasPrecompiledEngine(const GraphViewer& graph) {
bool IsFusedGraphHasCtxNode(const GraphViewer& graph) {
if (graph.NumberOfNodes() == 1) {
for (int i = 0; i < graph.MaxNodeIndex(); ++i) {
auto node = graph.GetNode(i);
Expand Down Expand Up @@ -739,7 +739,7 @@ std::filesystem::path LocateEnginePath(const onnxruntime::Path& model_path, std:
/*
* The sanity check for EP context contrib op.
*/
bool IsValidEPContextNode(const GraphViewer& graph) {
bool IsValidCtxNode(const GraphViewer& graph) {
assert(graph.NumberOfNodes() == 1);
assert(graph.GetNode(0)->OpType() == EP_CONTEXT_OP_TYPE);
auto node = graph.GetNode(0);
Expand Down

0 comments on commit 993b2ad

Please sign in to comment.