This commit is contained in:
@@ -56,12 +56,10 @@ struct WindowScheduleResult {
|
||||
size_t maxMergeGroupSize = 0;
|
||||
};
|
||||
|
||||
constexpr CPU kDefaultMaxCpuCount = 1000;
|
||||
|
||||
size_t getSchedulingCpuBudget() {
|
||||
if (coresCount.getValue() > 0)
|
||||
return static_cast<size_t>(coresCount.getValue());
|
||||
return static_cast<size_t>(kDefaultMaxCpuCount);
|
||||
return std::numeric_limits<size_t>::max();
|
||||
}
|
||||
|
||||
size_t getBatchChunkTargetCount(int32_t laneCount) {
|
||||
|
||||
@@ -54,10 +54,9 @@ struct ProducerValueRef {
|
||||
std::optional<ProducerValueRef> getProducerValueRef(Value value);
|
||||
|
||||
static size_t getFastPathCpuBudget() {
|
||||
constexpr size_t kDefaultMaxCpuCount = 1000;
|
||||
if (coresCount.getValue() > 0)
|
||||
return static_cast<size_t>(coresCount.getValue());
|
||||
return kDefaultMaxCpuCount;
|
||||
return std::numeric_limits<size_t>::max();
|
||||
}
|
||||
|
||||
static size_t getBatchChunkTargetCount(int32_t laneCount) {
|
||||
@@ -670,6 +669,9 @@ void rebatchEquivalentComputes(func::FuncOp funcOp, int64_t& nextChannelId) {
|
||||
continue;
|
||||
|
||||
SmallVector<SpatCompute> group {anchor};
|
||||
llvm::SmallDenseSet<int32_t, 8> usedCoreIds;
|
||||
if (auto coreId = getComputeCoreId(anchor))
|
||||
usedCoreIds.insert(*coreId);
|
||||
if (!anchor.getResults().empty())
|
||||
continue;
|
||||
for (size_t candidateIndex = index + 1; candidateIndex < computes.size(); ++candidateIndex) {
|
||||
@@ -680,8 +682,14 @@ void rebatchEquivalentComputes(func::FuncOp funcOp, int64_t& nextChannelId) {
|
||||
continue;
|
||||
if (!candidate.getResults().empty())
|
||||
continue;
|
||||
if (areEquivalentForRebatch(anchor, candidate))
|
||||
group.push_back(candidate);
|
||||
if (!areEquivalentForRebatch(anchor, candidate))
|
||||
continue;
|
||||
|
||||
if (auto coreId = getComputeCoreId(candidate))
|
||||
if (!usedCoreIds.insert(*coreId).second)
|
||||
continue;
|
||||
|
||||
group.push_back(candidate);
|
||||
}
|
||||
|
||||
if (group.size() <= 1)
|
||||
|
||||
Reference in New Issue
Block a user