mamba / micromamba 요약 정리

mamba 와 conda 는 서로 교체 가능한 파이썬 패키지 매니저이다.

mamba는 conda와 같은 사용방법과 동일한 환경을 이어받은 패키지 관리자 이다. conda & mamba 명령을 서로 거의 동일하게 사용할 수 있다. conda 의 패키지 채널을 그대로 사용할 수 있다.

1
2
3
mamba install ...
mamba create -n ... -c ... ...
mamba list

여기서는 micromamba를 사용해보려고 한다.

micromamba 는 mamba의 소규모 버전으로 독립적 실행 파일이다. 다만 mamba 와 micromamba는 환경 구성이 좀 다르다. micromamba는 mamba와 다르게 MAMBA_ROOT_PREFIX 환경 변수를 기준으로 패키지 관리가 시작되고 환경이 생성된다.

  1. 설치
  2. micromamba 사용
  3. 가상환경 사용
  4. Repoquery 명령
  5. Uninstall
  6. 참고

1. micromamba 설치

https://mamba.readthedocs.io/en/latest/installation/micromamba-installation.html

Linux, macOS, or Git Bash on Windows install with:

1
"${SHELL}" <(curl -L micro.mamba.pm/install.sh)

Windows 에서 설치

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
PS> Invoke-Expression ((Invoke-WebRequest -Uri https://micro.mamba.pm/install.ps1).Content)
Downloading micromamba from https://github.com/mamba-org/micromamba-releases/releases/latest/download/micromamba-win-64
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 9280k 100 9280k 0 0 3355k 0 0:00:02 0:00:02 --:--:-- 10.8M

Installing micromamba to C:\Users\student\AppData\Local\micromamba

Adding C:\Users\student\AppData\Local\micromamba\micromamba.exe to PATH

Do you want to initialize micromamba for the shell activate command? (Y/n): y
Enter the path to the micromamba prefix (default: C:\Users\student\micromamba):
Initializing micromamba in C:\Users\student\micromamba
C:\Users\student\AppData\Local\micromamba\micromamba.exe
The following argument was not expected: -p
Run with --help for more information.

Update

1
PS> micromamba self-update

특정 버전으로 업데이트도 가능하다.

1
PS> micromamba self-update --version 1.4.6

micromamba 도움말.

1
PS> micromamba --help

2. micromamba 사용

micromamba의 가상환경은 micromamba activate /path/to/env 같이 활성화 시키는데, MAMBA_ROOT_PREFIX 환경변수를 기준으로 micromamba activate env 같이 사용할 수 있다.

현재 사용할 수 있는 환경을 출력.

1
2
3
4
5
PS> micromamba env list
Name Active Path
--------------------------------------------------------------
base C:\Users\student\micromamba
C:\Users\student\miniconda3\envs\myenv

micromamba 명령으로 대부분의 conda 명령을 동일하게 실행할 수 있다.

1
2
3
4
5
6
7
8
9
10
micromamba info                          # 현재 micromamba 환경정보

# 설치한 패키지 목록
micromamba list ananconda # Anaconda 정보
micromamba list python # python 패키지 정보

# upgrade
micromamba update pip # pip upgrade
micromamba update pip=25.0 # pip upgrade to 25.0
micromamba update conda # conda upgrade

3. 가상환경 사용

-n 옵션으로 가상환경을 지정하고 생성/수정/삭제를 할 수 있고, 더불어 패키지를 함께 관리할 수 있다.

가상환경 생성

가상환경과 패키지를 함께 설치한다.

1
PS> mamba create -n myenv <list of packages>

가상환경에 python 버전을 지정할 수 있다.

1
PS> micromamba create -n myenv python=3.12

가상환경에 설치 채널을 지정해 설치할 수 있다. 아래는 conda-forge 채널 이용

1
PS> micromamba create -n myenv jupyterlab -c conda-forge python=3.12
1
2
# 가상환경 목록
PS> micromamba env list

가상환경 활성화

가상환경은 가상환경 이름을 주어 활성화 한다.

1
2
PS> micromamba activate myenv
(myenv) PS C:\Users\student>

혹은 가상환경이 있는 위치의 절대경로를 주어 활성화 할 수 있다.

1
PS> micromamba activate /path/to/myenv

run 명령은 가상환경을 사용해서 특정 스크립트/명령를 직접 실행할 수 있다.

1
PS> micromamba run -n myenv mycommand

가상환경 myenv 의 서버 목록을 출력

1
2
3
4
5
(myenv) PS> micromamba run -n myenv jupyter server list
Currently running servers:
http://localhost:8888/?token=317c9380f9c3ed4ab6f836a7ffbc789497728820e9c60f47 :: D:\Jupyter_Hub
http://localhost:8585/ :: D:\Jupyter_Hub
http://desktop-goyangi:8686/ :: D:\Jupyter_Hub

사용중인 가상환경 비활성화

1
2
(myenv) PS> micromamba deactivate
PS>

모듈/패키지 설치

micromamba 명령을 사용해 모듈과 패키지를 설치 채널을 지정해서 설치할 수 있다.

활성화 myenv 가상환경에서 matplotlib 패키지를 설치한다.

1
2
3
4
5
6
7
(myenv) PS>micromamba install matplotlib -c conda-forge
Pinned packages:
- python=3.12
Transaction
Prefix: C:\Users\student\micromamba\envs\myenv
...

비활성 상태에서 myenv 가상환경에 패키지를 설치한다.

1
2
3
4
5
6
PS> micromamba -n myenv install matplotlib
Pinned packages:
- python=3.12

Transaction
Prefix: C:\Users\student\micromamba\envs\myenv

가상환경 업데이트

특정 가상환경을 모두 업데이트

1
micromamba update -n myenv --all

환경의 모든 패키지를 덥데이트 하려면

1
micromamba update --all

가상환경 제거

설치한 가상환경을 지운다

1
2
3
PS> micromamba env remove -n myenv --all
...
Proceed ([y]/n)? y

4. Repoquery 명령

mamba 는 새로운 패키지 검색 명령으로 repoquery 명령을 선보이고 있다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 설치 가능한 모든 python 패키지 목록
$ micromamba repoquery search python

# 설치 가능한 python=버전 패키지 목록
$ micromamba repoquery search "python>=3.11"

# 설치 가능한 jupyterlab 버전 패키지 목록
$ micromamba repoquery search "jupyterlab>=4.0"


# 현재 환경의 jupyterlab 에 연관된 의존성 패키지 목록
$ micromamba repoquery depends jupyterlab

# 현재 환경의 jupyterlab 에 연관된 모든 의존성 세부 목록
$ micromamba repoquery depends jupyterlab --recursive

패키지 연관 의존성을 트리형식으로 출력할 수 있다.

1
2
3
4
5
6
7
8
# 현재 환경의 jupyterlab 에 연관된 의존성 패키지의 트리 목록
$ micromamba repoquery depends -t jupyterlab
jupyterlab[4.3.4]
├─ jupyter-lsp[2.2.0]
│ ├─ python already visited
│ └─ jupyter_server[2.15.0]
│ ├─ python already visited

And you can ask for the inverse, which packages depend on some other package (e.g. ipython) using whoneeds.

1
2
3
4
5
6
7
8
$ micromamba repoquery whoneeds ipython

Name Version Build Depends Channel
-------------------------------------------------------------------
jupyter_console 6.4.3 pyhd3eb1b0_0 ipython pkgs/main
ipykernel 6.9.1 py39haa95532_0 ipython >=7.23.1 pkgs/main
ipywidgets 7.6.5 pyhd3eb1b0_1 ipython >=4.0.0 pkgs/main
With the -t,--tree flag, you can get the same information in a tree.

트리 형식 출력

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$ mamba repoquery whoneeds -t ipython

ipython[8.2.0]
├─ jupyter_console[6.4.3]
│ └─ jupyter[1.0.0]
├─ ipykernel[6.9.1]
│ ├─ notebook[6.4.8]
│ │ ├─ widgetsnbextension[3.5.2]
│ │ │ └─ ipywidgets[7.6.5]
│ │ │ └─ jupyter already visited
│ │ └─ jupyter already visited
│ ├─ jupyter_console already visited
│ ├─ ipywidgets already visited
│ ├─ jupyter already visited
│ └─ qtconsole[5.3.0]
│ └─ jupyter already visited
└─ ipywidgets already visited

5. Uninstall, Windows

Micromamba는 Windows 11에서 다음과 같은 방법으로 삭제할 수 있습니다.

  1. micromamba 설치 디렉토리 삭제:

micromamba가 설치된 디렉토리를 찾습니다. 일반적으로 C:\Users<사용자 이름>.local\bin 또는 C:\micromamba에 설치됩니다.
해당 디렉토리를 삭제합니다.

  1. 환경 변수에서 micromamba 경로 제거:

Windows 검색 창에서 “환경 변수”를 검색하고 “시스템 환경 변수 편집”을 엽니다.
“시스템 속성” 창에서 “환경 변수” 버튼을 클릭합니다.
“시스템 변수” 섹션에서 “Path” 변수를 선택하고 “편집” 버튼을 클릭합니다.
micromamba가 설치된 디렉토리 경로가 있는지 확인하고, 있다면 해당 경로를 삭제합니다.
“확인” 버튼을 클릭하여 변경 사항을 저장합니다.

  1. micromamba 관련 파일 삭제:

C:\Users<사용자 이름>.condarc 파일을 삭제합니다. (존재하는 경우)
C:\Users<사용자 이름>.mambarc 파일을 삭제합니다. (존재하는 경우)

C:\Users<사용자 이름>\AppData\Local\micromamba (존재하는 경우)

  1. (선택 사항) micromamba 설치 시 생성된 바로가기 삭제:

micromamba 설치 시 생성된 바로가기가 있다면 삭제합니다.

  1. (선택 사항) micromamba와 관련된 가상 환경 삭제:

micromamba를 사용하여 생성한 가상 환경이 있다면 해당 디렉토리를 삭제합니다. 가상 환경은 일반적으로 C:\Users<사용자 이름>.micromamba\envs 디렉토리에 저장됩니다.


참고

Local LLM 실험: RTX 3080Ti 에서 bench mark 결과

RTX 3080TI 를 사용해서 LLM 모델 llama-bench 로 벤치마크 테스트를 수행했다.

  1. llama-3-korean-bllossom-8B
  2. llama-3.1-korean-reasoning-8B
  3. UNIVA-Deepseek-llama3.1-Bllossom-8B
  4. Deepseek-r1-distill-llama-8B
  5. DeepSeek-R1-Distill-Qwen-14B
  6. DeepSeek-R1-Distill-Qwen-32B

벤치마크 결과는 아래 테이블 같이 나온다.

model size params backend ngl test t/s
llama 8B Q4_K - Medium 4.58 GiB 8.03 B CUDA 99 pp512 3730.08 ± 65.93
llama 8B Q4_K - Medium 4.58 GiB 8.03 B CUDA 99 tg1000 91.75 ± 1.07

컬럼의 의미는 다음 같다.

  • Prompt processing (pp): processing a prompt in batches (-p)
  • Text generation (tg) :
  • n-gpu-layers (ngl) : GPU offload layers

llama-3-Korean-Bllossom-8B-Q4_K_M.gguf

8B 파라미터 크기를 가진 Llama3 fintuned 모델

  • MLP-KTLim/llama-3-Korean-Bllossom-8B-Q4_K_M.gguf

ngl 을 변경하며 벤치마킹,

1
llama-bench -m llama-3-Korean-Bllossom-8B-Q4_K_M.gguf -ngl 10,20,30,40,50 -n 1000

Device 0: NVIDIA GeForce RTX 3080 Ti, compute capability 8.6, VMM: yes

model size params backend ngl test t/s
llama 8B Q4_K - Medium 4.58 GiB 8.03 B CUDA 10 pp512 1303.36 ± 16.36
llama 8B Q4_K - Medium 4.58 GiB 8.03 B CUDA 10 tg1000 10.85 ± 0.02
llama 8B Q4_K - Medium 4.58 GiB 8.03 B CUDA 20 pp512 1719.75 ± 69.73
llama 8B Q4_K - Medium 4.58 GiB 8.03 B CUDA 20 tg1000 16.87 ± 0.04
llama 8B Q4_K - Medium 4.58 GiB 8.03 B CUDA 30 pp512 2906.49 ± 23.43
llama 8B Q4_K - Medium 4.58 GiB 8.03 B CUDA 30 tg1000 39.91 ± 0.16
llama 8B Q4_K - Medium 4.58 GiB 8.03 B CUDA 40 pp512 3483.66 ± 259.95
llama 8B Q4_K - Medium 4.58 GiB 8.03 B CUDA 40 tg1000 89.85 ± 2.06
llama 8B Q4_K - Medium 4.58 GiB 8.03 B CUDA 50 pp512 3419.22 ± 348.84
llama 8B Q4_K - Medium 4.58 GiB 8.03 B CUDA 50 tg1000 89.79 ± 0.37

정리:

  • RTX3080TI 에서 ngl=40 개 정도에서 꽤, 쓸만하게 반응한다. (시간적으로)

lemon-mint/LLaMa-3.1-Korean-Reasoning-8B-Instruct-Q8

llama3.1-8B 는 32 layers 를 가진 모델이다.

여기서는 lemon-mint/llama-3.1-korean-reasoning-8b-instruct-q8_0.gguf 모델을 사용ㅇ했다.

1
llama-bench -m Bllossom/lemon-mint/llama-3.1-korean-reasoning-8b-instruct-q8_0.gguf -ngl 25,30,35,40,45

Device 0: NVIDIA GeForce RTX 3080 Ti, compute capability 8.6, VMM: yes

model size params backend ngl test t/s
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 25 pp512 1784.23 ± 93.34
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 25 tg1000 14.80 ± 0.06
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 30 pp512 2786.34 ± 31.32
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 30 tg1000 26.87 ± 0.30
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 35 pp512 3733.38 ± 187.10
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 35 tg1000 73.87 ± 3.13
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 40 pp512 3797.38 ± 166.76
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 40 tg1000 74.09 ± 3.33
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 45 pp512 3791.58 ± 82.35
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 45 tg1000 74.12 ± 3.20

정리

  • RTX3080TI 는 8B 모델들은 적당히 잘 돌아 간다.
  • bllossom 8B 와 비슷하게 ngl=40 가 적당하다.


UNIVA-Deepseek-llama3.1-Bllossom-8B

DeepSeek-Bllossom Series는 기존 DeepSeek-R1-Distill Series 모델의 language mixing, 다국어 성능 저하 문제를 해결하기 위해 추가로 학습된 모델입니다.

DeepSeek-llama3.1-Bllossom-8B는 DeepSeek-R1-distill-Llama-8B 모델을 베이스로 구축된 모델로, 한국어 환경에서의 추론 성능 향상을 목표로 개발되었습니다.

6Bit

1
llama-bench -m UNIVA-DeepSeek-llama3.1-Bllossom-8B-Q6_K.gguf -ngl 20,23,25,27,30 -n 1000

Device 0: NVIDIA GeForce RTX 3080 Ti, compute capability 8.6, VMM: yes

model size params backend ngl test t/s
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 20 pp512 1543.16 ± 24.32
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 20 tg1000 13.13 ± 0.11
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 23 pp512 1765.23 ± 58.73
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 23 tg1000 16.08 ± 0.07
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 25 pp512 2027.43 ± 43.47
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 25 tg1000 19.04 ± 0.30
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 27 pp512 2249.32 ± 57.11
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 27 tg1000 23.01 ± 0.82
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 30 pp512 3001.55 ± 29.89
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 30 tg1000 33.67 ± 0.20
1
(Deepseek_R1) qkboo:~$ llama-bench -m /mnt/e/LLM_Run/UNIVA-DeepSeek-llama3.1-Bllossom-8B-Q6_K.gguf -ngl 30,33,35,37,40 -n 1000

Device 0: NVIDIA GeForce RTX 3080 Ti, compute capability 8.6, VMM: yes

model size params backend ngl test t/s
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 30 pp512 3011.60 ± 50.04
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 30 tg1000 34.08 ± 1.11
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 33 pp512 3895.08 ± 25.09
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 33 tg1000 76.81 ± 4.94
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 35 pp512 3933.71 ± 32.81
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 35 tg1000 77.27 ± 6.96
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 37 pp512 3883.86 ± 20.62
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 37 tg1000 77.30 ± 4.44
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 40 pp512 3909.77 ± 14.13
^[[C llama 8B Q6_K 6.14 GiB 8.03 B CUDA 40 tg1000

8bit

1
$ llama-bench -m UNIVA-DeepSeek-llama3.1-Bllossom-8B-Q8_0.gguf -ngl 17,23,27,30,33 -n 1000

Device 0: NVIDIA GeForce RTX 3080 Ti, compute capability 8.6, VMM: yes

model size params backend ngl test t/s
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 17 pp512 1152.58 ± 20.30
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 17 tg1000 8.79 ± 0.06
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 23 pp512 1653.79 ± 44.44
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 23 tg1000 12.79 ± 0.08
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 27 pp512 2170.69 ± 66.22
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 27 tg1000 18.02 ± 0.10
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 30 pp512 2997.54 ± 36.25
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 30 tg1000 26.93 ± 0.28
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 33 pp512 4311.76 ± 17.63
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 33 tg1000 80.54 ± 2.72
1
$ llama-bench -m /mnt/e/LLM_Run/UNIVA-DeepSeek-llama3.1-Bllossom-8B-Q8_0.gguf -ngl 47,53,57,60,65 -n 1000

Device 0: NVIDIA GeForce RTX 3080 Ti, compute capability 8.6, VMM: yes

model size params backend ngl test t/s
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 47 pp512 4252.55 ± 170.94
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 47 tg1000 79.03 ± 8.48
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 53 pp512 4341.45 ± 181.79
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 53 tg1000 80.21 ± 8.60
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 57 pp512 4470.11 ± 27.91
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 57 tg1000 80.12 ± 6.18
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 60 pp512 4542.52 ± 23.46
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 60 tg1000 80.92 ± 9.37
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 65 pp512 4502.80 ± 57.29
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 65 tg1000 81.02 ± 10.89


DeepSeek-R1-Distill-Llama-8B-Q8_0.gguf

그 유명한 deepseek r1 으로 unsloth 의 distill 버전을 사용했다.

deepseek r1 은 61 layers 를 사용한다.

1
2
$ llama-bench -m DeepSeek-R1-Distill-Llama-8B-GGUF/DeepSeek-R1-Distill-Llama-8B-Q8_0.gguf -ngl 10,20,30
,40,50 -n 1000

Device 0: NVIDIA GeForce RTX 3080 Ti, compute capability 8.6, VMM: yes

model size params backend ngl test t/s
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 10 pp512 849.57 ± 12.77
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 10 tg1000 6.34 ± 0.06
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 20 pp512 1279.56 ± 22.85
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 20 tg1000 10.41 ± 0.08
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 30 pp512 2712.69 ± 96.48
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 30 tg1000 26.45 ± 0.42
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 40 pp512 3581.72 ± 261.82
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 40 tg1000 72.33 ± 1.53
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 50 pp512 3653.35 ± 292.75
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 50 tg1000 73.69 ± 2.39

정리

  • RTX3080TI 에서 ngl=40 에서 잘 반응한다.
  • 역시 8B 파라미터라서 앞의 llama 3- bllossom, llama-3.1 8B 모델과 비슷하다.



DeepSeek-R1-Distill-Llama-8B_korean_reasoning

https://huggingface.co/mradermacher/DeepSeek-R1-Distill-Llama-8B_korean_reasoning-GGUF

6bit

1
$ llama-bench -m DeepSeek_R1_Distill/Llama-8B/DeepSeek-R1-Distill-Llama-8B_korean_reasoning.Q6_K.gguf -ngl 17,25,30,35,40,45 -n 1000

Device 0: NVIDIA GeForce RTX 3080 Ti, compute capability 8.6, VMM: yes

model size params backend ngl test t/s
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 17 pp512 1420.67 ± 56.23
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 17 tg1000 10.87 ± 0.45
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 25 pp512 2126.29 ± 80.18
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 25 tg1000 18.29 ± 0.83
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 30 pp512 3136.95 ± 97.13
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 30 tg1000 33.18 ± 1.54
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 37 pp512 3670.82 ± 41.77
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 37 tg1000 77.20 ± 1.17
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 40 pp512 3711.66 ± 33.40
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 40 tg1000 77.59 ± 1.12
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 42 pp512 3725.29 ± 18.83
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 42 tg1000 77.39 ± 1.52
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 45 pp512 3690.92 ± 26.38
llama 8B Q6_K 6.14 GiB 8.03 B CUDA 45 tg1000 77.49 ± 1.37

RTX3080ti 에서

  • pp 는 bllossom 버전보다 꽤 빠르다고 생각된다
  • tg 는 유사하다.
  • ngl은 40 정도가 적당할 듯.

8bit

l$ llama-bench -m DeepSeek_R1_Distill/Llama-8B/DeepSeek-R1-Distill-Llama-8B_korean_reasoning.Q8_0.gguf -ngl 25,29,35,39,42 -n 1000
ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no
ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
ggml_cuda_init: found 1 CUDA devices:
Device 0: NVIDIA GeForce RTX 3080 Ti, compute capability 8.6, VMM: yes

model size params backend ngl test t/s
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 25 pp512 1811.10 ± 51.70
llama 8B Q8_0 7.95 GiB 8.03 B CUDA 25 tg1000 14.25 ± 0.66
^C

RTX3080ti 에서




DeepSeek-R1-Distill-Qwen-14B

8bit Quantitization

1
$ llama-bench -m DeepSeek_R1_Distill/unsloth/DeepSeek-R1-Distill-Qwen-14B-Q8_0.gguf -ngl 25,28,30,33,35 -n 1000

Device 0: NVIDIA GeForce RTX 3080 Ti, compute capability 8.6, VMM: yes

model size params backend ngl test t/s
qwen2 14B Q8_0 14.62 GiB 14.77 B CUDA 25 pp512 649.52 ± 7.97
qwen2 14B Q8_0 14.62 GiB 14.77 B CUDA 25 tg1000 4.73 ± 0.03
qwen2 14B Q8_0 14.62 GiB 14.77 B CUDA 28 pp512 593.29 ± 188.35

6bit Quantitization

1
$ llama-bench -m DeepSeek_R1_Distill/unsloth/DeepSeek-R1-Distill-Qwen-14B-Q6_K.gguf -ngl 15,18,20,25,30 -n 1000

Device 0: NVIDIA GeForce RTX 3080 Ti, compute capability 8.6, VMM: yes

model size params backend ngl test t/s
qwen2 14B Q6_K 11.29 GiB 14.77 B CUDA 15 pp512 490.09 ± 191.57
qwen2 14B Q6_K 11.29 GiB 14.77 B CUDA 15 tg1000 4.52 ± 0.04
qwen2 14B Q6_K 11.29 GiB 14.77 B CUDA 18 pp512 629.45 ± 14.33
qwen2 14B Q6_K 11.29 GiB 14.77 B CUDA 18 tg1000 4.93 ± 0.03
qwen2 14B Q6_K 11.29 GiB 14.77 B CUDA 20 pp512 685.08 ± 14.48
qwen2 14B Q6_K 11.29 GiB 14.77 B CUDA 25 pp512 787.79 ± 18.55

$ llama-bench -m DeepSeek_R1_Distill/unsloth/DeepSeek-R1-Distill-Qwen-14B-Q5_K_M.gguf -ngl 20,25
,30,35 -n 1000
ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no
ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
ggml_cuda_init: found 1 CUDA devices:
Device 0: NVIDIA GeForce RTX 3080 Ti, compute capability 8.6, VMM: yes

model size params backend ngl test t/s
qwen2 14B Q5_K - Medium 9.78 GiB 14.77 B CUDA 20 pp512 735.40 ± 7.36
qwen2 14B Q5_K - Medium 9.78 GiB 14.77 B CUDA 20 tg1000 5.74 ± 0.12
qwen2 14B Q5_K - Medium 9.78 GiB 14.77 B CUDA 25 pp512 829.91 ± 7.98
qwen2 14B Q5_K - Medium 9.78 GiB 14.77 B CUDA 25 tg1000 6.77 ± 0.16
^C

DeepSeek-R1-Distill-Qwen-32B

320만개 파라미터를 가진 Deepssek 와 Qwen-32B 를 distill 한 버전이다.

  • unsloth/DeepSeek-R1-Distill-Qwen-32B-Q3
  • unsloth/DeepSeek-R1-Distill-Qwen-32B-Q2

DeepSeek-R1-Distill-Qwen-32B-Q3_K_M.gguf

1
$ llama-bench -m unsloth/DeepSeek-R1-Distill-Qwen-32B-Q3_K_M.gguf -ngl 27,30,33,35 -n 1000

Device 0: NVIDIA GeForce RTX 3080 Ti, compute capability 8.6, VMM: yes

model size params backend ngl test t/s
qwen2 32B Q3_K - Medium 14.84 GiB 32.76 B CUDA 27 pp512 392.53 ± 2.94
qwen2 32B Q3_K - Medium 14.84 GiB 32.76 B CUDA 27 tg1000 3.76 ± 0.02
qwen2 32B Q3_K - Medium 14.84 GiB 32.76 B CUDA 30 pp512 411.41 ± 4.29
qwen2 32B Q3_K - Medium 14.84 GiB 32.76 B CUDA 30 tg1000 4.04 ± 0.02
qwen2 32B Q3_K - Medium 14.84 GiB 32.76 B CUDA 33 pp512 362.17 ± 93.15
qwen2 32B Q3_K - Medium 14.84 GiB 32.76 B CUDA 33 tg1000 4.11 ± 0.01
qwen2 32B Q3_K - Medium 14.84 GiB 32.76 B CUDA 35 pp512 427.65 ± 24.95
qwen2 32B Q3_K - Medium 14.84 GiB 32.76 B CUDA 35 tg1000 4.44 ± 0.05

정리

  • 8B 모델 대비 확실히 1/10로 반응시간이 느려졌다. 그래서 실행해서 프롬프트 테스트하기 버겁다.
  • ngl 당 걸린 시간이 너무 오래 걸린다. 측정을 못했지만 20분 이상 걸리는 것 같다.

DeepSeek-R1-Distill-Qwen-32B-Q2_K.gguf

1
$ llama-bench -m DeepSeek_R1_Distill/unsloth/DeepSeek-R1-Distill-Qwen-32B-Q2_K.gguf -ngl 25,28,30,33,35 -n 1000

Device 0: NVIDIA GeForce RTX 3080 Ti, compute capability 8.6, VMM: yes

model size params backend ngl test t/s
qwen2 32B Q2_K - Medium 11.46 GiB 32.76 B CUDA 25 pp512 360.50 ± 104.74
qwen2 32B Q2_K - Medium 11.46 GiB 32.76 B CUDA 25 tg1000 4.49 ± 0.07
qwen2 32B Q2_K - Medium 11.46 GiB 32.76 B CUDA 28 pp512 422.67 ± 6.60
qwen2 32B Q2_K - Medium 11.46 GiB 32.76 B CUDA 28 tg1000 4.83 ± 0.03
qwen2 32B Q2_K - Medium 11.46 GiB 32.76 B CUDA 30 pp512 466.25 ± 3.99

정리

  1. 320만개 파라미터는 RTX3080TI 에서 무리이다.
  2. 80만개 파라미터를 가진 모델은 돌릴만 하다.

RTX 3080Ti 에서 적절한 ngl 표.

model size params backend ngl test t/s
llama3-Korean-Bllossom-8B-Q4_K 4.58 GiB 8.03 B CUDA 40 pp512 3483.66 ± 259.95
llama3-Korean-Bllossom-8B-Q4_K 4.58 GiB 8.03 B CUDA 40 tg1000 89.85 ± 2.06
llama-3.1-korean-reasoning-8b-instruct-q8_0 7.95 GiB 8.03 B CUDA 35 pp512 3733.38 ± 187.10
llama-3.1-korean-reasoning-8b-instruct-q8_0 7.95 GiB 8.03 B CUDA 35 tg1000 73.87 ± 3.13