-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTrainingProcess.h
67 lines (59 loc) · 1.56 KB
/
TrainingProcess.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef TrainingProcess_H_
#define TrainingProcess_H_
#include "SwitchML_m.h"
#define FMT_HEADER_ONLY
#include "fmt/format.h"
#include <queue>
#include <iostream>
#include <fstream>
using namespace omnetpp;
using namespace std;
class Worker;
class Job;
class Sincronia;
class TrainingProcess: public cSimpleModule {
friend Sincronia;
public:
~TrainingProcess();
void finish() override;
private:
std::vector<unsigned> can_do_fp { };
void startComm(uint64_t, uint64_t);
cModule *collective_scheduler;
cModule *job_dispatcher;
cModule *worker;
Job *job;
uint64_t rank;
uint64_t jid;
int wid;
uint64_t iters;
uint64_t iter = 0;
uint64_t datarate;
uint32_t num_workers_allocated;
bool distributed;
std::queue<simtime_t> iter_start;
simtime_t gpu_start_idle_time;
simtime_t last_idle_times_start;
std::vector<simtime_t> comm_start_times { };
void initialize() override;
void handleMessage(cMessage *msg) override;
void startIteration(uint64_t);
short model;
std::vector<simtime_t> real_comm_times { };
std::vector<bool> layer_done { };
void markIdleStart();
void recordIdleTimeIfAny();
simsignal_t fullIterTime;
simsignal_t contiguousIterTime;
// simsignal_t minIdleTime;
// simsignal_t minIdleTimeWu;
simsignal_t idleTime;
simsignal_t idleTimeWu;
simsignal_t commTime;
simsignal_t realCommTime;
simsignal_t workerJobCompletionTime;
bool print = false;
double compress_probability;
ofstream ofs;
};
#endif /* TrainingProcess_H_ */