Skip to content

Commit

Permalink
Remove ancient XLA:TPU workaround
Browse files Browse the repository at this point in the history
We've supported S16 for a long time now

PiperOrigin-RevId: 573260447
  • Loading branch information
majnemer authored and jax authors committed Oct 13, 2023
1 parent 39a3cfc commit e088a8e
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions jax/_src/numpy/ufuncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,12 +477,6 @@ def signbit(x: ArrayLike, /) -> Array:
raise ValueError(
"jax.numpy.signbit is not well defined for %s" % dtype)

# TPU supports BF16 but not S16 types, so as a workaround, convert BF16 to
# F32.
if dtype == dtypes.bfloat16:
dtype = np.dtype('float32')
x = lax.convert_element_type(x, dtype)

info = dtypes.finfo(dtype)
if info.bits not in _INT_DTYPES:
raise NotImplementedError(
Expand Down

0 comments on commit e088a8e

Please sign in to comment.