From 839fb957173fcef0fc29dcd0f7efaab1a797a4b2 Mon Sep 17 00:00:00 2001 From: SaleelK Date: Thu, 23 Oct 2025 22:05:00 -0700 Subject: [PATCH] clr: Do not increase signal pool (#1354) * Do not increase signal pool when profiling, instead allow saving off timestamps. This is slow but a tradeoff to memory footprint of the signals --- projects/clr/rocclr/device/rocm/rocvirtual.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/projects/clr/rocclr/device/rocm/rocvirtual.cpp b/projects/clr/rocclr/device/rocm/rocvirtual.cpp index f3e577ab28..85f7e453cc 100644 --- a/projects/clr/rocclr/device/rocm/rocvirtual.cpp +++ b/projects/clr/rocclr/device/rocm/rocvirtual.cpp @@ -442,10 +442,8 @@ hsa_signal_t VirtualGPU::HwQueueTracker::ActiveSignal(hsa_signal_value_t init_va // Peep signal +2 ahead to see if its done auto temp_id = (current_id_ + 2) % signal_list_.size(); - // If GPU is still busy with processing or if timestamps havent been saved out, - // then add more signals to avoid more frequent stalls - if (Hsa::signal_load_relaxed(signal_list_[temp_id]->signal_) > 0 || - !signal_list_[temp_id]->flags_.done_) { + // If GPU is still busy with processing, then add more signals to avoid more frequent stalls + if (Hsa::signal_load_relaxed(signal_list_[temp_id]->signal_) > 0) { std::unique_ptr signal(new ProfilingSignal()); if ((signal != nullptr) && CreateSignal(signal.get())) { // Find valid new index @@ -464,7 +462,6 @@ hsa_signal_t VirtualGPU::HwQueueTracker::ActiveSignal(hsa_signal_value_t init_va // Make sure the previous operation on the current signal is done WaitCurrent(); - size_t next = (current_id_ + 1) % signal_list_.size(); // Have to wait the next signal in the queue to avoid a race condition between // a GPU waiter(which may be not triggered yet) and CPU signal reset below WaitNext();