Skip to content

Commit 0a8be0d

Browse files
committed
lintrunner -a
1 parent 1211cd6 commit 0a8be0d

23 files changed

+282
-293
lines changed

plugin_execution_providers/tensorrt/cuda/cu_inc/unary_elementwise_impl.cuh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ __global__ void _UnaryElementWise(
3535
InT value[NumElementsPerThread];
3636

3737
CUDA_LONG id = start;
38-
#pragma unroll
38+
#pragma unroll
3939
for (int i = 0; i < NumElementsPerThread; i++) {
4040
if (id < N) {
4141
value[i] = input_data[id];
@@ -44,7 +44,7 @@ __global__ void _UnaryElementWise(
4444
}
4545

4646
id = start;
47-
#pragma unroll
47+
#pragma unroll
4848
for (int i = 0; i < NumElementsPerThread; i++) {
4949
if (id < N) {
5050
output_data[id] = functor(value[i]);

plugin_execution_providers/tensorrt/cuda/unary_elementwise_ops_impl.cu

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#endif
1010
#include <cuda_fp16.h>
1111

12-
1312
namespace cuda {
1413

1514
// the postfix of means the types supported by the op:
@@ -72,7 +71,7 @@ struct OP_Cast {
7271
IMPL_CAST_IMPL(T, uint32_t) \
7372
IMPL_CAST_IMPL(T, uint64_t) \
7473
IMPL_CAST_IMPL(T, bool) \
75-
//IMPL_CAST_IMPL(T, BFloat16)
74+
// IMPL_CAST_IMPL(T, BFloat16)
7675

7776
IMPL_CAST_IMPL_FROM(half)
7877
IMPL_CAST_IMPL_FROM(float)
@@ -86,6 +85,6 @@ IMPL_CAST_IMPL_FROM(uint16_t)
8685
IMPL_CAST_IMPL_FROM(uint32_t)
8786
IMPL_CAST_IMPL_FROM(uint64_t)
8887
IMPL_CAST_IMPL_FROM(bool)
89-
//IMPL_CAST_IMPL_FROM(BFloat16)
88+
// IMPL_CAST_IMPL_FROM(BFloat16)
9089

9190
} // namespace cuda

plugin_execution_providers/tensorrt/cuda/unary_elementwise_ops_impl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace cuda {
2727
DECL_IMPL_CAST(T, uint32_t) \
2828
DECL_IMPL_CAST(T, uint64_t) \
2929
DECL_IMPL_CAST(T, bool) \
30-
//DECL_IMPL_CAST(T, BFloat16)
30+
// DECL_IMPL_CAST(T, BFloat16)
3131

3232
DECL_IMPL_CAST_FROM(half)
3333
DECL_IMPL_CAST_FROM(float)
@@ -41,7 +41,7 @@ DECL_IMPL_CAST_FROM(uint16_t)
4141
DECL_IMPL_CAST_FROM(uint32_t)
4242
DECL_IMPL_CAST_FROM(uint64_t)
4343
DECL_IMPL_CAST_FROM(bool)
44-
//DECL_IMPL_CAST_FROM(BFloat16)
44+
// DECL_IMPL_CAST_FROM(BFloat16)
4545

4646
template <typename InT, typename OutT>
4747
void Impl_Cast(cudaStream_t stream, const InT* input_data, OutT* output_data, size_t count) {

plugin_execution_providers/tensorrt/cuda_allocator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ struct CUDAAllocator : OrtAllocator {
1515
OrtAllocator::Info = [](const OrtAllocator* this_) { return static_cast<const CUDAAllocator*>(this_)->Info(); };
1616
OrtAllocator::Reserve = nullptr;
1717
OrtAllocator::GetStats = nullptr;
18-
OrtAllocator::AllocOnStream = nullptr; // Allocate memory, handling usage across different Streams. Not used for TRT EP.
18+
OrtAllocator::AllocOnStream = nullptr; // Allocate memory, handling usage across different Streams. Not used for TRT EP.
1919
}
2020
// TODO: Handle destructor
2121
//~CUDAAllocator();

plugin_execution_providers/tensorrt/onnx_ctx_model_helper.cc

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ OrtStatus* EPContextNodeHelper::CreateEPContextNode(const std::string& engine_ca
4646
const std::string& compute_capability,
4747
const std::string& onnx_model_path,
4848
OrtNode** ep_context_node) {
49-
5049
// Helper to collect input or output names from an array of OrtValueInfo instances.
5150
auto collect_input_output_names = [&](gsl::span<const OrtValueInfo* const> value_infos,
5251
std::vector<const char*>& result) -> OrtStatus* {
@@ -99,16 +98,14 @@ OrtStatus* EPContextNodeHelper::CreateEPContextNode(const std::string& engine_ca
9998
RETURN_IF_ERROR(ort_api.CreateOpAttr("ep_cache_context", engine_cache_path.c_str(), engine_cache_path.size(), ORT_OP_ATTR_STRING, &attributes[1]));
10099
}
101100

102-
103101
ort_api.CreateOpAttr("hardware_architecture", compute_capability.c_str(), compute_capability.size(), ORT_OP_ATTR_STRING, &attributes[2]);
104102
ort_api.CreateOpAttr("onnx_model_filename", std::filesystem::path(onnx_model_path).filename().string().c_str(), 1,
105103
ORT_OP_ATTR_STRING, &attributes[3]);
106104

107-
108105
RETURN_IF_ERROR(model_editor_api.CreateNode("EPContext", "com.microsoft", fused_node_name, input_names.data(),
109106
input_names.size(), output_names.data(), output_names.size(),
110107
attributes.data(), attributes.size(), ep_context_node));
111-
108+
112109
return nullptr;
113110
}
114111

@@ -140,7 +137,7 @@ OrtStatus* EPContextNodeReader::GetEpContextFromGraph(const OrtGraph& graph) {
140137
const int64_t embed_mode = reinterpret_cast<const ONNX_NAMESPACE::AttributeProto*>(node_attr)->i();
141138

142139
// Only make path checks if model not provided as byte buffer
143-
//bool make_secure_path_checks = !GetModelPath(graph_viewer).empty();
140+
// bool make_secure_path_checks = !GetModelPath(graph_viewer).empty();
144141
bool make_secure_path_checks = false;
145142

146143
if (embed_mode) {
@@ -151,7 +148,7 @@ OrtStatus* EPContextNodeReader::GetEpContextFromGraph(const OrtGraph& graph) {
151148

152149
*(trt_engine_) = std::unique_ptr<nvinfer1::ICudaEngine>(trt_runtime_->deserializeCudaEngine(const_cast<char*>(context_binary.c_str()),
153150
static_cast<size_t>(context_binary.length())));
154-
//LOGS_DEFAULT(VERBOSE) << "[TensorRT EP] Read engine as binary data from \"ep_cache_context\" attribute of ep context node and deserialized it";
151+
// LOGS_DEFAULT(VERBOSE) << "[TensorRT EP] Read engine as binary data from \"ep_cache_context\" attribute of ep context node and deserialized it";
155152
if (!(*trt_engine_)) {
156153
return ort_api.CreateStatus(ORT_EP_FAIL, "TensorRT EP could not deserialize engine from binary data");
157154
}

plugin_execution_providers/tensorrt/onnx_ctx_model_helper.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#include "tensorrt_execution_provider.h"
77
#include "ep_utils.h"
8-
#include "nv_includes.h"
8+
// #include "nv_includes.h"
99

1010
#include <string>
1111
#include <filesystem>
@@ -21,14 +21,13 @@ class EPContextNodeHelper : public ApiPtrs {
2121

2222
static bool GraphHasCtxNode(const OrtGraph* graph, const OrtApi& ort_api);
2323

24-
OrtStatus* CreateEPContextNode(const std::string& engine_cache_path,
24+
OrtStatus* CreateEPContextNode(const std::string& engine_cache_path,
2525
char* engine_data,
2626
size_t size,
2727
const int64_t embed_mode,
2828
const std::string& compute_capability,
2929
const std::string& onnx_model_path,
30-
OrtNode** ep_context_node
31-
);
30+
OrtNode** ep_context_node);
3231

3332
private:
3433
const OrtGraph* graph_ = nullptr;
@@ -63,7 +62,7 @@ class EPContextNodeReader : public ApiPtrs {
6362
detailed_build_log_(detailed_build_log) {
6463
}
6564

66-
//bool ValidateEPCtxNode(const OrtGraph& graph);
65+
// bool ValidateEPCtxNode(const OrtGraph& graph);
6766

6867
OrtStatus* GetEpContextFromGraph(const OrtGraph& graph);
6968

0 commit comments

Comments
 (0)