Validate parameters in distributed environments.
(kwargs: Dict[str, Any])
| 132 | |
| 133 | |
| 134 | def _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 | |
| 156 | def _validate_feature_info( |
no test coverage detected