Skip to content

Commit

Permalink
[backport] Handle float128 generically (dmlc#10322)
Browse files Browse the repository at this point in the history
  • Loading branch information
hcho3 authored and trivialfis committed May 30, 2024
1 parent bc6c993 commit 1e7ed7d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python-package/xgboost/collective.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import logging
import os
import pickle
import platform
from enum import IntEnum, unique
from typing import Any, Dict, List, Optional

Expand Down Expand Up @@ -184,8 +183,10 @@ def _map_dtype(dtype: np.dtype) -> int:
np.dtype("uint32"): 10,
np.dtype("uint64"): 11,
}
if platform.system() != "Windows":
try:
dtype_map.update({np.dtype("float128"): 3})
except TypeError: # float128 doesn't exist on the system
pass

if dtype not in dtype_map:
raise TypeError(f"data type {dtype} is not supported on the current platform.")
Expand Down

0 comments on commit 1e7ed7d

Please sign in to comment.