clr: Use graph segment scheduling to process HIP Graphs (#1372)

* clr: Use graph segment scheduling to process HIP Graphs

* Add a broader path to use capture packet capture for all topologies
* Refactor code
* Use DEBUG_HIP_GRAPH_SEGMENT_SCHEDULING to toggle new vs classic path,
  Enabled by default

* clr: Few fixes and improvements

* clr: Detect complex graphs to take classic path

* Use DEBUG_HIP_GRAPH_SEGMENT_SCHEDULING=2 to force segment scheduling
  path

* clr: Fix a cornercase stack corruption

* clr: Track commands of segments instead of snapshots

* clr: Fix Batch dispatch logic

* Track fence_dirty_ flag for command of other streams
* Dependency resolution markers can now accomodate dirty fence on cross
  streams

---------

Co-authored-by: Ioannis Assiouras <Ioannis.Assiouras@amd.com>
Co-authored-by: Godavarthy Surya, Anusha <agodavar@amd.com>
Tá an tiomantas seo le fáil i:
SaleelK
2025-12-01 12:49:26 -08:00
tiomanta ag GitHub
tuismitheoir a627c12501
tiomantas c105dcd05b
D'athraigh 11 comhad le 1563 breiseanna agus 507 scriosta
+9 -1
Féach ar an gComhad
@@ -1383,6 +1383,7 @@ class AccumulateCommand : public Command {
private:
//! Kernel names and timestamps list for activity profiling
std::vector<std::string> kernelNames_;
const std::vector<std::string>* kernelNamesRef_ = nullptr;
std::vector<std::pair<uint64_t, uint64_t>> tsList_;
public:
@@ -1399,13 +1400,20 @@ class AccumulateCommand : public Command {
kernelNames_.insert(kernelNames_.end(), kernelNames.begin(), kernelNames.end());
}
//! Set kernel names by reference
void setKernelNamesRef(const std::vector<std::string>* kernelNames) {
kernelNamesRef_ = kernelNames;
}
//! Add kernel timestamp to the list if available
void addTimestamps(uint64_t startTs, uint64_t endTs) {
tsList_.push_back(std::make_pair(startTs, endTs));
}
//! Return the kernel names
const std::vector<std::string>& getKernelNames() const { return kernelNames_; }
const std::vector<std::string>& getKernelNames() const {
return kernelNamesRef_ != nullptr ? *kernelNamesRef_ : kernelNames_;
}
//! Return the kernel timestamps
const std::vector<std::pair<uint64_t, uint64_t>>& getTimestamps() const { return tsList_; }