Medial Code Documentation
Loading...
Searching...
No Matches
Data Structures | Functions | Variables
xgboost.rabit Namespace Reference

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 ()
 
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")
 

Detailed Description

Compatibility shim for xgboost.rabit; to be removed in 2.0

Function Documentation

◆ allreduce()

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.

◆ broadcast()

T xgboost.rabit.broadcast ( 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.

◆ finalize()

None xgboost.rabit.finalize ( )
Finalize the process, notify tracker everything is done.

◆ get_processor_name()

bytes xgboost.rabit.get_processor_name ( )
Get the processor name.
Returns
-------
name : str
    the name of processor(host)

◆ get_rank()

int xgboost.rabit.get_rank ( )
Get rank of current process.
Returns
-------
rank : int
    Rank of current process.

◆ get_world_size()

int xgboost.rabit.get_world_size ( )
Get total number workers.
Returns
-------
n : int
    Total number of process.

◆ init()

None xgboost.rabit.init ( Optional[List[bytes]]   args = None)
Initialize the rabit library with arguments

◆ is_distributed()

int xgboost.rabit.is_distributed ( )
If rabit is distributed.

◆ tracker_print()

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.

◆ version_number()

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