in astra-sim-alibabacloud/astra-sim/workload/Workload.cc [120:208]
void Workload::report() {
double total_compute = 0;
double total_exposed = 0;
// #ifdef ANALYTI
double pre_bubble_time = 0;
double DP_comm = 0;
double DP_EP_comm = 0;
double Expose_TP_comm = 0;
double Expose_EP_comm = 0;
// #endif
std::vector<double> total_fwd_time = {0, 0, 0};
std::vector<double> total_wg_time = {0, 0, 0};
std::vector<double> total_ig_time = {0, 0, 0};
AstraSimDataAPI astraSimDataAPI;
astraSimDataAPI.run_name = run_name;
astraSimDataAPI.workload_finished_time = ((double)Sys::boostedTick()) / FREQ;
std::cout<<"workload stats for the job scheduled at NPU offset: "
<<generator->npu_offset<<std::endl;
for (int i = 0; i < SIZE; i++) {
#ifdef ANALYTI
astraSimDataAPI.layers_stats.push_back(layers[i]->report(
run_name,
i,
total_rows,
stat_row,
detailed,
end_to_end,
total_compute,
total_exposed,
pre_bubble_time,
DP_comm,
DP_EP_comm,
Expose_TP_comm,
Expose_EP_comm,
this->seprate_log));
#else
astraSimDataAPI.layers_stats.push_back(layers[i]->report(
run_name,
i,
total_rows,
stat_row,
detailed,
end_to_end,
total_compute,
total_exposed,
this->seprate_log,
total_fwd_time,
total_wg_time,
total_ig_time,
pre_bubble_time,
DP_comm,
DP_EP_comm,
Expose_TP_comm,
Expose_EP_comm));
#endif
}
astraSimDataAPI.total_compute = total_compute;
astraSimDataAPI.total_exposed_comm = total_exposed;
astraSimDataAPI.avg_chunk_latency_per_logical_dimension =
generator->scheduler_unit->get_average_latency_per_dimension();
for (auto& latency :
astraSimDataAPI.avg_chunk_latency_per_logical_dimension) {
latency /= FREQ;
}
std::cout << "*************************" << std::endl;
std::cout << "all passes finished at time: " << Sys::boostedTick()
<< ", id of first layer: " << layers[0]->id << std::endl;
generator->NI->pass_front_end_report(astraSimDataAPI);
#ifdef NS3_MTP
if (this->seprate_log) {
std::list<std::list<std::pair<uint64_t, double>>> dims;
for (int i = 0; i < generator->scheduler_unit->usage.size(); i++) {
dims.push_back(
generator->scheduler_unit->usage[i].report_percentage(10000));
}
dimension_utilization->finalize_csv(dims);
}
#endif
#ifdef NS3_MPI
if (this->seprate_log) {
std::list<std::list<std::pair<uint64_t, double>>> dims;
for (int i = 0; i < generator->scheduler_unit->usage.size(); i++) {
dims.push_back(
generator->scheduler_unit->usage[i].report_percentage(10000));
}
dimension_utilization->finalize_csv(dims);
}
#endif
}