• Patrick von Platen's avatar
    [Low CPU memory] + device map (#772) · fab17528
    Patrick von Platen authored
    
    
    * add accelerate to load models with smaller memory footprint
    
    * remove low_cpu_mem_usage as it is reduntant
    
    * move accelerate init weights context to modelling utils
    
    * add test to ensure results are the same when loading with accelerate
    
    * add tests to ensure ram usage gets lower when using accelerate
    
    * move accelerate logic to single snippet under modelling utils and remove it from configuration utils
    
    * format code using to pass quality check
    
    * fix imports with isor
    
    * add accelerate to test extra deps
    
    * only import accelerate if device_map is set to auto
    
    * move accelerate availability check to diffusers import utils
    
    * format code
    
    * add device map to pipeline abstraction
    
    * lint it to pass PR quality check
    
    * fix class check to use accelerate when using diffusers ModelMixin subclasses
    
    * use low_cpu_mem_usage in transformers if device_map is not available
    
    * NoModuleLayer
    
    * comment out tests
    
    * up
    
    * uP
    
    * finish
    
    * Update src/diffusers/pipelines/stable_diffusion/safety_checker.py
    
    * finish
    
    * uP
    
    * make style
    Co-authored-by: default avatarPi Esposito <piero.skywalker@gmail.com>
    fab17528
safety_checker.py 4.71 KB