IntelĀ® Machine Learning Scaling Library
2018
A library providing an efficient implementation of communication patterns used in deep learning.
|
A singleton object that holds global Intel MLSL functions. More...
#include <mlsl.hpp>
Public Member Functions | |
void | Configure (const char *config=NULL) |
void | Init (int *argc, char **argv[]) |
void | Finalize () |
bool | IsInitialized () |
size_t | GetProcessIdx () |
size_t | GetProcessCount () |
Session * | CreateSession (PhaseType phaseType=PT_TRAIN) |
void | DeleteSession (Session *session) |
Distribution * | CreateDistribution (size_t dataPartitions, size_t modelPartitions) |
Distribution * | CreateDistributionWithColors (int dataColor, int modelColor) |
void | DeleteDistribution (Distribution *distribution) |
void | Wait (CommReq *req) |
void | Test (CommReq *req, bool *isCompleted) |
void * | Alloc (size_t size, size_t alignment) |
void | Free (void *ptr) |
void | SetQuantizationParams (QuantParams *params) |
QuantParams * | GetQuantizationParams () |
Static Public Member Functions | |
static Environment & | GetEnv () |
static int | GetVersion () |
A singleton object that holds global Intel MLSL functions.
void* MLSL::Environment::Alloc | ( | size_t | size, |
size_t | alignment | ||
) |
Intel MLSL specific allocation function. Should be used to allocate communication buffers. Allocates size bytes and returns a pointer to the allocated memory. The memory address will be a multiple of alignment, which must be a power of two.
size | the number of bytes to allocate |
alignment | the return pointer alignment |
void MLSL::Environment::Configure | ( | const char * | config = NULL | ) |
An optional method to allow passing configuration information e.g. configuration file name.
For the MPI backend this may be NULL, but may be handy for the gRPC or ZMQ implementation.
config | a configuration string or the path to a configuration file (optional) |
Distribution* MLSL::Environment::CreateDistribution | ( | size_t | dataPartitions, |
size_t | modelPartitions | ||
) |
Creates a new Distribution object.
dataPartitions | the number of partitions for data (partitions on global mini-batch) |
modelPartitions | the number of partitions for model (partitions on input activation) |
Distribution* MLSL::Environment::CreateDistributionWithColors | ( | int | dataColor, |
int | modelColor | ||
) |
Creates a new Distribution object based on process colors passed. Don't use this method unless you absolutely need it.
dataColor | defines partitions on global mini-batch. Processes with the same dataColor get into the same data group |
modelColor | defines partitions on input activation. Processes with the same modelColor get into the same model group |
Creates a new Session object.
phaseType | the phase type (optional), can be used for internal optimizations |
void MLSL::Environment::DeleteDistribution | ( | Distribution * | distribution | ) |
Deletes the previously created Distribution object.
distribution | the distribution to delete |
void MLSL::Environment::DeleteSession | ( | Session * | session | ) |
Deletes the previously created Session object.
session | the session to delete |
void MLSL::Environment::Finalize | ( | ) |
Finalizes the library, cleans up and frees all the internally allocated memory.
void MLSL::Environment::Free | ( | void * | ptr | ) |
Intel MLSL specific deallocation function. Frees the memory that was previously allocated with Alloc().
ptr | the pointer to the memory to be deallocated |
|
static |
size_t MLSL::Environment::GetProcessCount | ( | ) |
size_t MLSL::Environment::GetProcessIdx | ( | ) |
QuantParams* MLSL::Environment::GetQuantizationParams | ( | ) |
|
static |
void MLSL::Environment::Init | ( | int * | argc, |
char ** | argv[] | ||
) |
Initializes the library. Must precede any other library calls (except static methods of the Environment class).
argc | a pointer to the number of arguments |
argv | an argument vector |
bool MLSL::Environment::IsInitialized | ( | ) |
void MLSL::Environment::SetQuantizationParams | ( | QuantParams * | params | ) |
Sets quantization parameters. Quantization parameters must be set before calling OperationRegInfo::AddParameterSet() with quantization enabled.
params | the data structure containing information about the quantization library |
void MLSL::Environment::Test | ( | CommReq * | req, |
bool * | isCompleted | ||
) |
Tests for completion of a communication request.
req | the communication request |
isCompleted | the completion status of the request, true if request is completed, false otherwise |
void MLSL::Environment::Wait | ( | CommReq * | req | ) |
Waits for a communication request to complete.
req | the communication request |