Skip to content

fix: use backend device type in GGUF merge path#13

Closed
danielhanchen wants to merge 2 commits into
mainfrom
pr-615-head
Closed

fix: use backend device type in GGUF merge path#13
danielhanchen wants to merge 2 commits into
mainfrom
pr-615-head

Conversation

@danielhanchen

Copy link
Copy Markdown
Collaborator

Staging mirror of unslothai#615

Original PR: unslothai#615
Author: andomeder

This is a staging copy for review and editing. Once finalized, changes will be pushed back to the original PR.


Original description

Use DEVICE_TYPE / DEVICE_TYPE_TORCH in unsloth_zoo/saving_utils.py instead of assuming CUDA directly in the GGUF merge/export path.

This updates:

  • _merge_lora to move tensors with torch.device(DEVICE_TYPE_TORCH, index)
  • post-merge cache clearing to use the active backend
  • Tesla T4 detection to run only on DEVICE_TYPE == "cuda"

This was failing on Intel XPU during export with:

Torch not compiled with CUDA enabled

@danielhanchen danielhanchen deleted the pr-615-head branch May 4, 2026 01:24
@danielhanchen danielhanchen restored the pr-615-head branch May 4, 2026 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants