SMAUG
Simulating Machine Learning Applications on gem5-Aladdin
|
Implements a pool of worker accelerators. More...
#include <smv_accel_pool.h>
Implements a pool of worker accelerators.
For operators that require work tiling, tiles can be distributed across multiple accelerators to exploit parallelism. This class implements a deterministic round-robin worker pool. Determinism is required because when generating multiple dynamic traces, worker accelerator assignments must match with simulation of the binary in gem5.
To use:
Definition at line 32 of file smv_accel_pool.h.
Public Member Functions | |
SmvAcceleratorPool (int _size) | |
void | addFinishFlag (int accelIdx, std::unique_ptr< volatile int > finishFlag) |
Add a finish flag for the specified accelerator. | |
void | joinAll () |
Wait until all the finish flags turn complete. | |
int | getNextAvailableAccelerator (int currAccelIdx) |
Get the next accelerator and wait if it's still busy. More... | |
Protected Member Functions | |
void | join (int accelIdx) |
Wait until this accelerator's finish flags turn complete. | |
Protected Attributes | |
int | size |
Number of accelerators in the pool. | |
std::vector< std::deque< std::unique_ptr< volatile int > > > | finishFlags |
Active finish flags for all the accelerators in the pool. | |
int smaug::SmvAcceleratorPool::getNextAvailableAccelerator | ( | int | currAccelIdx | ) |
Get the next accelerator and wait if it's still busy.
A round-robin scheduling policy is used for picking the accelerator. The simple static policy is used because the scheduling decisions need to be the same as when we generate the traces, whereas dynamic decisions that depend on runtime information may lead to mismatch between the traces and the simulation.
TODO(xyzsam): the pool should be able to keep track of the current accelerator index on its own.
Definition at line 39 of file smv_accel_pool.cpp.