diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

Add `disable_mmap` to option to Pipeline

Open DN6 opened this issue 1 month ago • 1 comments

What does this PR do?

Addressed some of the issues brought up in #12599. Using mmaped safetensors on networked volumes can lead to very slow load/device transfer times. More context: https://github.com/huggingface/safetensors/issues/562#issuecomment-2634544710

We have the disable_mmap option for single file and models to skip using safetensors default mmaped loading, but didn't add it to from_pretrained in pipelines.

Fixes # (issue)

Before submitting

  • [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • [ ] Did you read the contributor guideline?
  • [ ] Did you read our philosophy doc (important for complex PRs)?
  • [ ] Was this discussed/approved via a GitHub issue or the forum? Please add a link to it if that's the case.
  • [ ] Did you make sure to update the documentation with your changes? Here are the documentation guidelines, and here are tips on formatting docstrings.
  • [ ] Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR.

DN6 avatar Nov 18 '25 02:11 DN6

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.