Skip to content

Commit ccecf72

Browse files
author
pytorchbot
committed
2026-03-11 nightly release (08bfca2)
1 parent 6b4bb2c commit ccecf72

File tree

284 files changed

+565
-329
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

284 files changed

+565
-329
lines changed

core/runtime/execute_engine.cpp

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,8 @@ void setup_input_tensors(
9696
std::vector<at::Tensor> inputs,
9797
c10::intrusive_ptr<TRTEngine> compiled_engine,
9898
bool cudagraphs_enabled,
99-
bool need_cudagraphs_record) {
100-
// this is a buffer to store shape tensor input addresses throughout the runtime scope
101-
std::list<std::vector<int64_t>> inputShapeTensorValues;
99+
bool need_cudagraphs_record,
100+
std::list<std::vector<int64_t>>& inputShapeTensorValues) {
102101
std::list<at::Tensor> formatted_inputs(compiled_engine->num_io.first);
103102

104103
for (size_t i = 0; i < inputs.size(); i++) {
@@ -115,9 +114,10 @@ void setup_input_tensors(
115114

116115
auto dims = core::util::toDims(inputs[i].sizes());
117116
auto shape = core::util::toVec(dims);
118-
LOG_DEBUG("Input Name: " << name << " Shape: " << dims);
117+
bool is_shape_tensor = compiled_engine->cuda_engine->isShapeInferenceIO(name.c_str());
118+
LOG_DEBUG("Input Name: " << name << " Shape: " << dims << " isShapeInferenceIO: " << is_shape_tensor);
119119

120-
if (compiled_engine->cuda_engine->isShapeInferenceIO(name.c_str())) {
120+
if (is_shape_tensor) {
121121
// Shape tensor inputs are casted to int64 explicitly.
122122
// Refer to
123123
// https://github.com/NVIDIA/TensorRT/blob/d2f4ef789a9a6ffdf37b55c3f81b486225f6b380/samples/common/sampleInference.cpp#L435
@@ -233,6 +233,9 @@ std::vector<at::Tensor> execute_engine(std::vector<at::Tensor> inputs, c10::intr
233233

234234
std::vector<at::Tensor> outputs(compiled_engine->num_io.second);
235235

236+
// Shape tensor CPU buffers must outlive inferShapes() and enqueueV3()
237+
std::list<std::vector<int64_t>> inputShapeTensorValues;
238+
236239
// Intialize inputs and outputs to be available throughout the succeeding scopes
237240
{ // Input Setup
238241
std::unique_ptr<torch::autograd::profiler::RecordProfile> input_profiler_guard;
@@ -241,7 +244,7 @@ std::vector<at::Tensor> execute_engine(std::vector<at::Tensor> inputs, c10::intr
241244
std::make_unique<torch::autograd::profiler::RecordProfile>(compiled_engine->input_profile_path);
242245
}
243246

244-
setup_input_tensors(inputs, compiled_engine, cudagraphs_enabled, need_cudagraphs_record);
247+
setup_input_tensors(inputs, compiled_engine, cudagraphs_enabled, need_cudagraphs_record, inputShapeTensorValues);
245248
// Check if input shapes can be inferred.
246249
int32_t const io_size{compiled_engine->cuda_engine->getNbIOTensors()};
247250
std::vector<char const*> names(io_size);
@@ -364,14 +367,17 @@ std::vector<at::Tensor> execute_engine(std::vector<at::Tensor> inputs, c10::intr
364367
};
365368

366369
auto run_output_allocator = [&]() {
370+
// Shape tensor CPU buffers must outlive inferShapes() and enqueueV3()
371+
std::list<std::vector<int64_t>> inputShapeTensorValues;
372+
367373
{ // Input Setup
368374
std::unique_ptr<torch::autograd::profiler::RecordProfile> input_profiler_guard;
369375
if (compiled_engine->profile_execution) {
370376
input_profiler_guard =
371377
std::make_unique<torch::autograd::profiler::RecordProfile>(compiled_engine->input_profile_path);
372378
}
373379

374-
setup_input_tensors(inputs, compiled_engine, false, false);
380+
setup_input_tensors(inputs, compiled_engine, false, false, inputShapeTensorValues);
375381
// Check if input shapes can be inferred.
376382
int32_t const io_size{compiled_engine->cuda_engine->getNbIOTensors()};
377383
std::vector<char const*> names(io_size);

docs/_cpp_api/classtorch__tensorrt_1_1DataType.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<link rel="preload" as="script" href="../_static/scripts/pydata-sphinx-theme.js?digest=dfe6caa3a7d634c4db9b" />
4444
<script src="../_static/vendor/fontawesome/6.5.2/js/all.min.js?digest=dfe6caa3a7d634c4db9b"></script>
4545

46-
<script src="../_static/documentation_options.js?v=a372bef0"></script>
46+
<script src="../_static/documentation_options.js?v=2d416d50"></script>
4747
<script src="../_static/doctools.js?v=888ff710"></script>
4848
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
4949
<script src="../_static/collapsible-lists/js/CollapsibleLists.compressed.js?v=73120307"></script>

docs/_cpp_api/classtorch__tensorrt_1_1Device_1_1DeviceType.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<link rel="preload" as="script" href="../_static/scripts/pydata-sphinx-theme.js?digest=dfe6caa3a7d634c4db9b" />
4444
<script src="../_static/vendor/fontawesome/6.5.2/js/all.min.js?digest=dfe6caa3a7d634c4db9b"></script>
4545

46-
<script src="../_static/documentation_options.js?v=a372bef0"></script>
46+
<script src="../_static/documentation_options.js?v=2d416d50"></script>
4747
<script src="../_static/doctools.js?v=888ff710"></script>
4848
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
4949
<script src="../_static/collapsible-lists/js/CollapsibleLists.compressed.js?v=73120307"></script>

docs/_cpp_api/classtorch__tensorrt_1_1TensorFormat.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<link rel="preload" as="script" href="../_static/scripts/pydata-sphinx-theme.js?digest=dfe6caa3a7d634c4db9b" />
4444
<script src="../_static/vendor/fontawesome/6.5.2/js/all.min.js?digest=dfe6caa3a7d634c4db9b"></script>
4545

46-
<script src="../_static/documentation_options.js?v=a372bef0"></script>
46+
<script src="../_static/documentation_options.js?v=2d416d50"></script>
4747
<script src="../_static/doctools.js?v=888ff710"></script>
4848
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
4949
<script src="../_static/collapsible-lists/js/CollapsibleLists.compressed.js?v=73120307"></script>

docs/_cpp_api/define_macros_8h_1a18d295a837ac71add5578860b55e5502.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<link rel="preload" as="script" href="../_static/scripts/pydata-sphinx-theme.js?digest=dfe6caa3a7d634c4db9b" />
4444
<script src="../_static/vendor/fontawesome/6.5.2/js/all.min.js?digest=dfe6caa3a7d634c4db9b"></script>
4545

46-
<script src="../_static/documentation_options.js?v=a372bef0"></script>
46+
<script src="../_static/documentation_options.js?v=2d416d50"></script>
4747
<script src="../_static/doctools.js?v=888ff710"></script>
4848
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
4949
<script src="../_static/collapsible-lists/js/CollapsibleLists.compressed.js?v=73120307"></script>

docs/_cpp_api/define_macros_8h_1a282fd3c0b1c3a215148ae372070e1268.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<link rel="preload" as="script" href="../_static/scripts/pydata-sphinx-theme.js?digest=dfe6caa3a7d634c4db9b" />
4444
<script src="../_static/vendor/fontawesome/6.5.2/js/all.min.js?digest=dfe6caa3a7d634c4db9b"></script>
4545

46-
<script src="../_static/documentation_options.js?v=a372bef0"></script>
46+
<script src="../_static/documentation_options.js?v=2d416d50"></script>
4747
<script src="../_static/doctools.js?v=888ff710"></script>
4848
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
4949
<script src="../_static/collapsible-lists/js/CollapsibleLists.compressed.js?v=73120307"></script>

docs/_cpp_api/define_macros_8h_1a31398a6d4d27e28817afb0f0139e909e.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<link rel="preload" as="script" href="../_static/scripts/pydata-sphinx-theme.js?digest=dfe6caa3a7d634c4db9b" />
4444
<script src="../_static/vendor/fontawesome/6.5.2/js/all.min.js?digest=dfe6caa3a7d634c4db9b"></script>
4545

46-
<script src="../_static/documentation_options.js?v=a372bef0"></script>
46+
<script src="../_static/documentation_options.js?v=2d416d50"></script>
4747
<script src="../_static/doctools.js?v=888ff710"></script>
4848
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
4949
<script src="../_static/collapsible-lists/js/CollapsibleLists.compressed.js?v=73120307"></script>

docs/_cpp_api/define_macros_8h_1a35703561b26b1a9d2738ad7d58b27827.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<link rel="preload" as="script" href="../_static/scripts/pydata-sphinx-theme.js?digest=dfe6caa3a7d634c4db9b" />
4444
<script src="../_static/vendor/fontawesome/6.5.2/js/all.min.js?digest=dfe6caa3a7d634c4db9b"></script>
4545

46-
<script src="../_static/documentation_options.js?v=a372bef0"></script>
46+
<script src="../_static/documentation_options.js?v=2d416d50"></script>
4747
<script src="../_static/doctools.js?v=888ff710"></script>
4848
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
4949
<script src="../_static/collapsible-lists/js/CollapsibleLists.compressed.js?v=73120307"></script>

docs/_cpp_api/define_macros_8h_1abd1465eb38256d3f22cc1426b23d516b.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<link rel="preload" as="script" href="../_static/scripts/pydata-sphinx-theme.js?digest=dfe6caa3a7d634c4db9b" />
4444
<script src="../_static/vendor/fontawesome/6.5.2/js/all.min.js?digest=dfe6caa3a7d634c4db9b"></script>
4545

46-
<script src="../_static/documentation_options.js?v=a372bef0"></script>
46+
<script src="../_static/documentation_options.js?v=2d416d50"></script>
4747
<script src="../_static/doctools.js?v=888ff710"></script>
4848
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
4949
<script src="../_static/collapsible-lists/js/CollapsibleLists.compressed.js?v=73120307"></script>

docs/_cpp_api/define_macros_8h_1abe87b341f562fd1cf40b7672e4d759da.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<link rel="preload" as="script" href="../_static/scripts/pydata-sphinx-theme.js?digest=dfe6caa3a7d634c4db9b" />
4444
<script src="../_static/vendor/fontawesome/6.5.2/js/all.min.js?digest=dfe6caa3a7d634c4db9b"></script>
4545

46-
<script src="../_static/documentation_options.js?v=a372bef0"></script>
46+
<script src="../_static/documentation_options.js?v=2d416d50"></script>
4747
<script src="../_static/doctools.js?v=888ff710"></script>
4848
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
4949
<script src="../_static/collapsible-lists/js/CollapsibleLists.compressed.js?v=73120307"></script>

0 commit comments

Comments
 (0)