Skip to content

Commit 0c6e9f9

Browse files
authored
fix builds enabling onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS (microsoft#2369)
* fix builds enabling onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS * update
1 parent 53ed36a commit 0c6e9f9

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

BUILD.md

+25
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ The complete list of build options can be found by running `./build.sh (or .\bui
106106
**Options**
107107
* [OpenMP](#OpenMP)
108108
* [OpenBLAS](#OpenBLAS)
109+
* [DebugNodeInputsOutputs](#DebugNodeInputsOutputs)
109110
110111
**Architectures**
111112
* [x86](#x86)
@@ -424,6 +425,30 @@ The DirectML execution provider supports building for both x64 and x86 architect
424425
425426
---
426427
428+
### DebugNodeInputsOutputs
429+
OnnxRuntime supports build options for enabling debugging of intermediate tensor shapes and data.
430+
#### Build Instructions
431+
##### Set onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=1
432+
Dump tensor input/output shapes for all nodes to stdout.
433+
```
434+
# Linux
435+
./build.sh --cmake_extra_defines onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=1
436+
# Windows
437+
.\build.bat --cmake_extra_defines onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=1
438+
```
439+
##### Set onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=2
440+
Dump tensor input/output shapes and output data for all nodes to stdout.
441+
```
442+
# Linux
443+
./build.sh --cmake_extra_defines onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=2
444+
# Windows
445+
.\build.bat --cmake_extra_defines onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=2
446+
```
447+
##### Set onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=0
448+
To disable this functionality after previously enabling, set onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=0 or delete CMakeCache.txt.
449+
450+
---
451+
427452
## Architectures
428453
### x86
429454
#### Build Intsructions

onnxruntime/core/framework/utils.cc

+2
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,8 @@ void DumpNodeOutputs(OpKernelContext& context, const Node& node, const SessionSt
646646
std::cout << " failed to transfer data to cpu.\n";
647647
}
648648
}
649+
#else
650+
ORT_UNUSED_PARAMETER(session_state);
649651
#endif
650652
}
651653
}

0 commit comments

Comments
 (0)