safetensors

by Hugging Face · Framework · Text & code

A file format and library for saving and loading neural network weights safely and quickly, reading checkpoints from disk into memory or onto a GPU.

Latest · Nov 19safetensors 0.8.0 maps checkpoints privately (rw-p); get_slice[...] then .to('cuda') left 512 of 512 MiB as private copies on the Spark, but .clone() first left 0.

AccessOpen codeLicenseApache 2.0

Seen running on

MachineSpeedHowSeen by
1 run on 128 GB
DGX Sparkno speed givenmark.hutto · Nov 19

Evidence

  1. Nov 19
    Workarounds leaving no copies in every run: .clone() before copying, backend='pread' (0.8.0 or later), and load_file(..., device='cuda:0'). safe_open with device='cuda:0' left none in two of three runs.

Everything said about safetensors, on the wire