Skip to content

Commit

Permalink
fix typos (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiszk authored Jun 6, 2023
1 parent 5fb637c commit 32b3c4d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,5 @@ Simple checklist on how to make releases for `safetensors`.
If you want to make modifications to the CI/CD of the release GH actions, you need
to :
- **Comment the part that uploads the artifacts** to `crates.io`, `PyPi` or `npm`.
- Change the trigger mecanism so it can trigger every time you push to your branch.
- Change the trigger mechanism so it can trigger every time you push to your branch.
- Keep pushing your changes until the artifacts are properly created.
4 changes: 2 additions & 2 deletions docs/source/speed.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ Loaded pytorch 0:00:00.353889
on GPU, safetensors is faster than pytorch by: 2.1 X
```

The speedup works because this library is able to skip unecessary CPU allocations. It is unfortunately not replicable in pure pytorch as far as we know. The library works by memory mapping the file, creating the tensor empty with pytorch and calling `cudaMemcpy` directly to move the tensor directly on the GPU.
The speedup works because this library is able to skip unnecessary CPU allocations. It is unfortunately not replicable in pure pytorch as far as we know. The library works by memory mapping the file, creating the tensor empty with pytorch and calling `cudaMemcpy` directly to move the tensor directly on the GPU.
The currently shown speedup was gotten on:
* OS: Ubuntu 18.04.6 LTS.
* GPU: Tesla T4
* Driver Version: 460.32.03
* CUDA Version: 11.2
* CUDA Version: 11.2
6 changes: 3 additions & 3 deletions docs/source/torch_shared_tensors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Multiple reasons for that:
So if someone saves shared tensors in torch, there is no way to
load them in a similar fashion so we could not keep the same `Dict[str, Tensor]`
API.
- *It makes lazy loading very quircky.*
- *It makes lazy loading very quickly.*
Lazy loading is the ability to load only some tensors, or part of tensors for
a given file. This is trivial to do without sharing tensors but with tensor sharing

Expand All @@ -80,11 +80,11 @@ Multiple reasons for that:
a = torch.zeros((100, 100))
b = a[:1, :]
torch.save({"b": b}, "model.bin")
# File is 41k instead of the epected 400 bytes
# File is 41k instead of the expected 400 bytes
# In practice it could happen that you save several 10GB instead of 1GB.
```

Now with all those reasons being mentionned, nothing is set in stone in there.
Now with all those reasons being mentioned, nothing is set in stone in there.
Shared tensors do not cause unsafety, or denial of service potential, so this
decision could be revisited if current workarounds are not satisfactory.

Expand Down

1 comment on commit 32b3c4d

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 32b3c4d Previous: 5fb637c Ratio
benches/test_pt.py::test_pt_sf_load_cpu 61.895830159657734 iter/sec (stddev: 0.0003242703565599348) 131.15647166434985 iter/sec (stddev: 0.00015523181930568377) 2.12

This comment was automatically generated by workflow using github-action-benchmark.

CC: @Narsil

Please sign in to comment.