Skip to content

Commit

Permalink
[backport] Handle float128 generically (#10322) (#10348)
Browse files Browse the repository at this point in the history
Co-authored-by: Philip Hyunsu Cho <chohyu01@cs.washington.edu>
  • Loading branch information
trivialfis and hcho3 authored May 30, 2024
1 parent bc6c993 commit 8c36c6d
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 8c36c6d

Please sign in to comment.