Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Unnecessary swapping on linux / use diffusers/transformers loading code #1521

Description

@dxqb

What happened?

Linux often swaps during model loading even though RAM is free and swapiness already is 1

Image

red is RAM
green is swap

What did you expect would happen?

use RAM
this is likely related to the loading pipeline

  • load safetensors as meta tensors
  • mmap the safetensors file
  • actually load each tensor during quantization

investigate alternatives.

  • is diffusers itself better at loading the checkpoints without swapping?
  • what reasons are there left to even have our own loading code?
  • diffusers have several quantization backends now. can we plug in there?
  • using more of diffusers / transformers loading code would also mitigate other issues that keep happening when they upgrade, because OneTrainer relies on their internals which they change between versions

Relevant log output

Generate and upload debug_report.log

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions