This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/ADT/DenseSet.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/ADT/SetVector.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
@@ -122,9 +122,8 @@ void emitMergeIrCounts(StringRef phaseName, func::FuncOp funcOp) {
|
||||
llvm::errs() << "[merge-profile] " << phaseName << " counts:"
|
||||
<< " compute=" << counts.topLevelComputeCount << " compute_batch=" << counts.topLevelComputeBatchCount
|
||||
<< " scalar_send=" << counts.scalarChannelSendCount
|
||||
<< " scalar_recv=" << counts.scalarChannelReceiveCount
|
||||
<< " wvmm=" << counts.wvmmCount << " vadd=" << counts.vaddCount
|
||||
<< " scf_for=" << counts.scfForCount << "\n";
|
||||
<< " scalar_recv=" << counts.scalarChannelReceiveCount << " wvmm=" << counts.wvmmCount
|
||||
<< " vadd=" << counts.vaddCount << " scf_for=" << counts.scfForCount << "\n";
|
||||
}
|
||||
|
||||
static std::optional<int32_t> getComputeCoreId(SpatCompute compute) {
|
||||
@@ -514,7 +513,8 @@ void generateReport(func::FuncOp funcOp, const std::string& name, size_t usedCpu
|
||||
SmallVector<int32_t> coreIds;
|
||||
if (auto coreIdsAttr = batch->getAttrOfType<DenseI32ArrayAttr>(onnx_mlir::kCoreIdsAttrName))
|
||||
llvm::append_range(coreIds, coreIdsAttr.asArrayRef());
|
||||
collectedData.push_back({nextBatchId++, logicalCount, perInstanceCrossbarCount * logicalCount, numInst, true, coreIds});
|
||||
collectedData.push_back(
|
||||
{nextBatchId++, logicalCount, perInstanceCrossbarCount * logicalCount, numInst, true, coreIds});
|
||||
totalComputeOps += 1;
|
||||
totalLogicalComputes += logicalCount;
|
||||
totalBatchComputeOps += 1;
|
||||
|
||||
@@ -206,10 +206,8 @@ static FailureOr<int64_t> evaluateIndexLike(OpFoldResult value,
|
||||
return evaluateIndexLike(llvm::cast<Value>(value), bindings, lane, laneArg);
|
||||
}
|
||||
|
||||
static FailureOr<int64_t> evaluateIndexLike(Value value,
|
||||
const DenseMap<Value, int64_t>& bindings,
|
||||
std::optional<uint32_t> lane,
|
||||
Value laneArg) {
|
||||
static FailureOr<int64_t>
|
||||
evaluateIndexLike(Value value, const DenseMap<Value, int64_t>& bindings, std::optional<uint32_t> lane, Value laneArg) {
|
||||
if (lane && value == laneArg)
|
||||
return *lane;
|
||||
if (auto it = bindings.find(value); it != bindings.end())
|
||||
@@ -260,11 +258,10 @@ static FailureOr<int64_t> evaluateIndexLike(Value value,
|
||||
return evaluateAffineExpr(map.getResult(0), dims, symbols);
|
||||
}
|
||||
|
||||
static FailureOr<SmallVector<int64_t, 4>>
|
||||
evaluateIndexList(ArrayRef<OpFoldResult> values,
|
||||
const DenseMap<Value, int64_t>& bindings,
|
||||
std::optional<uint32_t> lane,
|
||||
Value laneArg) {
|
||||
static FailureOr<SmallVector<int64_t, 4>> evaluateIndexList(ArrayRef<OpFoldResult> values,
|
||||
const DenseMap<Value, int64_t>& bindings,
|
||||
std::optional<uint32_t> lane,
|
||||
Value laneArg) {
|
||||
SmallVector<int64_t, 4> result;
|
||||
result.reserve(values.size());
|
||||
for (OpFoldResult value : values) {
|
||||
@@ -308,12 +305,11 @@ static CrossbarWeight completeCrossbarWeight(Value root,
|
||||
return weight;
|
||||
}
|
||||
|
||||
static FailureOr<CrossbarWeight>
|
||||
getStaticCrossbarWeight(Operation* owner,
|
||||
Value value,
|
||||
const DenseMap<Value, int64_t>& bindings,
|
||||
std::optional<uint32_t> lane,
|
||||
Value laneArg) {
|
||||
static FailureOr<CrossbarWeight> getStaticCrossbarWeight(Operation* owner,
|
||||
Value value,
|
||||
const DenseMap<Value, int64_t>& bindings,
|
||||
std::optional<uint32_t> lane,
|
||||
Value laneArg) {
|
||||
if (auto extract = value.getDefiningOp<tensor::ExtractSliceOp>()) {
|
||||
FailureOr<CrossbarWeight> sourceWeight =
|
||||
getStaticCrossbarWeight(owner, extract.getSource(), bindings, lane, laneArg);
|
||||
|
||||
@@ -19,7 +19,6 @@ using CPU = int;
|
||||
using Cost = unsigned long long;
|
||||
using Time = unsigned long long;
|
||||
|
||||
|
||||
template <typename T>
|
||||
inline T checkedAdd(T lhs, T rhs) {
|
||||
static_assert(std::is_unsigned_v<T>, "checkedAdd only supports unsigned types");
|
||||
|
||||
Reference in New Issue
Block a user