even better more structured throughput scheduling
Validate Operations / validate-operations (push) Has been cancelled
Validate Operations / validate-operations (push) Has been cancelled
plot adjustments validation adjustments
This commit is contained in:
@@ -47,6 +47,27 @@ static std::string binary(const std::vector<pim_binary::InstructionRecord> &reco
|
||||
return result;
|
||||
}
|
||||
|
||||
static void testSearchGuidance(PimInstructionTiming target) {
|
||||
PimExecutionProgram program{{{E::Work, 29}, {E::Load, 65}}};
|
||||
PimPeriodicOptions options;
|
||||
options.verifyPeriodicState = true;
|
||||
auto plain = evaluatePimExecution(program, target, options);
|
||||
options.searchGuidance = true;
|
||||
auto guided = evaluatePimExecution(program, target, options);
|
||||
TEST_CHECK(plain.cost.primary == guided.cost.primary);
|
||||
TEST_CHECK(plain.cost.alternative == guided.cost.alternative);
|
||||
TEST_CHECK(plain.cost.convergenceProved() == guided.cost.convergenceProved());
|
||||
TEST_CHECK(guided.cost.processorTaskWorkNs.size() == target.processorCount);
|
||||
TEST_CHECK(guided.cost.processorTaskWorkNs.front() == 29);
|
||||
TEST_CHECK(guided.cost.processorCriticalDelayNs.size() == target.processorCount);
|
||||
TEST_CHECK(guided.cost.processorCriticalDelayNs.front() > 0);
|
||||
program.front()[1].constant = true;
|
||||
auto constants = evaluatePimExecution(program, target, options);
|
||||
TEST_CHECK(constants.cost.primary == plain.cost.primary);
|
||||
TEST_CHECK(constants.cost.alternative == plain.cost.alternative);
|
||||
TEST_CHECK(constants.cost.processorTaskWorkNs.front() > 29);
|
||||
}
|
||||
|
||||
static void testTypedResult(PimInstructionTiming target) {
|
||||
PimPeriodicOptions options;
|
||||
options.verifyPeriodicState = true;
|
||||
@@ -496,10 +517,14 @@ static void testReadOnlySpatial(PimInstructionTiming target, bool batched) {
|
||||
TEST_CHECK((*classes)[E::LocalCopy].getAsInteger() == 0);
|
||||
TEST_CHECK((*classes)[E::ScalarIssue].getAsInteger() == 0);
|
||||
TEST_CHECK(totalWork == report.getInteger("compute_and_local_work_ns"));
|
||||
auto softmax = spatial::SpatSoftmaxOp::create(builder, loc, type, input);
|
||||
auto softmax = spatial::SpatSoftmaxOp::create(builder, loc, type, local);
|
||||
auto secondSoftmax = spatial::SpatSoftmaxOp::create(builder, loc, type, softmax.getOutput());
|
||||
TEST_CHECK(succeeded(verify(module)));
|
||||
TEST_CHECK(analyzePimSpatialSchedule(module, target, spatialDetails()).getString("status") == "unavailable");
|
||||
softmax.erase();
|
||||
auto softmaxReport = analyzePimSpatialSchedule(module, target, spatialDetails());
|
||||
TEST_CHECK(softmaxReport.getString("status") == "estimated");
|
||||
TEST_CHECK(softmaxReport.getInteger("compute_and_local_work_ns") == totalWork);
|
||||
TEST_CHECK(softmaxReport.getInteger("global_read_requests") == report.getInteger("global_read_requests"));
|
||||
secondSoftmax.erase(); softmax.erase();
|
||||
source = tensor::EmptyOp::create(builder, loc, ArrayRef<int64_t>{1, 0, 1, 224}, builder.getF32Type());
|
||||
destination = tensor::EmptyOp::create(builder, loc, ArrayRef<int64_t>{1, 1, 224, 0}, builder.getF32Type());
|
||||
linalg::TransposeOp::create(builder, loc, source, destination, ArrayRef<int64_t>{0, 2, 3, 1});
|
||||
@@ -623,6 +648,40 @@ static void testPublicationAndOutput(PimInstructionTiming target) {
|
||||
TEST_CHECK((*(*runs)[0].getAsArray())[1].getAsInteger() == 60);
|
||||
TEST_CHECK((*(*runs)[1].getAsArray())[1].getAsInteger() == 5);
|
||||
TEST_CHECK((*(*runs)[1].getAsArray())[2].getAsInteger() == 4);
|
||||
|
||||
// Ablation removes standalone and fused synchronization, not host accesses.
|
||||
builder.setInsertionPoint(compute.getBody().front().getTerminator());
|
||||
Value readerId = arith::ConstantIndexOp::create(builder, loc, 1);
|
||||
Value eventRegister = arith::ConstantIndexOp::create(builder, loc, 2);
|
||||
spatial::SpatSyncOp::create(builder, loc, readerId, eventRegister);
|
||||
builder.setInsertionPoint(reader.getBody().front().getTerminator());
|
||||
eventRegister = arith::ConstantIndexOp::create(builder, loc, 2);
|
||||
spatial::SpatHostWaitLoadOp::create(builder, loc, slice.getType(),
|
||||
zero, one, zero, eventRegister, one);
|
||||
TEST_CHECK(succeeded(verify(module)));
|
||||
PimExecutionProgram reference, omitted;
|
||||
auto options = spatialDetails();
|
||||
options.executionTrace = &reference;
|
||||
auto synchronized = evaluatePimSpatialSchedule(module, target, options);
|
||||
TEST_CHECK(synchronized.cost.available());
|
||||
options.omitSynchronization = true;
|
||||
options.executionTrace = &omitted;
|
||||
auto ablation = evaluatePimSpatialSchedule(module, target, options);
|
||||
TEST_CHECK(ablation.cost.available());
|
||||
TEST_CHECK(ablation.report.getObject("event_counts")->getInteger("sync") == 0);
|
||||
TEST_CHECK(ablation.report.getObject("event_counts")->getInteger("wait") == 0);
|
||||
for (const char *metric : {"global_read_requests", "global_read_bytes",
|
||||
"global_write_requests", "global_write_bytes", "global_memory_service_ns"})
|
||||
TEST_CHECK(ablation.report.getInteger(metric) == synchronized.report.getInteger(metric));
|
||||
for (auto &sequence : reference)
|
||||
llvm::erase_if(sequence, [](const E &event) { return event.kind == E::Signal || event.kind == E::Wait; });
|
||||
for (const auto &sequence : omitted)
|
||||
for (const E &event : sequence)
|
||||
TEST_CHECK(event.kind != E::Signal && event.kind != E::Wait);
|
||||
options.executionTrace = nullptr;
|
||||
auto expected = evaluatePimExecution(reference, target, options);
|
||||
TEST_CHECK(ablation.cost.primary == expected.cost.primary);
|
||||
TEST_CHECK(ablation.cost.alternative == expected.cost.alternative);
|
||||
module.erase();
|
||||
}
|
||||
|
||||
@@ -850,6 +909,7 @@ int main() {
|
||||
for (int64_t period : {1, 5}) {
|
||||
testLateRecurrenceAuthority(hardware(period));
|
||||
testTypedResult(hardware(period));
|
||||
testSearchGuidance(hardware(period));
|
||||
testSharedEngine(hardware(period));
|
||||
testAccountingAndOverflow(hardware(period));
|
||||
testMatrixGeometry(hardware(period));
|
||||
|
||||
Reference in New Issue
Block a user