SG++-Doxygen-Documentation
|
#include <RoundRobinScheduler.hpp>
Public Member Functions | |
void | assignTaskStaticTaskSize (TaskType taskType, AssignTaskResult &result) override |
Assign a task of static size to the next worker in the queue. More... | |
void | assignTaskVariableTaskSize (TaskType taskType, AssignTaskResult &result) override |
Assign a task of variable size equal to the batch size to the next worker in the queue. More... | |
bool | isReadyForRefinement () override |
Check whether the master can start to refine. More... | |
void | onMergeRequestIncoming (size_t batchOffset, size_t batchSize, size_t remoteGridVersion, size_t localGridVersion) override |
Update the number of outstanding requests when a request is completed by a worker. More... | |
void | onRefinementStarted () override |
Move the number of current outstanding requests into the number of previous outstanding requests. More... | |
RoundRobinScheduler (size_t batchSize) | |
Create a Round-Robin-Scheduler that will distribute tasks to all workers fairly with specified batch size. More... | |
Public Member Functions inherited from sgpp::datadriven::MPITaskScheduler | |
void | setLearnerInstance (LearnerSGDEOnOffParallel *instance) |
Set the learner instance for which to task schedule. More... | |
virtual | ~MPITaskScheduler ()=default |
Default destructor to override if necessary. More... | |
Protected Attributes | |
size_t | batchSize |
The batch size to use for all workers. More... | |
unsigned int | lastWorkerID |
Keeps track of the last worker that had work assigned to it. More... | |
size_t | numOutstandingRequestsCurrentRefinement |
Track how many outstanding requests (batch*class) are pending for the current refinement cycle. More... | |
size_t | numOutstandingRequestsLastRefinement |
Track how many outstanding requests (batch*class) are pending for the previous refinement cycle. More... | |
Protected Attributes inherited from sgpp::datadriven::MPITaskScheduler | |
LearnerSGDEOnOffParallel * | learnerInstance {} |
The learner instance used to interrogate system state if necessary. More... | |
|
explicit |
Create a Round-Robin-Scheduler that will distribute tasks to all workers fairly with specified batch size.
batchSize | The size of one training batch to distribute. |
References batchSize, lastWorkerID, sgpp::datadriven::MPITaskScheduler::learnerInstance, numOutstandingRequestsCurrentRefinement, and numOutstandingRequestsLastRefinement.
|
overridevirtual |
Assign a task of static size to the next worker in the queue.
taskType | Type of task to assign to a worker. |
result | The result of determining assignment. |
Implements sgpp::datadriven::MPITaskScheduler.
References sgpp::datadriven::LearnerSGDEOnOffParallel::getNumClasses(), sgpp::datadriven::MPIMethods::getWorldSize(), lastWorkerID, sgpp::datadriven::MPITaskScheduler::learnerInstance, numOutstandingRequestsCurrentRefinement, sgpp::datadriven::TRAIN_FROM_BATCH, and sgpp::datadriven::AssignTaskResult::workerID.
Referenced by assignTaskVariableTaskSize().
|
overridevirtual |
Assign a task of variable size equal to the batch size to the next worker in the queue.
taskType | Type of task to assign to a worker. |
result | The result of determining assignment. |
Implements sgpp::datadriven::MPITaskScheduler.
References assignTaskStaticTaskSize(), batchSize, and sgpp::datadriven::AssignTaskResult::taskSize.
|
overridevirtual |
Check whether the master can start to refine.
This can only happen if all requests from one cycle ago have successfully completed.
Implements sgpp::datadriven::MPITaskScheduler.
References numOutstandingRequestsLastRefinement.
|
overridevirtual |
Update the number of outstanding requests when a request is completed by a worker.
The difference in grid versions is used to determine whether to update the current number of outstanding requests or the previous number of outstanding requests.
batchOffset | Not used. |
batchSize | Not used. |
remoteGridVersion | The grid version that was used to train the batch. |
localGridVersion | The current grid version on the master. |
Implements sgpp::datadriven::MPITaskScheduler.
References numOutstandingRequestsCurrentRefinement, and numOutstandingRequestsLastRefinement.
|
overridevirtual |
Move the number of current outstanding requests into the number of previous outstanding requests.
Implements sgpp::datadriven::MPITaskScheduler.
References numOutstandingRequestsCurrentRefinement, and numOutstandingRequestsLastRefinement.
|
protected |
The batch size to use for all workers.
Referenced by assignTaskVariableTaskSize(), and RoundRobinScheduler().
|
protected |
Keeps track of the last worker that had work assigned to it.
The next assignment will go to a worker with an index of one higher.
Referenced by assignTaskStaticTaskSize(), and RoundRobinScheduler().
|
protected |
Track how many outstanding requests (batch*class) are pending for the current refinement cycle.
Referenced by assignTaskStaticTaskSize(), onMergeRequestIncoming(), onRefinementStarted(), and RoundRobinScheduler().
|
protected |
Track how many outstanding requests (batch*class) are pending for the previous refinement cycle.
Referenced by isReadyForRefinement(), onMergeRequestIncoming(), onRefinementStarted(), and RoundRobinScheduler().