Skip to content

Commit 2b1c0bb

Browse files
bcheng0127igcbot
authored andcommitted
Adjust the preRA schedule heuristic
The heuristic are experience based, but using the same threshold for scheduling the beneifit comparision should be a always choice.
1 parent 66db8a8 commit 2b1c0bb

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

visa/LocalScheduler/G4_Sched.cpp

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,14 +1694,19 @@ bool BB_Scheduler::scheduleBlockForLatency(unsigned &MaxPressure,
16941694
unsigned Thresholds[] = {144, 128, 112, 104, 96};
16951695
unsigned Iterations = 5;
16961696
float Ratio = (std::max(NumGrfs, 128u) - 48u) / 80.0f;
1697-
// limit the iterative approach to certain platforms for now
1698-
if (config.DoNotIterate) {
1699-
Thresholds[0] = getLatencyHidingThreshold(kernel, NumGrfs);
1700-
Iterations = 1;
1701-
Ratio = 1.0f; // already adjusted inside getLatencyHidingThreshold
1702-
}
1703-
for (unsigned i = 0; i < Iterations; ++i) {
1704-
auto GroupingThreshold = Thresholds[i];
1697+
1698+
// the last iteration uses the threshold from getLatencyHidingThreshold
1699+
for (unsigned i = 0; i < Iterations + 1; ++i) {
1700+
unsigned GroupingThreshold = 0;
1701+
if (i == Iterations) {
1702+
GroupingThreshold = getLatencyHidingThreshold(kernel, NumGrfs);
1703+
if (GroupingThreshold * 1.0 > Thresholds[i - 1] * Ratio) {
1704+
break;
1705+
}
1706+
Ratio = 1.0f; // already adjusted inside getLatencyHidingThreshold
1707+
} else {
1708+
GroupingThreshold = Thresholds[i];
1709+
}
17051710
ddd.reset(ReassignID);
17061711
ReassignID = false; // only reassign inst-local-id at most once
17071712
LatencyScheduling(unsigned(GroupingThreshold * Ratio));

0 commit comments

Comments
 (0)