Float16 squashing preprocessing maps extreme outliers to zero
Author: aniruddhaadak80Created Sep 25, 2026Updated Sep 28, 2026
Labelstriaged
Describe the bug
Forced float16 GPU preprocessing can turn finite extreme outliers into zero during TorchSquashingScaler soft clipping. The square in the transform is evaluated in float16, overflows to infinity, and the subsequent division returns zero instead of the clipped value.
Steps/Code to Reproduce
import torch
from tabpfn.preprocessing.torch import TorchSquashingScaler
x = torch.tensor(
[0, 1, 1, 1, 2, 1000],
dtype=torch.float16,
).unsqueeze(-1)
out = TorchSquashingScaler()(x, num_train_rows=5)
print(out[-1, 0])Expected Results
The output remains float16 and the final value is close to 3.0, the finite soft-clipped result.
Actual Results
The final value is 0.0 because the intermediate square overflows float16 to infinity.
Versions
TabPFN 9.0.0 / current main; CUDA device with float16 inference enabled.
Source: PriorLabs/TabPFN