2 ms·
mmap() requires that you map at page aligned intervals which must be congruent with the file offset. You can't just round down because some gpus like metal requ
by jart 3y ago
mmap() requires that you map at page aligned intervals which must be congruent with the file offset. You can't just round down because some gpus like metal require that the data pointers themselves be page aligned too.
- liuliu 3y agoYeah, safetensors separates metadata and tensor data. The metadata is an offset reference to the tensor data that you are free to define yourselves. In that way, you can create files in safetensors format but the tensor data itself is paged aligned offsets.