'2026/04'에 해당되는 글 42건

  1. 2026.04.19 llm tokenizer - phi3
  2. 2026.04.18 줍줍 성공?
  3. 2026.04.17 llm tokenizer
  4. 2026.04.17 llama.cpp
  5. 2026.04.17 lm studio
  6. 2026.04.17 사람의 욕심은 끝이없고 - ollama multiple GPU support
  7. 2026.04.16 ollama with 1080 Ti
  8. 2026.04.16 그래픽 카드 교체!
  9. 2026.04.15 쏘쏘
  10. 2026.04.14 금융치료

llama나 gemma 받으려니 먼가 모르겠어서 만만한(?) ms의 phi3를 받아서 분석!

(gemma나 llama 는 저장소 접근권한 요청.. gate model 이라고 뜨는데 언제 승인되려나)

[링크 : https://huggingface.co/docs/transformers/model_doc/phi3]

 

~/.cache/huggingface/hub/models--microsoft--Phi-3-mini-4k-instruct/snapshots/f39ac1d28e925b323eae81227eaba4464caced4e$ ls -al
합계 12
drwxrwxr-x 2 minimonk minimonk 4096  4월 19 21:58 .
drwxrwxr-x 3 minimonk minimonk 4096  4월 19 21:58 ..
lrwxrwxrwx 1 minimonk minimonk   52  4월 19 21:58 added_tokens.json -> ../../blobs/178968dec606c790aa335e9142f6afec37288470
lrwxrwxrwx 1 minimonk minimonk   52  4월 19 21:58 config.json -> ../../blobs/b9b031fadda61a035b2e8ceb4362cbf604002b21
lrwxrwxrwx 1 minimonk minimonk   52  4월 19 21:58 special_tokens_map.json -> ../../blobs/c6a944b4d49ce5d79030250ed6bdcbb1a65dfda1
lrwxrwxrwx 1 minimonk minimonk   52  4월 19 21:58 tokenizer.json -> ../../blobs/88ec145f4e7684c009bc6d55df24bb82c7d3c379
lrwxrwxrwx 1 minimonk minimonk   76  4월 19 21:58 tokenizer.model -> ../../blobs/9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347
lrwxrwxrwx 1 minimonk minimonk   52  4월 19 21:58 tokenizer_config.json -> ../../blobs/67aa82cddb4d66391ddf31ff99f059239bd2d1e7

 

tokenizer.json 열어보니 아래처럼 토큰이 나오는데..

어우.. 이런 추세(?) 라면 한글은 한글짜 단위로 토큰이라 난리가 나겠는데?

gpt 도움으로 저런 희한한 문자열 코드 기반으로 검색이 되는걸 알았네 ㄷㄷ

$ grep -P '\p{Hangul}' tokenizer.json 
      "이": 30393,
      "의": 30708,
      "다": 30709,
      "스": 30784,
      "사": 30791,
      "지": 30811,
      "리": 30826,
      "기": 30827,
      "정": 30852,
      "아": 30860,
      "한": 30877,
      "시": 30889,
      "대": 30890,
      "가": 30903,
      "로": 30906,
      "인": 30918,
      "하": 30944,
      "수": 30970,
      "주": 30981,
      "동": 31000,
      "자": 31013,
      "에": 31054,
      "니": 31063,
      "는": 31081,
      "서": 31093,
      "김": 31102,
      "성": 31126,
      "어": 31129,
      "도": 31136,
      "고": 31137,
      "일": 31153,
      "상": 31158,
      "전": 31170,
      "트": 31177,
      "소": 31189,
      "라": 31197,
      "원": 31198,
      "보": 31199,
      "나": 31207,
      "화": 31225,
      "구": 31231,
      "신": 31262,
      "부": 31279,
      "연": 31285,
      "을": 31286,
      "영": 31288,
      "국": 31293,
      "장": 31299,
      "제": 31306,
      "우": 31327,
      "공": 31334,
      "선": 31345,
      "오": 31346,
      "은": 31354,
      "미": 31362,
      "경": 31378,
      "문": 31406,
      "조": 31408,
      "마": 31417,
      "해": 31435,
      "여": 31457,
      "산": 31458,
      "비": 31487,
      "드": 31493,
      "를": 31517,
      "요": 31527,
      "유": 31533,
      "진": 31536,
      "천": 31563,
      "년": 31571,
      "세": 31578,
      "민": 31582,
      "호": 31603,
      "그": 31607,
      "현": 31680,
      "군": 31699,
      "무": 31716,
      "위": 31724,
      "안": 31734,
      "박": 31736,
      "용": 31737,
      "단": 31746,
      "면": 31747,
      "남": 31754,
      "강": 31774,
      "씨": 31781,
      "개": 31789,
      "들": 31804,
      "차": 31817,
      "학": 31822,
      "만": 31826,
      "터": 31856,
      "식": 31895,
      "과": 31906,
      "타": 31925,
      "종": 31930,
      "내": 31940,
      "중": 31941,
      "방": 31945,
      "월": 31950,
      "회": 31953,
      "모": 31962,
      "바": 31963,
      "음": 31966,
      "교": 31972,
      "재": 31973,
      "명": 31976,
      "합": 31980,
      "역": 31987,
      "백": 31989,
      "왕": 31996,

 

'프로그램 사용 > ai 프로그램' 카테고리의 다른 글

llm tokenizer  (0) 2026.04.17
llama.cpp  (0) 2026.04.17
lm studio  (0) 2026.04.17
사람의 욕심은 끝이없고 - ollama multiple GPU support  (0) 2026.04.17
ollama with 1080 Ti  (0) 2026.04.16
Posted by 구차니
개소리 왈왈/컴퓨터2026. 4. 18. 00:37

회사에서 PCB 쓰레기통에 B360에 i5-8500이 있어서 낼름

주워오고 다음날 히트싱크랑 백패널이 있어서 가져왔는데 얘 짝이 맞는듯

그 와중에 먼가 히트싱크가 높이가 낮아서 좀 더 좋은걸로 갈아줘야 하나 싶고..

 

솔찍히 USB-C 달린 건 처음보고. 회사 노트북 10세대 제외하면, 데탑으로 8세대는 첨 보는 듯 

메뉴얼 찾아봐도 usb type-c 에 DP ALT mode 지원되는지 말이 없다. 고속 충전이라던가?

 

m.2 두개에 PCIe 3.0 x16 / x1 * 2

TPM 커넥터도 있긴한데 TPM을 사긴 좀 돈이 아쉽고..

램은 최대 64GB 4DIMM 이니까 16GB * 4 까지 구성가능.

 

묘하게 레거시가 많은 보드다(PS/2 라던가 COM / LPT..)

후면 입/출력 포트
2 x USB 3.1 Gen 2 (teal blue)Type-A, up to 10Gbps,1 x USB 3.1 Gen 1 USB Type-CTM up to 5Gbps,1 x PS/2 keyboard (purple),1 x PS/2 mouse (green),1 x DVI-D,1 x D-Sub,1 x 8-channel Audio I/O,1 x HDMI,1 x LAN (RJ45) port(s),2 x USB 2.0

내부 입출력 포트
2 x M.2 Socket 3 for M Key, type 2242/2260/2280 devices,1 x LPT header,1 x Chassis intrusion header,1 x Aura RGB Strip Header,1 x USB 3.1 Gen 1(up to 5Gbps) connector(s) support(s) additional 2 USB 3.1 Gen 1 port(s) (19-pin),1 x TPM header,1 x 8-pin EATX 12V Power connectors,1 x Speaker connector,2 x USB 2.0 connector(s) support(s) additional 4 USB 2.0 port(s),1 x COM port(s) connector(s),6 x SATA 6Gb/s connector(s),1 x CPU Fan connector(s),2 x Chassis Fan connector(s),1 x S/PDIF out header(s),1 x 24-pin EATX Power connector(s),1 x Front panel audio connector(s) (AAFP),1 x Clear CMOS jumper(s),1 x System panel connector

[링크 : https://www.asus.com/kr/motherboards-components/motherboards/prime/prime-b360m-a/]

 

bios는 현재 0803 이고 2018년 6월 버전인데

 

2021년까진 지원되고 있으니 업데이트는 해봐야 할 듯. 베타는 RTX3000 시리즈용 지원이니 나랑은 상관없네.

 

 

 

 

 

아무튼 지금쓰는게 i5-7500 인데, 4 core -> 6 core 되고

50% 상승이면.. 그냥 cpu 갯수 빨아닌가?

 

[링크 : https://technical.city/ko/cpu/Core-i5-7500-vs-Core-i5-8500]

'개소리 왈왈 > 컴퓨터' 카테고리의 다른 글

그래픽 카드 교체!  (0) 2026.04.16
지를까 말까  (0) 2026.04.13
iptime 오랫만에 업데이트  (0) 2026.02.24
amd radeon software(아드레날린) 설치  (0) 2026.02.08
dp to usb-c... ?  (0) 2026.02.08
Posted by 구차니

심심해서 단어별? 토큰 인덱스를 알고 싶은데 이건 볼 방법 없나? 싶어서 조사

 

[링크 : https://makenow90.tistory.com/59]

[링크 : https://medium.com/the-research-nest/explained-tokens-and-embeddings-in-llms-69a16ba5db33]

 

AutoTokenizer.from_pretrained() 를 실행하니 먼가 즉석에서 받을 줄이야 -ㅁ-

$ python3
Python 3.10.12 (main, Mar  3 2026, 11:56:32) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from transformers import AutoTokenizer

Disabling PyTorch because PyTorch >= 2.4 is required but found 2.1.2
PyTorch was not found. Models won't be available and only tokenizers, configuration and file/data utilities can be used.
>>> 
>>> tokenizer = AutoTokenizer.from_pretrained("gpt2")
Warning: You are sending unauthenticated requests to the HF Hub. Please set a HF_TOKEN to enable higher rate limits and faster downloads.
config.json: 100%|██████████████████████████████| 665/665 [00:00<00:00, 819kB/s]
tokenizer_config.json: 100%|█████████████████| 26.0/26.0 [00:00<00:00, 37.5kB/s]
vocab.json: 1.04MB [00:00, 2.70MB/s]
merges.txt: 456kB [00:00, 1.15MB/s]
tokenizer.json: 1.36MB [00:00, 3.23MB/s]
>>> 
>>> tokenizer
GPT2Tokenizer(name_or_path='gpt2', vocab_size=50257, model_max_length=1024, padding_side='right', truncation_side='right', special_tokens={'bos_token': '<|endoftext|>', 'eos_token': '<|endoftext|>', 'unk_token': '<|endoftext|>'}, added_tokens_decoder={
50256: AddedToken("<|endoftext|>", rstrip=False, lstrip=False, single_word=False, normalized=True, special=True),
})
>>> text="안녕? hello?"
>>> tokens=tokenizer(text)
>>> tokens
{'input_ids': [168, 243, 230, 167, 227, 243, 30, 23748, 30], 'attention_mask': [1, 1, 1, 1, 1, 1, 1, 1, 1]}

[링크 : https://data-scient2st.tistory.com/224]

[링크 : https://huggingface.co/docs/transformers/model_doc/gpt2]

 

$ find ./ -name tokenizer.json
./.cache/huggingface/hub/models--gpt2/snapshots/607a30d783dfa663caf39e06633721c8d4cfcd7e/tokenizer.json

 

$ tree ~/.cache/huggingface/hub/models--gpt2/snapshots/607a30d783dfa663caf39e06633721c8d4cfcd7e/
/home/minimonk/.cache/huggingface/hub/models--gpt2/snapshots/607a30d783dfa663caf39e06633721c8d4cfcd7e/
├── config.json -> ../../blobs/10c66461e4c109db5a2196bff4bb59be30396ed8
├── merges.txt -> ../../blobs/226b0752cac7789c48f0cb3ec53eda48b7be36cc
├── tokenizer.json -> ../../blobs/4b988bccc9dc5adacd403c00b4704976196548f8
├── tokenizer_config.json -> ../../blobs/be4d21d94f3b4687e5a54d84bf6ab46ed0f8defd
└── vocab.json -> ../../blobs/1f1d9aaca301414e7f6c9396df506798ff4eb9a6

 

+

2026.04.18

windows

 

beautifier + 일부 발췌

라틴어군에 대해서 있는 것 같고 토큰으로 잘리는걸 보면 단어 단위가 아닌

단어도 막 토막난 수준으로 잘릴 느낌?

tokenizer.json vocab.json
{
  "version": "1.0",
  "truncation": null,
  "padding": null,
  "added_tokens": [
    {
      "id": 50256,
      "special": true,
      "content": "<|endoftext|>",
      "single_word": false,
      "lstrip": false,
      "rstrip": false,
      "normalized": true
    }
  ],
  "normalizer": null,
  "pre_tokenizer": {
    "type": "ByteLevel",
    "add_prefix_space": false,
    "trim_offsets": true
  },
  "post_processor": {
    "type": "ByteLevel",
    "add_prefix_space": true,
    "trim_offsets": false
  },
  "decoder": {
    "type": "ByteLevel",
    "add_prefix_space": true,
    "trim_offsets": true
  },
  "model": {
    "dropout": null,
    "unk_token": null,
    "continuing_subword_prefix": "",
    "end_of_word_suffix": "",
    "fuse_unk": false,
    "vocab": {
      "0": 15,
      "1": 16,
      "2": 17,
      "3": 18,
      "4": 19,
      "5": 20,
      "6": 21,
      "7": 22,
      "8": 23,
      "9": 24,
      "!": 0,
      "\"": 1,
      "#": 2,
      "$": 3,
      "%": 4,
      "&": 5,
      "'": 6,
      "(": 7,
      ")": 8,
      "*": 9,
      "+": 10,
      ",": 11,
      "-": 12,
      ".": 13,
      "/": 14,
      ":": 25,
      ";": 26,
      "<": 27,
      "=": 28,
      ">": 29,
      "?": 30,
      "@": 31,
      "A": 32,
      "B": 33,
      "C": 34,
      "D": 35,
      "E": 36,
      "F": 37,
      "G": 38,
      "H": 39,
      "I": 40,
      "J": 41,
      "K": 42,
      "L": 43,
      "M": 44,
      "N": 45,
      "O": 46,
      "P": 47,
      "Q": 48,
      "R": 49,
      "S": 50,
      "T": 51,
      "U": 52,
      "V": 53,
      "W": 54,
      "X": 55,
      "Y": 56,
      "Z": 57,
      "[": 58,
      "\\": 59,
      "]": 60,
      "^": 61,
      "_": 62,
      "`": 63,
      "a": 64,
      "b": 65,
      "c": 66,
      "d": 67,
      "e": 68,
      "f": 69,
      "g": 70,
      "h": 71,
      "i": 72,
      "j": 73,
      "k": 74,
      "l": 75,
      "m": 76,
      "n": 77,
      "o": 78,
      "p": 79,
      "q": 80,
      "r": 81,
      "s": 82,
      "t": 83,
      "u": 84,
      "v": 85,
      "w": 86,
      "x": 87,
      "y": 88,
      "z": 89,
      "{": 90,
      "|": 91,
      "}": 92,
      "~": 93,
      "¡": 94,
      "¢": 95,
      "£": 96,
      "¤": 97,
      "¥": 98,
      "¦": 99,
      "he": 258,
      "in": 259,
      "re": 260,
      "on": 261,
      "Ġthe": 262,
      "er": 263,
      "Ġs": 264,
      "at": 265,
      "Ġw": 266,
      "Ġo": 267,
      "en": 268,
      "Ġc": 269,
      "it": 270,
      "is": 271,
      "an": 272,
      "or": 273,
      "es": 274,
      "Ġb": 275,
      "ed": 276,
      "Ġf": 277,
      "ing": 278,
      "Ġp": 279,
      "ou": 280,
      "Ġan": 281,
      "al": 282,
      "ar": 283,
      "Ġto": 284,
      "Ġm": 285,
      "Ġof": 286,
      "Ġin": 287,
      "Ġd": 288,
      "Ġh": 289,
      "Ġand": 290,
      "ic": 291,
      "as": 292,
      "le": 293,
      "Ġth": 294,
      "ion": 295,
      "om": 296,
      "ll": 297,
      "ent": 298,
      "Ġn": 299,
      "Ġl": 300,
      "st": 301,
      "Ġre": 302,
      "ve": 303,
      "Ġe": 304,
      "ro": 305,
      "ly": 306,
      "Ġbe": 307,
      "Ġg": 308,
      "ĠT": 309,
      "ct": 310,
      "ĠS": 311,
      "id": 312,
      "ot": 313,
      "ĠI": 314,
      "ut": 315,
      "et": 316,
      "ĠA": 317,
      "Ġis": 318,
      "Ġon": 319,
      "im": 320,
      "am": 321,
      "ow": 322,
      "ay": 323,
      "ad": 324,
      "se": 325,
      "Ġthat": 326,
      "ĠC": 327,
      "ig": 328,
      "Ġfor": 329,
      "ac": 330,
      "Ġy": 331,
      "ver": 332,
      "ur": 333,
      "Ġu": 334,
      "ld": 335,
      "Ġst": 336,
      "ĠM": 337,
      "'s": 338,
      "Ġhe": 339,
      "Ġit": 340,
      "ation": 341,
      "ith": 342,
      "ir": 343,
      "ce": 344,
      "Ġyou": 345,
      "il": 346,
      "ĠB": 347,
      "Ġwh": 348,
      "ol": 349,
      "ĠP": 350,
      "Ġwith": 351,
      "Ġ1": 352,
      "ter": 353,
      "ch": 354,
      "Ġas": 355,
      "Ġwe": 356,
      "Ġ(": 357,
      "nd": 358,
      "ill": 359,
      "ĠD": 360,
      "if": 361,
      "Ġ2": 362,
      "ag": 363,
      "ers": 364,
      "ke": 365,
      "Ġ\"": 366,
      "ĠH": 367,
      "em": 368,
      "Ġcon": 369,
      "ĠW": 370,
      "ĠR": 371,
      "her": 372,
      "Ġwas": 373,
      "Ġr": 374,
      "od": 375,
      "ĠF": 376,
      "ul": 377,
      "ate": 378,
      "Ġat": 379,
      "ri": 380,
      "pp": 381,
      "ore": 382,
      "ĠThe": 383,
      "Ġse": 384,
      "us": 385,
      "Ġpro": 386,
      "Ġha": 387,
      "um": 388,
      "Ġare": 389,
      "Ġde": 390,
      "ain": 391,
      "and": 392,





































{
  "0": 15,
  "1": 16,
  "2": 17,
  "3": 18,
  "4": 19,
  "5": 20,
  "6": 21,
  "7": 22,
  "8": 23,
  "9": 24,
  "!": 0,
  "\"": 1,
  "#": 2,
  "$": 3,
  "%": 4,
  "&": 5,
  "'": 6,
  "(": 7,
  ")": 8,
  "*": 9,
  "+": 10,
  ",": 11,
  "-": 12,
  ".": 13,
  "/": 14,
  ":": 25,
  ";": 26,
  "<": 27,
  "=": 28,
  ">": 29,
  "?": 30,
  "@": 31,
  "A": 32,
  "B": 33,
  "C": 34,
  "D": 35,
  "E": 36,
  "F": 37,
  "G": 38,
  "H": 39,
  "I": 40,
  "J": 41,
  "K": 42,
  "L": 43,
  "M": 44,
  "N": 45,
  "O": 46,
  "P": 47,
  "Q": 48,
  "R": 49,
  "S": 50,
  "T": 51,
  "U": 52,
  "V": 53,
  "W": 54,
  "X": 55,
  "Y": 56,
  "Z": 57,
  "[": 58,
  "\\": 59,
  "]": 60,
  "^": 61,
  "_": 62,
  "`": 63,
  "a": 64,
  "b": 65,
  "c": 66,
  "d": 67,
  "e": 68,
  "f": 69,
  "g": 70,
  "h": 71,
  "i": 72,
  "j": 73,
  "k": 74,
  "l": 75,
  "m": 76,
  "n": 77,
  "o": 78,
  "p": 79,
  "q": 80,
  "r": 81,
  "s": 82,
  "t": 83,
  "u": 84,
  "v": 85,
  "w": 86,
  "x": 87,
  "y": 88,
  "z": 89,
  "{": 90,
  "|": 91,
  "}": 92,
  "~": 93,
  "¡": 94,
  "¢": 95,
  "£": 96,
  "¤": 97,
  "¥": 98,
  "¦": 99,
  "he": 258,
  "in": 259,
  "re": 260,
  "on": 261,
  "Ġthe": 262,
  "er": 263,
  "Ġs": 264,
  "at": 265,
  "Ġw": 266,
  "Ġo": 267,
  "en": 268,
  "Ġc": 269,
  "it": 270,
  "is": 271,
  "an": 272,
  "or": 273,
  "es": 274,
  "Ġb": 275,
  "ed": 276,
  "Ġf": 277,
  "ing": 278,
  "Ġp": 279,
  "ou": 280,
  "Ġan": 281,
  "al": 282,
  "ar": 283,
  "Ġto": 284,
  "Ġm": 285,
  "Ġof": 286,
  "Ġin": 287,
  "Ġd": 288,
  "Ġh": 289,
  "Ġand": 290,
  "ic": 291,
  "as": 292,
  "le": 293,
  "Ġth": 294,
  "ion": 295,
  "om": 296,
  "ll": 297,
  "ent": 298,
  "Ġn": 299,
  "Ġl": 300,
  "st": 301,
  "Ġre": 302,
  "ve": 303,
  "Ġe": 304,
  "ro": 305,
  "ly": 306,
  "Ġbe": 307,
  "Ġg": 308,
  "ĠT": 309,
  "ct": 310,
  "ĠS": 311,
  "id": 312,
  "ot": 313,
  "ĠI": 314,
  "ut": 315,
  "et": 316,
  "ĠA": 317,
  "Ġis": 318,
  "Ġon": 319,
  "im": 320,
  "am": 321,
  "ow": 322,
  "ay": 323,
  "ad": 324,
  "se": 325,
  "Ġthat": 326,
  "ĠC": 327,
  "ig": 328,
  "Ġfor": 329,
  "ac": 330,
  "Ġy": 331,
  "ver": 332,
  "ur": 333,
  "Ġu": 334,
  "ld": 335,
  "Ġst": 336,
  "ĠM": 337,
  "'s": 338,
  "Ġhe": 339,
  "Ġit": 340,
  "ation": 341,
  "ith": 342,
  "ir": 343,
  "ce": 344,
  "Ġyou": 345,
  "il": 346,
  "ĠB": 347,
  "Ġwh": 348,
  "ol": 349,
  "ĠP": 350,
  "Ġwith": 351,
  "Ġ1": 352,
  "ter": 353,
  "ch": 354,
  "Ġas": 355,
  "Ġwe": 356,
  "Ġ(": 357,
  "nd": 358,
  "ill": 359,
  "ĠD": 360,
  "if": 361,
  "Ġ2": 362,
  "ag": 363,
  "ers": 364,
  "ke": 365,
  "Ġ\"": 366,
  "ĠH": 367,
  "em": 368,
  "Ġcon": 369,
  "ĠW": 370,
  "ĠR": 371,
  "her": 372,
  "Ġwas": 373,
  "Ġr": 374,
  "od": 375,
  "ĠF": 376,
  "ul": 377,
  "ate": 378,
  "Ġat": 379,
  "ri": 380,
  "pp": 381,
  "ore": 382,
  "ĠThe": 383,
  "Ġse": 384,
  "us": 385,
  "Ġpro": 386,
  "Ġha": 387,
  "um": 388,
  "Ġare": 389,
  "Ġde": 390,
  "ain": 391,
  "and": 392,

 

+

>>> tokenizer = AutoTokenizer.from_pretrained("google/gemma-4-E2B")
config.json: 4.91kB [00:00, 8.83MB/s]
C:\Users\minimonk\AppData\Local\Programs\Python\Python313\Lib\site-packages\huggingface_hub\file_download.py:138: UserWarning: `huggingface_hub` cache-system uses symlinks by default to efficiently store duplicated files but your machine does not support them in C:\Users\minimonk\.cache\huggingface\hub\models--google--gemma-4-E2B. Caching files will still work but in a degraded version that might require more space on your disk. This warning can be disabled by setting the `HF_HUB_DISABLE_SYMLINKS_WARNING` environment variable. For more details, see https://huggingface.co/docs/huggingface_hub/how-to-cache#limitations.
To support symlinks on Windows, you either need to activate Developer Mode or to run Python as an administrator. In order to activate developer mode, see this article: https://docs.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development
  warnings.warn(message)
tokenizer_config.json: 100%|██████████████████████████████████████████████████████████| 906/906 [00:00<00:00, 2.57MB/s]
tokenizer.json: 100%|█████████████████████████████████████████████████████████████| 32.2M/32.2M [00:02<00:00, 13.3MB/s]

 

 

'프로그램 사용 > ai 프로그램' 카테고리의 다른 글

llm tokenizer - phi3  (0) 2026.04.19
llama.cpp  (0) 2026.04.17
lm studio  (0) 2026.04.17
사람의 욕심은 끝이없고 - ollama multiple GPU support  (0) 2026.04.17
ollama with 1080 Ti  (0) 2026.04.16
Posted by 구차니

ollama 보다 성능이 좋게 나온다는데 한 번 쓰는법 찾아봐야지

[링크 : https://peekaboolabs.ai/blog/ollama-vs-llama-cpp-guide]

[링크 :https://news.hada.io/topic?id=28622]

[링크 : https://github.com/ggml-org/llama.cpp]

 

official은 아니지만 윈도우용 pre-built binary가 존재는 하는 듯.

[링크 : https://github.com/HPUhushicheng/llama.cpp_windows]

 

일단 python 라이브러리

from llama_cpp import Llama

llm = Llama(
      model_path="./models/7B/llama-model.gguf",
      # n_gpu_layers=-1, # Uncomment to use GPU acceleration
      # seed=1337, # Uncomment to set a specific seed
      # n_ctx=2048, # Uncomment to increase the context window
)
output = llm(
      "Q: Name the planets in the solar system? A: ", # Prompt
      max_tokens=32, # Generate up to 32 tokens, set to None to generate up to the end of the context window
      stop=["Q:", "\n"], # Stop generating just before the model would generate a new question
      echo=True # Echo the prompt back in the output
) # Generate a completion, can also call create_completion
print(output)

[링크 : https://pypi.org/project/llama-cpp-python/]

 

OpenCL 드라이버 인스톨 된 거 확인하고 

LLAMA_CLBLAST=1 make

이렇게 컴파일 하면 된다고 합니다. 

make인걸 보니 리눅스에서 컴파일하는 걸 테고 윈도에서는 cmake 써야겠죠.

[링크 : https://arca.live/b/alpaca/76969814]

 

전체 연산이 아니라 token 생성만 가속인가?

OpenCL Token Generation Acceleration

[링크 : https://github.com/ggml-org/llama.cpp/releases/tag/master-2e6cd4b]

 

To get this running on the XTX I had to install the latest 5.5 version of the AMD linux drivers, which are released but not available from the normal AMD download page yet. You can get the deb for the installer here. I installed with amdgpu-install --usecase=opencl,rocm and installed CLBlast after apt install libclblast-dev.

Confirm opencl is working with sudo clinfo (did not find the GPU device unless I run as root).

Build llama.cpp (with merged pull) using LLAMA_CLBLAST=1 make.

[링크 : https://www.reddit.com/r/LocalLLaMA/comments/13m8li2/finally_got_a_model_running_on_my_xtx_using/]

'프로그램 사용 > ai 프로그램' 카테고리의 다른 글

llm tokenizer - phi3  (0) 2026.04.19
llm tokenizer  (0) 2026.04.17
lm studio  (0) 2026.04.17
사람의 욕심은 끝이없고 - ollama multiple GPU support  (0) 2026.04.17
ollama with 1080 Ti  (0) 2026.04.16
Posted by 구차니

맥북에서 lm studio로 openclaw 이런 이야기가 많이 나오길래 검색

ollama 처럼 모델 불러서 쓸 수 있나?

import lmstudio as lms

EXAMPLE_MESSAGES = (
    "My hovercraft is full of eels!",
    "I will not buy this record, it is scratched."
)

model = lms.llm()
chat = lms.Chat("You are a helpful shopkeeper assisting a foreign traveller")
for message in EXAMPLE_MESSAGES:
    chat.add_user_message(message)
    print(f"Customer: {message}")
    response = model.respond(chat)
    chat.add_assistant_response(response)
    print(f"Shopkeeper: {response}")

[링크 : https://pypi.org/project/lmstudio/]

 

저 모델 명칭은 어디서 얻고, 어디서 다운로드 받는걸까?

-> 허깅스페이스 모델명으로 검색되서 받아오는 듯 gguf 포맷으로

const model = await client.llm.load("qwen2.5-7b-instruct", {
  config: {
    contextLength: 8192,
    gpu: {
      ratio: 0.5,
    },
  },
});

[링크 : https://lmstudio.ai/docs/typescript/llm-prediction/parameters]

 

[링크 : https://lmstudio.ai/docs/python]

[링크 : https://lmstudio.ai/]

'프로그램 사용 > ai 프로그램' 카테고리의 다른 글

llm tokenizer  (0) 2026.04.17
llama.cpp  (0) 2026.04.17
사람의 욕심은 끝이없고 - ollama multiple GPU support  (0) 2026.04.17
ollama with 1080 Ti  (0) 2026.04.16
트랜스포머 모델 입/출력  (0) 2026.04.12
Posted by 구차니

google ai 요약에 따르면

ollama는 VRAM 합산해서 큰 용량의 모델을 돌릴수 있다고 한다.

 

Ollama supports multiple GPUs (both NVIDIA and AMD) by automatically splitting model layers across available VRAM, allowing users to run large models that exceed the capacity of a single card.
Reddit +1
VRAM Aggregation and Usage
  • Total Capacity: Ollama sums the total VRAM across all detected GPUs (e.g., two 16GB GPUs behave as 32GB).
  • Layer Splitting: If a model cannot fit into one GPU, Ollama splits the layers, distributing the load between GPU (fast) and system RAM (slow).
  • Example Scenario: A 30GB Q4_K_M model (e.g., Llama 3 70B) can be split across two 16GB or two 24GB GPUs, loading roughly 50% on each.
  • KV Cache: A portion of VRAM is reserved for the context window (KV cache), which can take several GBs depending on context length.
    Reddit +3
Multi-GPU Performance Considerations
  • Optimal Use: If the model fits into a single GPU, Ollama will typically use only one card for the best performance, as splitting increases data transfer between cards.
  • Performance Penalty: Partial offloading (spreading a model across both GPU and CPU) can cause performance to degrade by 5–20x.
  • Mixing GPUs: You can mix different GPUs (e.g., a 3090 24GB + 1660 6GB), but the overall performance might be bottlenecked by the slower card.
  • Multi-Instance Setup: To maximize performance on multiple GPUs, you can run multiple instances of Ollama on different ports, each assigned to a specific GPU (e.g., using CUDA_VISIBLE_DEVICES).
    Reddit +4
How to Configure
  • NVIDIA: Set CUDA_VISIBLE_DEVICES=0,1 (comma-separated IDs) to enable multi-GPU.
  • AMD: Use ROCR_VISIBLE_DEVICES=0,1.
  • Automatic Split: By default, Ollama handles the split automatically, but you can set PARAMETER num_gpu 999 in a Modelfile to force all layers to be spread across all available GPUs.
    LocalLLM.in +1
VRAM Requirements by Model Size
  • Entry-level (3-4GB VRAM): 3-4B models (Q4_K_M).
  • Mid-range (6-8GB VRAM): 7-9B models (Q4_K_M).
  • High-end (10-12GB VRAM): 12-14B models (Q4_K_M).
  • Dual GPU Setup (16-24GB VRAM): 22-35B models (Gemma 3 27B, Qwen3 32B).
  • Workstation (48GB+ VRAM): 70B+ models (Llama 3.3 70B).
    LocalLLM.in

 

그래서 dual GPU setup 으로 이야기가 나오는데,

아무튼 24G VRAM 두개 해서 48G 로 해서 70B 모델을 돌릴수 있다고 한다.

하나 더 지르고.. 메인보드도 sli/crossfire 지원으로 바꾸고 파워도 올리고.. 해야하나?

Can I use multiple GPUs with Ollama for larger models?
Yes, Ollama supports multi-GPU configurations for NVIDIA and AMD cards. For NVIDIA, set CUDA_VISIBLE_DEVICES to comma-separated GPU IDs to distribute model layers across multiple GPUsThis enables running 70B models on dual 24GB GPUs (48GB total) that wouldn't fit on a single card. For AMD GPUs, use ROCR_VISIBLE_DEVICES with the same approach to leverage combined VRAM across multiple cards.

[링크 : https://localllm.in/blog/ollama-vram-requirements-for-local-llms]

'프로그램 사용 > ai 프로그램' 카테고리의 다른 글

llama.cpp  (0) 2026.04.17
lm studio  (0) 2026.04.17
ollama with 1080 Ti  (0) 2026.04.16
트랜스포머 모델 입/출력  (0) 2026.04.12
ollama 소스코드  (0) 2026.04.12
Posted by 구차니

정말 깨끗하게 잘 도착함

아래는 1060 6GB. 그래도 어찌어찌 케이스에 잘 우겨넣었는데\

6pin + 8pin 전원을 추가로 넣어야해서 어째 불안불안.. (500W 라서..)

 

 

와우. 메모리가 넉넉해! 더 높은걸 해도 되겠어!!! 싶었는데

해보니 gemma4:e4b는 cpu+gpu로 가속된다. 메모리가 12기가는 되었어야 했나.. 쩝

 

나름 가벼운 모델임에도 메모리 8.5기가/11기가 GPU 81% 소모하네 ㄷㄷ

Thu Apr 16 21:49:46 2026
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 582.28                 Driver Version: 582.28         CUDA Version: 13.0     |
+-----------------------------------------+------------------------+----------------------+
| GPU  Name                  Driver-Model | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce GTX 1080 Ti   WDDM  |   00000000:01:00.0  On |                  N/A |
| 30%   56C    P2            207W /  250W |    8570MiB /  11264MiB |     81%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A            2348      C   ...al\Programs\Ollama\ollama.exe      N/A      |
|    0   N/A  N/A            3644    C+G   ...Chrome\Application\chrome.exe      N/A      |
|    0   N/A  N/A            7548      C   ...al\Programs\Ollama\ollama.exe      N/A      |
|    0   N/A  N/A            8708    C+G   ..._8wekyb3d8bbwe\Calculator.exe      N/A      |
|    0   N/A  N/A            8796    C+G   ...h_cw5n1h2txyewy\SearchApp.exe      N/A      |
|    0   N/A  N/A            9860    C+G   ...wy\InputApp\TextInputHost.exe      N/A      |
|    0   N/A  N/A           13620      C   ...al\Programs\Ollama\ollama.exe      N/A      |
|    0   N/A  N/A           14220    C+G   ...wekyb3d8bbwe\WinStore.App.exe      N/A      |
+-----------------------------------------------------------------------------------------+

 

일단.. 7.2GB 모델까진 한번에 올라가는데 9.6GB 는 사용가능한 메모리가 없어져서 인가.. 한 4기가? 5기가 올리고 만다.

C:\>ollama ls
NAME               ID              SIZE      MODIFIED
gemma4:latest      c6eb396dbd59    9.6 GB    2 hours ago
gemma4:e4b         c6eb396dbd59    9.6 GB    4 days ago
gemma4:e2b         7fbdbf8f5e45    7.2 GB    5 days ago
gemma3:1b          8648f39daa8f    815 MB    5 days ago
llama3.2:latest    a80c4f17acd5    2.0 GB    5 days ago
llama3.2:3b        a80c4f17acd5    2.0 GB    5 days ago

 

어떻게 100% GPU 강제 못하나 ㅠㅠ

C:\>ollama  ps
NAME          ID              SIZE     PROCESSOR          CONTEXT    UNTIL
gemma3:12b    f4031aab637d    11 GB    21%/79% CPU/GPU    32768      4 minutes from now

 

와우 82.71 토큰/초

C:\>ollama run gemma4:e2b --verbose
>>> 안녕 젬마야? 너에 대해서 설명해줘
Thinking...
Thinking Process:

1.  **Analyze the Request:** The user asked in Korean, "안녕 젬마야? 너에 대해서 설명해줘" (Hello Gemma? Tell me about yourself).
2.  **Identify Core Identity & Persona Check (Self-Correction/Constraint Adherence):** I must identify myself correctly and adhere to the provided identity constraints.
    *   Name: Gemma 4.
    *   Developer: Google DeepMind.
    *   Nature: Large Language Model (open weights).
    *   Knowledge/Function: Process text/images, generate text.
3.  **Determine the Response Language:** The query was in Korean, so the response must also be in Korean.
4.  **Draft the Explanation (Key Points to Include):**
    *   Greeting.
    *   Name/Identity (Gemma 4).
    *   Developer (Google DeepMind).
    *   Nature (Large Language Model, open weights).
    *   Function (Processing information, generating responses).
5.  **Refine the Korean Translation (Internal Monologue & Polishing):**

    *   *Greeting:* 안녕하세요. (Hello.)
    *   *Identity:* 저는 Gemma 4입니다. (I am Gemma 4.)
    *   *Developer/Nature:* 저는 Google DeepMind에서 개발한 대규모 언어 모델(LLM)입니다. (I am a Large Language Model developed by Google DeepMind.)
    *   *Key Feature:* 저는 오픈 웨이트 모델로, 다양한 질문에 답하고, 텍스트를 생성하며, 정보를 처리하는 데 도움을 드릴 수 있습니다. (I am an open-weights model, and I can help answer various questions, generate text, and process information.)
    *   *Closing/Offer:* 무엇이 궁금하신가요? (What are you curious about?)

6.  **Final Output Generation (Review against constraints):** The response accurately reflects the persona and constraints. (Ready to output.)
...done thinking.

안녕하세요! 저는 **Gemma 4**입니다.

저에 대해 몇 가지 설명해 드릴게요.

1. **정체성:** 저는 Google DeepMind에서 개발한 **대규모 언어 모델(Large Language Model, LLM)**입니다.
2. **특징:** 저는 오픈 웨이트 모델로 설계되었으며, 방대한 양의 텍스트 데이터를 학습하여 질문에 답하고, 텍스트를 생성하며, 정보를 요약하고 다양한 종류의 언어 관련 작업을 수행할 수 있습니다.
3. **기능:** 저는 텍스트 입력과 이미지를 이해하고 처리할 수 있으며, 사용자님과의 대화를 통해 정보를 제공하고 도움을 드리는 것을 목표로 합니다.
4. **지식 범위:** 저의 지식은 학습된 데이터를 기반으로 하며, 특정 시점(저의 지식 차단 시점은 2025년 1월입니다)까지의 정 보를 기반으로 답변을 제공합니다.

궁금한 점이 있으시면 무엇이든 물어봐 주세요! 😊

total duration:       8.6122077s
load duration:        255.4776ms
prompt eval count:    28 token(s)
prompt eval duration: 95.322ms
prompt eval rate:     293.74 tokens/s
eval count:           647 token(s)
eval duration:        7.8226394s
eval rate:            82.71 tokens/s

 

C:\>ollama run gemma3:1b --verbose
>>> 안녕? 너에 대해서 설명해줘
안녕하세요! 저는 구글에서 훈련한 대규모 언어 모델입니다.

**간단히 말해서, 저는 텍스트와 이미지를 입력으로 받아 텍스트를 생성하는 데 특화된 AI 모델입니다.**

좀 더 자세히 설명하면 다음과 같습니다:

*   **훈련 데이터:** 저는 방대한 양의 텍스트 데이터를 학습했습니다. 여기에는 책, 웹사이트, 기사, 코드 등 다양한 종류
의 텍스트가 포함됩니다.
*   **기능:** 저는 질문에 답하고, 텍스트를 요약하고, 번역하고, 창의적인 텍스트를 생성하고, 코드 등을 수행할 수 있습
니다.
*   **저의 한계:** 저는 아직 완벽하지 않습니다. 때로는 사실과 다른 정보나 편향된 내용을 생성할 수 있습니다. 또한, 저
 또한 인간과 같은 감정을 가지고 있지 않으므로, 인간적인 상호작용에는 한계가 있습니다.
*   **현재 위치:** 저는 지속적으로 학습하고 개선되고 있습니다.

**제가 무엇을 도와드릴까요?** 궁금한 점이나 특정 작업을 위해 제가 할 수 있는 것이 있다면 말씀해주세요!

total duration:       2.6137723s
load duration:        278.3931ms
prompt eval count:    18 token(s)
prompt eval duration: 168.7498ms
prompt eval rate:     106.67 tokens/s
eval count:           246 token(s)
eval duration:        1.9665249s
eval rate:            125.09 tokens/s

 

C:\>ollama run llama3.2:3b --verbose
>>> 안녕? 너에 대해서 설명해줘
안녕하세요! 난 인공지능(IA) 기반 챗bot으로, human-like 대화를 통해 사용자와 대화할 수 있는 프로그램입니다.

저는 지식 및ความรู้를 가집니다. 사용자가 물어볼 질문이나 문제에 대해 정보를 제공할 때, 저는 그 질문에 대한 답변을 주
어 assistance를 해줄 것입니다.

저는 다양한 주제에 대해 지식을 가지고 있으며, 사용자와의 대화를 통해 배울 수 있는 것들을 포함하여Continuous
learning을 하며 improves됩니다.

만약 사용자에게 도움을 benöt이면, 언제든지 저에게 물어보세요!

total duration:       1.6521448s
load duration:        120.741ms
prompt eval count:    35 token(s)
prompt eval duration: 31.4659ms
prompt eval rate:     1112.32 tokens/s
eval count:           135 token(s)
eval duration:        988.2004ms
eval rate:            136.61 tokens/s

 

 

컨텍스트 길이를 128k 에서 4k로 줄이니까

phi3:14b 모델이 100% GPU로 된다. 오호.. 컨텍스트 길이를 포기해야하나..

C:\>ollama run phi3:14b --verbose
>>> 안녕?
안녕하세요! 나는 지구에 살고 왔습니다. 여러분과 마음을 교환해 보겠습니다.

total duration:       2.0717119s
load duration:        21.2028ms
prompt eval count:    2593 token(s)
prompt eval duration: 274.901ms
prompt eval rate:     9432.49 tokens/s
eval count:           61 token(s)
eval duration:        1.3611884s
eval rate:            44.81 tokens/s

 

C:\>ollama ps
NAME        ID              SIZE      PROCESSOR    CONTEXT    UNTIL
phi3:14b    cf611a26b048    9.2 GB    100% GPU     4096       4 minutes from now

[링크 : https://docs.ollama.com/context-length]

 

아까는 안되더니 컨텍스트 길이 줄이니 된다.

C:\>ollama run gemma4:e4b --verbose
>>> 안녕?
Thinking...
Here's a thinking process that leads to the suggested response:

1.  **Analyze the input:** The input is "안녕?" (Annyeong?), which is a casual Korean greeting, equivalent to
"Hi?" or "Hello?"

2.  **Determine the required response type:** The response must be a natural, reciprocal greeting.

3.  **Formulate the primary greeting (Reciprocation):**
    *   The standard reply to "안녕?" is "안녕?" or "안녕하세요?" (if formal).
    *   Since the input is very casual ("안녕?"), a casual reply is appropriate.
    *   *Choice:* "안녕하세요!" or "안녕!" (The exclamation mark adds energy.)

4.  **Add conversational momentum (The "How are you?" part):** A simple greeting usually prompts a follow-up
question to keep the conversation going.
    *   Korean equivalent: "잘 지내셨어요?" (Jal jinaesyeosseoyo? - How have you been?) or "뭐 하세요?" (Mwo
haseyo? - What are you doing?).
    *   A polite, common opening is: "네, 안녕하세요! 잘 지내셨어요?" (Yes, hello! Have you been well?)

5.  **Select the best options (Offering variety):** Depending on the desired tone (casual, polite, enthusiastic),
multiple responses can be offered.

    *   **Option 1 (Standard/Friendly):** A standard greeting and question. (The safest bet).
    *   **Option 2 (Casual/Warm):** Keep it very relaxed.
    *   **Option 3 (Enthusiastic/Ready to chat):** Expressing excitement.

6.  **Final Polish (Selecting the Korean output):**

    *   *Initial Greeting:* 안녕하세요!
    *   *Follow-up:* 저도 잘 지내고 있어요. 😊 (I'm doing well too.)
    *   *Question back:* 무슨 일로 오셨나요? / 잘 지내셨어요? (What brings you here? / Have you been well?)

7.  **Construct the final Korean and English explanation.** (This results in the provided good response.)
...done thinking.

안녕하세요! 😊

(Annyeonghaseyo! / Hello!)

저는 잘 지내고 있어요. 혹시 무슨 일로 오셨나요? 😊

**[English translation and explanation:]**

*   **안녕하세요! (Annyeonghaseyo!)**: Hello! (This is the standard, polite way to respond.)
*   **저도 잘 지내고 있어요. (Jeodo jal jinaego isseoyo.)**: I'm doing well too.
*   **무슨 일로 오셨나요? (Museun illo osyeonnayo?)**: What brings you here? / What are you doing? (This is a
natural way to prompt the other person to start the topic.)

어떤 이야기를 하고 싶으세요? 😊

total duration:       12.8489232s
load duration:        293.3292ms
prompt eval count:    18 token(s)
prompt eval duration: 58.0091ms
prompt eval rate:     310.30 tokens/s
eval count:           639 token(s)
eval duration:        11.824361s
eval rate:            54.04 tokens/s

 

C:\>ollama ps
NAME          ID              SIZE     PROCESSOR    CONTEXT    UNTIL
gemma4:e4b    c6eb396dbd59    10 GB    100% GPU     4096       About a minute from now
Posted by 구차니
개소리 왈왈/컴퓨터2026. 4. 16. 21:45

1060 6GB -> 1080 Ti 11GB

 

기존설정대로 했더니 FHD 에서 224 프레임

 

4K 에 최고 품질로 했더니 80fps 와우

'개소리 왈왈 > 컴퓨터' 카테고리의 다른 글

줍줍 성공?  (0) 2026.04.18
지를까 말까  (0) 2026.04.13
iptime 오랫만에 업데이트  (0) 2026.02.24
amd radeon software(아드레날린) 설치  (0) 2026.02.08
dp to usb-c... ?  (0) 2026.02.08
Posted by 구차니

그냥 먼가 새로운 거 없이 바쁜 하루

이걸 좋은거라고 해야하나

나쁜거라고 해야하나

'개소리 왈왈 > 직딩의 비애' 카테고리의 다른 글

금융치료  (0) 2026.04.14
좀 힘든날  (0) 2026.04.13
중고나라 택배거래  (2) 2026.03.10
와 지하철 왜 이따구야?!?  (0) 2026.03.03
내가 뒤쳐지는 건가..  (0) 2026.02.16
Posted by 구차니

음.. 그래픽 카드 사니 기분이 좋아짐

 

 

(어?)

 

 

설마.. 벽돌이 오는건 아니겠지.. 

 

 

(후덜덜)

'개소리 왈왈 > 직딩의 비애' 카테고리의 다른 글

쏘쏘  (0) 2026.04.15
좀 힘든날  (0) 2026.04.13
중고나라 택배거래  (2) 2026.03.10
와 지하철 왜 이따구야?!?  (0) 2026.03.03
내가 뒤쳐지는 건가..  (0) 2026.02.16
Posted by 구차니