본문 바로가기

AI/Coding errors

[Window] bitsandbytes download - PEFT using LoRA(QLoRA)

반응형

Window에서 bitsandbytes 다운완료!!

드디어... LLM을 PEFT 방식을 이용해서 훈련시킬려고 하는데, bitsandbytes가 linux만 지원한다는 얘기만 잔뜩 있고 도움이 되는 글들을 못 찾아서 디버깅하는데만 5시간 쏟은 것 같다...

 

요즘 LLM fine-tuning하면 LoRA와 QLoRA가 대세이고, 또 이것을 양자화해서 memory의 효율성을 가져가는게 트렌드인데 이 양자화를 해서 memory를 아낄려면 8-bit, 4-bit로 weight를 설정하고 float과 상호성을 띄도록 만들어줘야 하는데 여기 필요한 모듈 중 하나가 바로 bitsandbytes이다...


방법1) bitsandbytes-windows-webui github

https://github.com/jllllll/bitsandbytes-windows-webui

 

GitHub - jllllll/bitsandbytes-windows-webui: Windows compile of bitsandbytes for use in text-generation-webui.

Windows compile of bitsandbytes for use in text-generation-webui. - GitHub - jllllll/bitsandbytes-windows-webui: Windows compile of bitsandbytes for use in text-generation-webui.

github.com

해당 사이트에 들어가면 bitsandbytes를 window에서 사용할 수 있도록 pip install을 지원한다!!!

python -m pip install https://github.com/jllllll/bitsandbytes-windows-webui/releases/download/wheels/bitsandbytes-0.39.1-py3-none-win_amd64.whl

위의 키워드를 terminal에 입력하면 설치가 완료된다!!


방법2) pip install bitsandbytes-windows

https://pypi.org/project/bitsandbytes-windows/

 

bitsandbytes-windows

8-bit optimizers and matrix multiplication routines.

pypi.org

따로 bitsandbytes-windows 버전이 있다.

필자는 이걸 다운 받았었을 때는 잘 되진 않았다 ㅠㅠ


2023.07.08 Kyujinpy 작성.

반응형