1. 21 Dec, 2023 1 commit
  2. 16 Oct, 2023 1 commit
  3. 13 Sep, 2023 2 commits
  4. 10 Aug, 2023 1 commit
  5. 28 Jun, 2023 2 commits
  6. 10 Jun, 2023 1 commit
  7. 09 Jun, 2023 1 commit
  8. 01 Jun, 2023 1 commit
  9. 24 May, 2023 1 commit
    • Tim Dettmers's avatar
      4-bit QLoRA via bitsandbytes (4-bit base model + LoRA) (#23479) · 9d73b922
      Tim Dettmers authored
      
      
      * Added lion and paged optimizers and made original tests pass.
      
      * Added tests for paged and lion optimizers.
      
      * Added and fixed optimizer tests.
      
      * Style and quality checks.
      
      * Initial draft. Some tests fail.
      
      * Fixed dtype bug.
      
      * Fixed bug caused by torch_dtype='auto'.
      
      * All test green for 8-bit and 4-bit layers.
      
      * Added fix for fp32 layer norms and bf16 compute in LLaMA.
      
      * Initial draft. Some tests fail.
      
      * Fixed dtype bug.
      
      * Fixed bug caused by torch_dtype='auto'.
      
      * All test green for 8-bit and 4-bit layers.
      
      * Added lion and paged optimizers and made original tests pass.
      
      * Added tests for paged and lion optimizers.
      
      * Added and fixed optimizer tests.
      
      * Style and quality checks.
      
      * Fixing issues for PR #23479.
      
      * Added fix for fp32 layer norms and bf16 compute in LLaMA.
      
      * Reverted variable name change.
      
      * Initial draft. Some tests fail.
      
      * Fixed dtype bug.
      
      * Fixed bug caused by torch_dtype='auto'.
      
      * All test green for 8-bit and 4-bit layers.
      
      * Added lion and paged optimizers and made original tests pass.
      
      * Added tests for paged and lion optimizers.
      
      * Added and fixed optimizer tests.
      
      * Style and quality checks.
      
      * Added missing tests.
      
      * Fixup changes.
      
      * Added fixup changes.
      
      * Missed some variables to rename.
      
      * revert trainer tests
      
      * revert test trainer
      
      * another revert
      
      * fix tests and safety checkers
      
      * protect import
      
      * simplify a bit
      
      * Update src/transformers/trainer.py
      
      * few fixes
      
      * add warning
      
      * replace with `load_in_kbit = load_in_4bit or load_in_8bit`
      
      * fix test
      
      * fix tests
      
      * this time fix tests
      
      * safety checker
      
      * add docs
      
      * revert torch_dtype
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * multiple fixes
      
      * update docs
      
      * version checks and multiple fixes
      
      * replace `is_loaded_in_kbit`
      
      * replace `load_in_kbit`
      
      * change methods names
      
      * better checks
      
      * oops
      
      * oops
      
      * address final comments
      
      ---------
      Co-authored-by: default avataryounesbelkada <younesbelkada@gmail.com>
      Co-authored-by: default avatarYounes Belkada <49240599+younesbelkada@users.noreply.github.com>
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      9d73b922
  10. 22 May, 2023 1 commit
  11. 12 Apr, 2023 1 commit
  12. 29 Mar, 2023 1 commit
  13. 20 Feb, 2023 1 commit
  14. 17 Feb, 2023 1 commit
  15. 13 Feb, 2023 1 commit
  16. 02 Feb, 2023 1 commit
  17. 24 Jan, 2023 1 commit
  18. 13 Dec, 2022 1 commit
  19. 23 Nov, 2022 1 commit
  20. 17 Nov, 2022 2 commits
  21. 12 Aug, 2022 1 commit
  22. 10 Aug, 2022 1 commit
    • Younes Belkada's avatar
      `bitsandbytes` - `Linear8bitLt` integration into `transformers` models (#17901) · 4a51075a
      Younes Belkada authored
      
      
      * first commit
      
      * correct replace function
      
      * add final changes
      
      - works like charm!
      - cannot implement tests yet
      - tested
      
      * clean up a bit
      
      * add bitsandbytes dependencies
      
      * working version
      
      - added import function
      - added bitsandbytes utils file
      
      * small fix
      
      * small fix
      
      - fix import issue
      
      * fix import issues
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * refactor a bit
      
      - move bitsandbytes utils to utils
      - change comments on functions
      
      * reformat docstring
      
      - reformat docstring on init_empty_weights_8bit
      
      * Update src/transformers/__init__.py
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * revert bad formatting
      
      * change to bitsandbytes
      
      * refactor a bit
      
      - remove init8bit since it is useless
      
      * more refactoring
      
      - fixed init empty weights issue
      - added threshold param
      
      * small hack to make it work
      
      * Update src/transformers/modeling_utils.py
      
      * Update src/transformers/modeling_utils.py
      
      * revmoe the small hack
      
      * modify utils file
      
      * make style + refactor a bit
      
      * create correctly device map
      
      * add correct dtype for device map creation
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * apply suggestions
      
      - remove with torch.grad
      - do not rely on Python bool magic!
      
      * add docstring
      
       - add docstring for new kwargs
      
      * add docstring
      
      - comment `replace_8bit_linear` function
      - fix weird formatting
      
      * - added more documentation
      - added new utility function for memory footprint tracking
      - colab demo to add
      
      * few modifs
      
      - typo doc
      - force cast into float16 when load_in_8bit is enabled
      
      * added colab link
      
      * add test architecture + docstring a bit
      
      * refactor a bit testing class
      
      * make style + refactor a bit
      
      * enhance checks
      
      - add more checks
      - start writing saving test
      
      * clean up a bit
      
      * male style
      
      * add more details on doc
      
      * add more tests
      
      - still needs to fix 2 tests
      
      * replace by "or"
      
      - could not fix it from GitHub GUI
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * refactor a bit testing code + add readme
      
      * make style
      
      * fix import issue
      
      * Update src/transformers/modeling_utils.py
      Co-authored-by: default avatarMichael Benayoun <mickbenayoun@gmail.com>
      
      * add few comments
      
      * add more doctring + make style
      
      * more docstring
      
      * raise error when loaded in 8bit
      
      * make style
      
      * add warning if loaded on CPU
      
      * add small sanity check
      
      * fix small comment
      
      * add bitsandbytes on dockerfile
      
      * Improve documentation
      
      - improve documentation from comments
      
      * add few comments
      
      * slow tests pass on the VM but not on the CI VM
      
      * Fix merge conflict
      
      * make style
      
      * another test should pass on a multi gpu setup
      
      * fix bad import in testing file
      
      * Fix slow tests
      
      - remove dummy batches
      - no more CUDA illegal memory errors
      
      * odify dockerfile
      
      * Update docs/source/en/main_classes/model.mdx
      
      * Update Dockerfile
      
      * Update model.mdx
      
      * Update Dockerfile
      
      * Apply suggestions from code review
      
      * few modifications
      
      - lm head can stay on disk/cpu
      - change model name so that test pass
      
      * change test value
      
      - change test value to the correct output
      - torch bmm changed to baddmm in bloom modeling when merging
      
      * modify installation guidelines
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * replace `n`by `name`
      
      * merge `load_in_8bit` and `low_cpu_mem_usage`
      
      * first try - keep the lm head in full precision
      
      * better check
      
      - check the attribute `base_model_prefix` instead of computing the number of parameters
      
      * added more tests
      
      * Update src/transformers/utils/bitsandbytes.py
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Merge branch 'integration-8bit' of https://github.com/younesbelkada/transformers
      
       into integration-8bit
      
      * improve documentation
      
      - fix typos for installation
      - change title in the documentation
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      Co-authored-by: default avatarMichael Benayoun <mickbenayoun@gmail.com>
      4a51075a