Skip to content

Conversation

@csabakecskemeti
Copy link
Contributor

Intel-based Macs cannot upgrade PyTorch beyond version 2.2.2

Users with older Intel-based Macs cannot upgrade PyTorch beyond version 2.2.2, as Apple dropped support for these machines in newer macOS versions. The latest convert_hf_to_gguf.py fails on these systems with:

AttributeError: module 'torch' has no attribute 'uint64'

This occurs because torch.uint64, torch.uint32, and torch.uint16 were introduced in PyTorch 2.3.

As I love my 2013 Mac Pro I try to keep it useful as long as possible. I can fall back to the older types.
There are so many ways to do this but wanted to make it completely user driven with a '-legacy-torch' flag . I wanted to avoid any automatic fallback - user should know what they do and this is a "last resort" on older machines.

Usage

python3 convert_hf_to_gguf.py --legacy-torch /path/to/model --outfile output.gguf --outtype f16

Other option would be maintaining a separate convert_hf_to_gguf_bw_comp script but I do not like that.
Please suggest if you have better suggestion to solve this.

@CISC
Copy link
Collaborator

CISC commented Jan 18, 2026

No flag necessary, you can just comment them out, they are unused (mapped from _dtype_str_map where they are commented out):

llama.cpp/convert_hf_to_gguf.py

Lines 11196 to 11197 in 68a7c14

dtype = cls._dtype_str_map[tensor.dtype]
numpy_dtype = cls._dtype_byteswap_map[dtype]

Add similar comment to this:

# TODO: uncomment U64, U32, and U16, ref: https://github.com/pytorch/pytorch/issues/58734

@github-actions github-actions bot added the python python script changes label Jan 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python python script changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants