Skip to content

[BUG] Silent crash in safetensors call when compiling shards #790

Open
@r0mar0ma

Description

@r0mar0ma

OS

Windows

GPU Library

CUDA 12.x

Python version

3.10

Pytorch version

torch-2.7.0+cu128

Model

No response

Describe the bug

Crashing silently in processing source safetensors on CPU when compiling shards.
safetensors-0.5.3

Reproduction steps

Run conversion with -cf

Expected behavior

Should compile shards and complete conversion successfully

Logs

No response

Additional context

At least on my config moving safe_open to GPU (RTX4090) is resolving a problem.
Here is just a draft example with first GPU (device = 0):

compile.py

- with safe_open(file, framework = "pt") as f:
-     tensor = f.get_tensor(lkey)
+ with safe_open(file, framework = "pt", device = 0) as f:
+     tensor = f.get_tensor(lkey).to("cpu")

Acknowledgements

  • I have looked for similar issues before submitting this one.
  • I understand that the developers have lives and my issue will be answered when possible.
  • I understand the developers of this program are human, and I will ask my questions politely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions