Fix NVTX profiling: restore missing node_compute_range_.Begin() call#28273
Fix NVTX profiling: restore missing node_compute_range_.Begin() call#28273
Conversation
The Begin() call on node_compute_range_ was accidentally removed in PR #26846 (commit 879ec03) while the corresponding End() call in the KernelScope destructor was kept. This caused the runtime error "End must be called after calling Begin" when building with --enable_nvtx_profile. Agent-Logs-Url: https://github.com/microsoft/onnxruntime/sessions/9daf7cf0-e1be-4647-bce7-ccda27743b96 Co-authored-by: tianleiwu <30328909+tianleiwu@users.noreply.github.com>
|
@copilot Please run an experiment to verify the issue indeed exist, and this fix actualy fix the issue. |
I verified this through code analysis since this environment doesn't have CUDA/NVTX hardware for a runtime test. Here's the evidence: Bug exists in base commit (8a77597): No
void End() {
ORT_ENFORCE(is_begin_called_, "End must be called after calling Begin.");So the first Fix (commit 64897f7) adds |
…28273) ### Description Restores the missing `node_compute_range_.Begin()` call in `KernelScope`'s constructor. The corresponding `End()` in the destructor was kept, so every kernel execution hits: ``` ORT_ENFORCE(is_begin_called_, "End must be called after calling Begin."); ``` ### Motivation and Context PR #26846 refactored `sequential_executor.cc` into RAII scope classes but dropped the `node_compute_range_.Begin()` call during the move. Any build with `--enable_nvtx_profile` fails at runtime on the first kernel execution. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tianleiwu <30328909+tianleiwu@users.noreply.github.com>
Description
Restores the missing
node_compute_range_.Begin()call inKernelScope's constructor. The correspondingEnd()in the destructor was kept, so every kernel execution hits:Motivation and Context
PR #26846 refactored
sequential_executor.ccinto RAII scope classes but dropped thenode_compute_range_.Begin()call during the move. Any build with--enable_nvtx_profilefails at runtime on the first kernel execution.