MCPcopy Create free account
hub / github.com/dmlc/xgboost / _check_distributed_params

Function _check_distributed_params

python-package/xgboost/core.py:134–153  ·  view source on GitHub ↗

Validate parameters in distributed environments.

(kwargs: Dict[str, Any])

Source from the content-addressed store, hash-verified

132
133
134def _check_distributed_params(kwargs: Dict[str, Any]) -> None:
135 """Validate parameters in distributed environments."""
136 device = kwargs.get("device", None)
137 if device and not isinstance(device, str):
138 msg = "Invalid type for the `device` parameter"
139 msg += _expect((str,), type(device))
140 raise TypeError(msg)
141
142 if device and device.find(":") != -1:
143 if device != "sycl:gpu":
144 raise ValueError(
145 "Distributed training doesn't support selecting device ordinal as GPUs"
146 " are managed by the distributed frameworks. use `device=cuda` or"
147 " `device=gpu` instead."
148 )
149
150 if kwargs.get("booster", None) == "gblinear":
151 raise NotImplementedError(
152 f"booster `{kwargs['booster']}` is not supported for distributed training."
153 )
154
155
156def _validate_feature_info(

Callers 3

_train_asyncFunction · 0.85
set_deviceMethod · 0.85
setParamsMethod · 0.85

Calls 2

_expectFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected