我們實驗室有2套環境
一套:4070ti。安裝了cuda12.4
一套:3張4090.安裝了cuda12.4
現在開始給第一套裝能運行unsloth能運行的環境
第一步:開始創建虛擬環境
conda create -n test_env python=3.11
第二步:進入虛擬環境
conda activate test_env
第三步:直接開始下載unsloth
根據官方說的,這樣很多依賴比如torch、transformers直接能用到最新的依賴
pip install unsloth
好了,第一套裝好了
開始裝4090的,也是cuda12.4
跟第一個相同操作,唯一不同虛擬環境名字改一下,我這里不規范,大家規范一下
第一步:開始創建虛擬環境
conda create -n unsloth-myenvs python=3.11
第二步:進入虛擬環境
conda activate unsloth-myenvs
第三步:直接開始下載unsloth
根據官方說的,這樣很多依賴比如torch、transformers直接能用到最新的依賴
pip install unsloth
同樣進行運行微調程序
搞笑的來了,他喵Transformers版本高了,對4090支持不好,會報錯
ValueError: Pointer argument (at 2) cannot be accessed from Triton (cpu tensor?)
0%| | 0/200 [00:01<?, ?it/s]
降下版本,先看看Transformers有哪些版本
先看看4.48.3可以否
直接一手pip install transformers==4.48.3
不行,同樣的錯誤,我就感覺很納悶,我看unsloth和這個transformers版本關系看到有個關聯
unsloth-zoo 2025.3.8 requires transformers!=4.47.0,>=4.46.1
那直接試了試pip install transformers= =4.46.3
到現在我終于明白,unsloth為了增加grop的功能、以及加速功能,很多驅動版本都對應不上
總結總結
能不裝cuda12.4就別裝,最好12.1很多驅動沒跟上
能先用穩定版就用穩定版,最新bug太多
不單單和transformers有關,還和Triton這個新加的并行加速也有關
祝用unsloth的兄弟們好運