Medial Code Documentation
|
Data Structures | |
class | Op |
class | RabitContext |
Functions | |
str | _deprecation_warning () |
None | init (Optional[List[bytes]] args=None) |
None | finalize () |
int | get_rank () |
int | get_world_size () |
int | is_distributed () |
None | tracker_print (Any msg) |
bytes | get_processor_name () |
T | broadcast (T data, int root) |
np.ndarray | allreduce (np.ndarray data, Op op, Optional[Callable[[np.ndarray], None]] prepare_fun=None) |
int | version_number () |
Variables | |
LOGGER = logging.getLogger("[xgboost.rabit]") | |
T = TypeVar("T") | |
Compatibility shim for xgboost.rabit; to be removed in 2.0
np.ndarray xgboost.rabit.allreduce | ( | np.ndarray | data, |
Op | op, | ||
Optional[Callable[[np.ndarray], None]] | prepare_fun = None |
||
) |
Perform allreduce, return the result. Parameters ---------- data : Input data. op : Reduction operators, can be MIN, MAX, SUM, BITOR prepare_fun : Lazy preprocessing function, if it is not None, prepare_fun(data) will be called by the function before performing allreduce, to initialize the data If the result of Allreduce can be recovered directly, then prepare_fun will NOT be called Returns ------- result : The result of allreduce, have same shape as data Notes ----- This function is not thread-safe.
T xgboost.rabit.broadcast | ( | T | data, |
int | root | ||
) |
Broadcast object from one node to all other nodes. Parameters ---------- data : any type that can be pickled Input data, if current rank does not equal root, this can be None root : int Rank of the node to broadcast data from. Returns ------- object : int the result of broadcast.
None xgboost.rabit.finalize | ( | ) |
Finalize the process, notify tracker everything is done.
bytes xgboost.rabit.get_processor_name | ( | ) |
Get the processor name. Returns ------- name : str the name of processor(host)
int xgboost.rabit.get_rank | ( | ) |
Get rank of current process. Returns ------- rank : int Rank of current process.
int xgboost.rabit.get_world_size | ( | ) |
Get total number workers. Returns ------- n : int Total number of process.
None xgboost.rabit.init | ( | Optional[List[bytes]] | args = None | ) |
Initialize the rabit library with arguments
int xgboost.rabit.is_distributed | ( | ) |
If rabit is distributed.
None xgboost.rabit.tracker_print | ( | Any | msg | ) |
Print message to the tracker. This function can be used to communicate the information of the progress to the tracker Parameters ---------- msg : str The message to be printed to tracker.
int xgboost.rabit.version_number | ( | ) |
Returns version number of current stored model. This means how many calls to CheckPoint we made so far. Returns ------- version : int Version number of currently stored model