-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Description
🐛 Describe the bug
rshift is not working on MPS for unit8, it gives the wrong result. It works for int32, uint8 is used throughout GGUF for quantisation which is getting more and more important.
>>> import torch
>>> x = torch.Tensor([255]).to(torch.uint8)
>>> print (x)
tensor([255], dtype=torch.uint8)
>>> x >> 4
tensor([15], dtype=torch.uint8)
>>>
>>> print (x)
tensor([255], dtype=torch.uint8)
>>> y = x.to('mps')
>>> print (y)
tensor([255], device='mps:0', dtype=torch.uint8)
>>>
>>> y >> 4
tensor([255], device='mps:0', dtype=torch.uint8)
Note int32 works
x = torch.Tensor([255]).to(torch.int32)
y = x.to('mps')
y >> 4
tensor([15], device='mps:0', dtype=torch.int32)
Versions
Collecting environment information...
PyTorch version: 2.6.0.dev20241226
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A
OS: macOS 15.2 (arm64)
GCC version: Could not collect
Clang version: 16.0.0 (clang-1600.0.26.6)
CMake version: version 3.29.5
Libc version: N/A
Python version: 3.11.10 (main, Sep 7 2024, 08:05:54) [Clang 16.0.0 (clang-1600.0.26.3)] (64-bit runtime)
Python platform: macOS-15.2-arm64-arm-64bit
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True
CPU:
Apple M3
Versions of relevant libraries:
[pip3] numpy==2.1.2
[pip3] torch==2.6.0.dev20241226
[pip3] torchao==0.7.0
[pip3] torchvideo==0.0.0
[pip3] torchvision==0.22.0.dev20241226
[conda] Could not collect