SD 모델에서 portrait ot usada pekora 라고 긍정 프롬프트 에서 생성하니 이상한 아저씨가 나온다.

 

몇번의 삽질하다 안되서 역시 gpt님의 도움으로(!) 어찌어찌 한걸음?

일단 checkpoint는 SDXL이 아닌 SD로 해주어야 한다.

그러니 만만(?)한 오리지널 파일로 선택

 

그리고는 embedding과

 

hyper network를 일단 생성해 본다.

 

Train 으로 가서 embedding 과 hypernetwork를 일단 선택해주고

 

파일을 받아서

 

imagemagick을 설치하고 아래의 명령으로 대 충~ 변환해준다.

mkdir -p dataset

mogrify \
    -path dataset \
    -format jpg \
    -resize 512x512^ \
    -gravity center \
    -crop 512x512+0+0 \
    +repage \
    -quality 95 \
    *.png *.bmp *.webp *.tif

 

그리고는 Dataset directory에 붙여넣고

 

일단 먼지 모르겠으니 Train Embedding을 누르니

무시무시한 시간이 뜨면서 먼가 진행이 된다.



아래의 메시지 처럼 loss와 step이 증가되는데

잘 보니까 아까 변환했던 파일명이 포함되서 나오는 듯?

Loss: 0.1782198
Step: 394
Last prompt: a dirty painting of i1683731685, art by portrait of usada pekora
Last saved embedding: <none>
Last saved image: <none>


Loss: 0.0547138
Step: 395
Last prompt: a painting of _1_1756696475_w360, art by portrait of usada pekora
Last saved embedding: <none>
Last saved image: <none>


Loss: 0.0913988
Step: 397
Last prompt: a dark painting of hPSbz8dGC0Kzj_e0C25DrQ1IkVSk1fKm3shxQYY_pNi-qD6BnEUCNIuEtYe1a1ri6IHTBFJ7gRuuSrE34KdmxQ, art by portrait of usada pekora
Last saved embedding: <none>
Last saved image: <none>


Loss: 0.0651186
Step: 398
Last prompt: a rendering of ZpuilhK8qsxjuj_Z3nPoINJNXYOYKZv72wVg-943xSclKQ_xs_qC1bJJM32gGWUuJBNEBaMaAQJQzxaJ7txuHg, art by portrait of usada pekora
Last saved embedding: <none>
Last saved image: <none>


Loss: 0.0029331
Step: 499
Last prompt: a nice painting of DhB_-h44CoXqInpAmvHWVzqKGNprsXK6bjNO0nCG0waQX72PREOmRxL9tBvqKFcuxnZULq3L3vFskLcRSeNQvA, art by portrait of usada pekora
Last saved embedding: <none>
Last saved image: <none>

 

 

콘솔창 열어보면 먼가 되는거 같긴한데..

 

gpu도 열심히 갈려 나가는 중. 으어어 온도 괜찮을까?

처음으로 gpu fan 60% 돌파!

 

cpu가 아주 노는건 아니고, 파일 퍼준다고 조금 사용되는 것 같다.

 

좀 돌다 보니 이런게 막 나온다.

일종의 evaluation 단계에서 하나 빼보는건가?

아마 학습 단계에서 500개마다 save an image  되어있는 부분이, 이렇게 이미지로 나오는 듯

 

 

학습 돌리고 나서 usada가 들어간걸 찾아보는데

safetensors는 없고 embeddings와 model/hypernetworks 에 pt 확장자로 존재한다.

/mnt/Downloads/stable-diffusion-webui$ find ./ -name *usada*
./embeddings/portrait of usada pekora.pt
./textual_inversion/2026-06-10/portrait of usada pekora
./textual_inversion/2026-06-10/portrait of usada pekora/images/portrait of usada pekora-1500.png
./textual_inversion/2026-06-10/portrait of usada pekora/images/portrait of usada pekora-3500.png
./textual_inversion/2026-06-10/portrait of usada pekora/images/portrait of usada pekora-500.png
./textual_inversion/2026-06-10/portrait of usada pekora/images/portrait of usada pekora-3000.png
./textual_inversion/2026-06-10/portrait of usada pekora/images/portrait of usada pekora-2500.png
./textual_inversion/2026-06-10/portrait of usada pekora/images/portrait of usada pekora-2000.png
./textual_inversion/2026-06-10/portrait of usada pekora/images/portrait of usada pekora-1000.png
./textual_inversion/2026-06-10/portrait of usada pekora/images/portrait of usada pekora-4000.png
./textual_inversion/2026-06-10/portrait of usada pekora/embeddings/portrait of usada pekora-500.pt
./textual_inversion/2026-06-10/portrait of usada pekora/embeddings/portrait of usada pekora-3500.pt
./textual_inversion/2026-06-10/portrait of usada pekora/embeddings/portrait of usada pekora-4000.pt
./textual_inversion/2026-06-10/portrait of usada pekora/embeddings/portrait of usada pekora-3000.pt
./textual_inversion/2026-06-10/portrait of usada pekora/embeddings/portrait of usada pekora-1000.pt
./textual_inversion/2026-06-10/portrait of usada pekora/embeddings/portrait of usada pekora-2500.pt
./textual_inversion/2026-06-10/portrait of usada pekora/embeddings/portrait of usada pekora-2000.pt
./textual_inversion/2026-06-10/portrait of usada pekora/embeddings/portrait of usada pekora-1500.pt
./textual_inversion/2026-06-10/portrait of usada pekora/image_embeddings/portrait of usada pekora-1500.png
./textual_inversion/2026-06-10/portrait of usada pekora/image_embeddings/portrait of usada pekora-3500.png
./textual_inversion/2026-06-10/portrait of usada pekora/image_embeddings/portrait of usada pekora-500.png
./textual_inversion/2026-06-10/portrait of usada pekora/image_embeddings/portrait of usada pekora-3000.png
./textual_inversion/2026-06-10/portrait of usada pekora/image_embeddings/portrait of usada pekora-2500.png
./textual_inversion/2026-06-10/portrait of usada pekora/image_embeddings/portrait of usada pekora-2000.png
./textual_inversion/2026-06-10/portrait of usada pekora/image_embeddings/portrait of usada pekora-1000.png
./textual_inversion/2026-06-10/portrait of usada pekora/image_embeddings/portrait of usada pekora-4000.png
./models/hypernetworks/portrait of usada pekora.pt

 

 26K  6월 11 00:24 'portrait of usada pekora.pt'
 84M  6월 10 23:12 'portrait of usada pekora.pt'

 26K  6월 10 23:38 'portrait of usada pekora-1000.pt'
 26K  6월 10 23:45 'portrait of usada pekora-1500.pt'
 26K  6월 10 23:53 'portrait of usada pekora-2000.pt'
 26K  6월 11 00:01 'portrait of usada pekora-2500.pt'
 26K  6월 11 00:08 'portrait of usada pekora-3000.pt'
 26K  6월 11 00:16 'portrait of usada pekora-3500.pt'
 26K  6월 11 00:24 'portrait of usada pekora-4000.pt'
 26K  6월 10 23:30 'portrait of usada pekora-500.pt'

 

txt2img 에서 refresh 해보니 아래와 같이 뜬다.

 

그냥 자동으로 추가되고, generate 누르니 아래와 같이 생성된다.

그나저나 저 이미지는 "portrait of usada pekora"  가 아니면 비슷하게라도 그려지지 않는거 보면

전체 키워드가 들어가야 하는건가?

[링크 : https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Textual-Inversion]

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

curl로 llama-swap 에게 api로 요청하기  (0) 2026.06.10
llama.cpp prompt 옵션  (0) 2026.06.10
exllama  (0) 2026.06.10
stable diffusion train  (0) 2026.06.10
gemma4-e4b it qat / gemma4-12b mtp on 1080 ti 11GB  (0) 2026.06.08
Posted by 구차니

url만 요청하면 404 나오고(웹브라우저에서도 404 뜸)

$ curl http://192.168.40.238:8080/v1/chat/completions -i
HTTP/1.1 404 Not Found
Date: Wed, 10 Jun 2026 04:59:30 GMT
Content-Length: 0

 

잘못된 모델로 요청해도 배째고(최소한 응답은 있네!)

$ curl http://192.168.40.238:8080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer my-api-key" \
  -d '{
    "model": "qwen-coder",
    "messages": [
      {
        "role": "user",
        "content": "Python으로 HTTP 서버 예제를 작성해줘."
      }
    ]
  }'
could not find suitable inference handler for qwen-coder

 

제대로 된 요청으로 돌어와야 응답을 해주는 깐깐한 녀석

$ curl http://192.168.40.238:8080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer my-api-key" \
  -d '{
    "model": "gemma4-e4b",
    "messages": [
      {
        "role": "user",
        "content": "Python으로 HTTP 서버 예제를 작성해줘."
      }
    ]
  }'

{"choices":[{"finish_reason":"stop","index":0,"message":{"role":"assistant","content":"Python은 표준 라이브러리만으로도 매우 빠르고 간단하게 HTTP 서버를 만들 수 있게 해줍니다.\n\n요구 사항에 따라 두 가지 예제를 제공해 드립니다.\n\n1. **가장 간단한 예제 (파일 서빙):** Python의 내장 `http.server` 모듈을 사용하는 방법. (가장 빠르게 서버를 띄우는 방법)\n2. **커스터마이징 예제 (맞춤 응답):** `BaseHTTPRequestHandler`를 상속받아 GET 요청 등에 대해 직접 응답 내용을 정의하는 방법. (실제 웹 개발의 기본 원리 학습)\n\n---\n\n## 💡 예제 1: 가장 간단한 HTTP 서버 (파일 서빙)\n\n이 방법은 실제 웹 프레임워크를 사용하지 않고, 현재 디렉터리에 있는 파일들을 웹에서 불러올 때(서빙할 때) 사용됩니다. 서버를 띄우는 코드를 작성할 필요 없이, 명령어 한 줄로 가능합니다.\n\n### 💻 코드 (실행 명령어)\n\n```bash\n# Python 3 환경에서 실행\npython3 -m http.server 8000\n```\n\n### 🚀 실행 방법\n\n1. 서버로 사용할 파일들(HTML, 이미지 등)이 있는 디렉터리로 이동합니다.\n2. 위의 명령어를 실행합니다.\n3. 브라우저를 열고 `http://localhost:8000` 에 접속하면 해당 디렉터리의 파일 목록이 보입니다.\n\n**✅ 장점:** 코드가 거의 필요 없고, 즉시 작동합니다.\n**❌ 단점:** 특정 URL 요청에 대해 복잡한 비즈니스 로직을 처리할 수 없습니다.\n\n---\n\n## 🛠️ 예제 2: 맞춤 응답을 처리하는 HTTP 서버 (BaseHTTPRequestHandler 사용)\n\n만약 특정 URL(`http://localhost:8000/hello`)에 접속했을 때, **사용자 정의 메시지**를 반환하고 싶다면 이 방식을 사용해야 합니다.\n\n이 코드는 `http.server` 모듈의 기본 핸들러 클래스를 상속받아, `do_GET` 메소드를 오버라이드(재정의)하여 우리가 원하는 응답을 직접 구성합니다.\n\n### 💻 코드 (`custom_server.py`)\n\n```python\nimport http.server\nimport socketserver\n\n# 사용할 포트 지정\nPORT = 8000\n\nclass CustomHTTPRequestHandler(http.server.BaseHTTPRequestHandler):\n    \"\"\"\n    HTTP 요청(GET, POST 등)을 처리하는 사용자 정의 핸들러 클래스입니다.\n    \"\"\"\n    \n    def do_GET(self):\n        \"\"\"\n        GET 요청이 들어왔을 때 실행되는 메서드입니다.\n        \"\"\"\n        print(f\"--- GET 요청 수신: {self.path} ---\")\n        \n        # 1. 특정 경로에 대한 응답 처리\n        if self.path == '/hello':\n            # 응답할 콘텐츠\n            response_content = \"안녕하세요! 이것은 커스텀 서버가 보낸 응답입니다.\"\n            \n            # HTTP 응답 헤더 설정 (상태 코드: 200 OK, Content-Type: text/plain)\n            self.send_response(200)\n            self.send_header(\"Content-type\", \"text/plain\")\n            self.send_header(\"Content-Length\", str(len(response_content)))\n            self.end_headers()\n            \n            # 응답 본문(Body) 전송\n            self.wfile.write(bytes(response_content, \"utf-8\"))\n            \n        # 2. 기본 경로 (/)에 대한 응답 처리\n        elif self.path == '/':\n            response_content = \"환영합니다! /hello 경로로 접속해 보세요.\"\n            self.send_response(200)\n            self.send_header(\"Content-type\", \"text/html\")\n            self.end_headers()\n            self.wfile.write(bytes(response_content, \"utf-8\"))\n            \n        # 3. 정의되지 않은 경로에 대한 응답 (404 Not Found)\n        else:\n            self.send_response(404)\n            self.send_header(\"Content-type\", \"text/plain\")\n            self.end_headers()\n            self.wfile.write(bytes(\"404 Not Found\", \"utf-8\"))\n\n\n# 서버를 띄우는 설정\nHandler = CustomHTTPRequestHandler\n\nwith socketserver.TCPServer((\"\", PORT), Handler) as httpd:\n    print(f\"*** 서버가 http://localhost:{PORT} 에서 실행 중입니다. ***\")\n    print(\"테스트 경로: http://localhost:8000/hello\")\n    print(\"---------------------------------------------------\")\n    try:\n        httpd.serve_forever()\n    except KeyboardInterrupt:\n        print(\"\\n서버를 종료합니다.\")\n        httpd.server_close()\n```\n\n### 🚀 실행 방법\n\n1. 위 코드를 `custom_server.py` 파일로 저장합니다.\n2. 터미널에서 다음 명령어를 실행합니다.\n   ```bash\n   python3 custom_server.py\n   ```\n3. **테스트:**\n   * `http://localhost:8000/` 에 접속하면 \"환영합니다!\"가 보입니다.\n   * `http://localhost:8000/hello` 에 접속하면 \"안녕하세요! 이것은 커스텀 서버가 보낸 응답입니다.\"가 보입니다.\n\n### ✨ 동작 원리 해설\n\n* **`socketserver`**: 네트워크 소켓을 관리하고 클라이언트 연결을 받아주는 역할을 합니다.\n* **`BaseHTTPRequestHandler`**: HTTP 요청을 파싱하고 응답을 보낼 수 있는 기본 템플릿을 제공합니다.\n* **`do_GET(self)`**: 클라이언트가 `GET` 요청을 보냈을 때 이 함수가 실행됩니다.\n* **`self.send_response(200)`**: 클라이언트에게 응답 상태 코드(200=성공, 404=찾을 수 없음 등)를 보냅니다.\n* **`self.send_header(...)`**: 응답의 종류(Content-type)와 크기(Content-Length) 등의 메타데이터를 보냅니다.\n* **`self.wfile.write(...)`**: 실제 웹 브라우저가 읽을 수 있는 응답 내용(HTML, 텍스트 등)을 전송합니다.\n\n---\n\n## 📚 요약 및 추천\n\n| 구분 | 예제 1: `http.server` | 예제 2: `BaseHTTPRequestHandler` |\n| :--- | :--- | :--- |\n| **용도** | 정적 파일(Static File) 서빙 | 특정 URL에 대한 동적 응답 처리 |\n| **난이도** | ⭐ (매우 쉬움) | ⭐⭐ (중간) |\n| **특징** | 코드 없이 명령어 실행 | HTTP 프로토콜을 직접 제어 |\n| **추천 상황** | 간단한 테스트 서버, 파일 배포 | **웹 개발의 기초 원리 학습** |\n| **실무 사용** | 파일 공유 시 | **Flask/Django 같은 프레임워크 학습의 출발점** |\n\n**👉 만약 실제 서비스를 만들고 싶다면:** 예제 2로 기초 원리를 이해하신 후, **Flask**나 **FastAPI** 같은 경량 프레임워크를 사용하시는 것을 강력히 추천드립니다. 이 프레임워크들이 위의 복잡한 `do_GET` 코드를 훨씬 간결하게 처리해 줍니다.","reasoning_content":"Here's a thinking process that leads to the suggested response:\n\n1.  **Analyze the Request:** The user wants an example of an HTTP server written in Python.\n\n2.  **Determine the Scope/Level of the Example:**\n    *   *Option 1: Simple, built-in module (`http.server`).* This is the easiest and fastest way to fulfill the request for a *basic* example. It demonstrates functionality without complex code.\n    *   *Option 2: Using the `socket` module.* This is much harder, requires handling HTTP protocols manually, and is overkill for a standard \"example.\"\n    *   *Option 3: Using a framework (Flask/Django).* While common in production, this isn't a *pure* Python HTTP server example using standard libraries, and it might confuse the user if they just want to see how the basic protocol works.\n\n3.  **Select the Best Approach (Option 1: `http.server` and Customization):**\n    *   The best approach is to first provide the simplest, runnable solution using `http.server`.\n    *   Then, provide a slightly more advanced example (inheriting from `BaseHTTPRequestHandler`) to show how one would customize the handling of different HTTP methods (GET, POST, etc.).\n\n4.  **Draft the Code (Simple Server):**\n    *   Need to import `http.server` and `socketserver`.\n    *   Need to define the port (e.g., 8000).\n    *   Need to run the server. (This is the quickest way to run a basic server.)\n\n5.  **Draft the Code (Customized Server - The \"Educational\" Example):**\n    *   Need to import `http.server` and `BaseHTTPRequestHandler`.\n    *   Define a class (e.g., `SimpleHTTPRequestHandler`).\n    *   Override the `do_GET` method.\n    *   In `do_GET`, write the HTTP response structure (Status Line, Headers, Body).\n    *   Handle the server startup using `http.server.HTTPServer`.\n\n6.  **Review and Refine the Explanation (Crucial Step):**\n    *   The explanation must be clear, easy to follow, and explain *why* the code works.\n    *   *Add Instructions:* How to save, how to run, and how to test (using a browser or `curl`).\n    *   *Structure:* Present the simple example first, followed by the advanced/customizable example.\n\n7.  **Final Polish (Self-Correction during drafting):** Make sure the custom server example *properly* sends the Content-Type and Content-Length so the browser displays it correctly. (The provided code handles this.)\n\n**(The resulting output matches the structured response provided below.)**"}}],"created":1781067647,"model":"gemma-4-E4B-it-Q4_K_M.gguf","system_fingerprint":"b9553-9e3b928fd","object":"chat.completion","usage":{"completion_tokens":2288,"prompt_tokens":26,"total_tokens":2314,"prompt_tokens_details":{"cached_tokens":6}},"id":"chatcmpl-Mbe6PZU7iilj6DVEI59YH4eoDksRPZXj","timings":{"cache_n":6,"prompt_n":20,"prompt_ms":328.529,"prompt_per_token_ms":16.42645,"prompt_per_second":60.8774263459238,"predicted_n":2288,"predicted_ms":40048.23,"predicted_per_token_ms":17.50359702797203,"predicted_per_second":57.13111415910266}}

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

stable diffussion train 시도  (0) 2026.06.10
llama.cpp prompt 옵션  (0) 2026.06.10
exllama  (0) 2026.06.10
stable diffusion train  (0) 2026.06.10
gemma4-e4b it qat / gemma4-12b mtp on 1080 ti 11GB  (0) 2026.06.08
Posted by 구차니

시스템 프롬프트를 (role:system) 웹으로는 해봤는데 cli 에서도 가능한지 찾아보는 중

파일에도 넣을수 있고, 미리 넣을수도 있지만 런타임 중에 변경은 불가능 한건가?

llama-b9553$ ./llama-cli --help | grep -i sys
-p,    --prompt PROMPT                  prompt to start generation with; for system message, use -sys
--mlock                                 force system to keep model in RAM rather than swapping or compressing
--numa TYPE                             attempt optimizations that help on some NUMA systems
                                        if run without this previously, it is recommended to drop the system
-sys,  --system-prompt PROMPT           system prompt to use with model (if applicable, depending on chat
-sysf, --system-prompt-file FNAME       a file containing the system prompt (default: none)
                                        hunyuan-vl, kimi-k2, llama2, llama2-sys, llama2-sys-bos,
                                        llama2-sys-strip, llama3, llama4, megrez, minicpm, mistral-v1,
                                        hunyuan-vl, kimi-k2, llama2, llama2-sys, llama2-sys-bos,
                                        llama2-sys-strip, llama3, llama4, megrez, minicpm, mistral-v1,

 

llama-b9553$ ./llama-cli --help | grep -i prom
-tb,   --threads-batch N                number of threads to use during batch and prompt processing (default:
-c,    --ctx-size N                     size of the prompt context (default: 0, 0 = loaded from model)
--keep N                                number of tokens to keep from the initial prompt (default: 0, -1 =
-p,    --prompt PROMPT                  prompt to start generation with; for system message, use -sys
-f,    --file FNAME                     a file containing the prompt (default: none)
-bf,   --binary-file FNAME              binary file containing the prompt (default: none)
                                        number of threads to use during batch and prompt processing (default:
--verbose-prompt                        print a verbose prompt before generation (default: false)
--display-prompt, --no-display-prompt   whether to print prompt at generation (default: true)
-co,   --color [on|off|auto]            Colorize output to distinguish prompt and user input from generations
-sys,  --system-prompt PROMPT           system prompt to use with model (if applicable, depending on chat
-sysf, --system-prompt-file FNAME       a file containing the system prompt (default: none)
-r,    --reverse-prompt PROMPT          halt generation at PROMPT, return control in interactive mode
                                        will not be interactive if first turn is predefined with --prompt

 

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

stable diffussion train 시도  (0) 2026.06.10
curl로 llama-swap 에게 api로 요청하기  (0) 2026.06.10
exllama  (0) 2026.06.10
stable diffusion train  (0) 2026.06.10
gemma4-e4b it qat / gemma4-12b mtp on 1080 ti 11GB  (0) 2026.06.08
Posted by 구차니
프로그램 사용/gcc2026. 6. 10. 12:06

msvc의 md 옵션과는 의미가 다르고(claude에게 낚임!)

그냥 빌드시 디버깅용 플래그라고 해야하나..?

동적 링크시 어떤 파일을 참조하는지 .d 파일에 주로 쓰도록 하는 것 같다.

[링크 : https://dmake.tistory.com/26]

[링크 : https://m.blog.naver.com/wonmylover/220771036728]

 

-M
Instead of outputting the result of preprocessing, output a rule suitable for make describing the dependencies of the main source file. The preprocessor outputs one make rule containing the object file name for that source file, a colon, and the names of all the included files, including those coming from -include or -imacros command line options.

Unless specified explicitly (with -MT or -MQ), the object file name consists of the name of the source file with any suffix replaced with object file suffix and with any leading directory parts removed. If there are many included files then the rule is split into several lines using \-newline. The rule has no commands.
This option does not suppress the preprocessor's debug output, such as -dM. To avoid mixing such debug output with the dependency rules you should explicitly specify the dependency output file with -MF, or use an environment variable like DEPENDENCIES_OUTPUT . Debug output will still be sent to the regular output stream as normal.

Passing -M to the driver implies -E, and suppresses warnings with an implicit -w.

-MM
Like -M but do not mention header files that are found in system header directories, nor header files that are included, directly or indirectly, from such a header.

This implies that the choice of angle brackets or double quotes in an #include directive does not in itself determine whether that header will appear in -MM dependency output. This is a slight change in semantics from GCC versions 3.0 and earlier.
-MF file
When used with -M or -MM, specifies a file to write the dependencies to. If no -MF switch is given the preprocessor sends the rules to the same place it would have sent preprocessed output.
When used with the driver options -MD or -MMD, -MF overrides the default dependency output file.

-MG
In conjunction with an option such as -M requesting dependency generation, -MG assumes missing header files are generated files and adds them to the dependency list without raising an error. The dependency filename is taken directly from the "#include" directive without prepending any path. -MG also suppresses preprocessed output, as a missing header file renders this useless.

This feature is used in automatic updating of makefiles.
-MP
This option instructs CPP to add a phony target for each dependency other than the main file, causing each to depend on nothing. These dummy rules work around errors make gives if you remove header files without updating the Makefile to match.

This is typical output:
test.o: test.c test.h

test.h:
-MT target
Change the target of the rule emitted by dependency generation. By default CPP takes the name of the main input file, deletes any directory components and any file suffix such as .c, and appends the platform's usual object suffix. The result is the target.
An -MT option will set the target to be exactly the string you specify. If you want multiple targets, you can specify them as a single argument to -MT, or use multiple -MT options.

For example, -MT '$(objpfx)foo.o' might give

$(objpfx)foo.o: foo.c
-MQ target
Same as -MT, but it quotes any characters which are special to Make. -MQ '$(objpfx)foo.o' gives
$$(objpfx)foo.o: foo.c
The default target is automatically quoted, as if it were given with -MQ.
-MD
-MD is equivalent to -M -MF file, except that -E is not implied. The driver determines file based on whether an -o option is given. If it is, the driver uses its argument but with a suffix of .d, otherwise it takes the name of the input file, removes any directory components and suffix, and applies a .d suffix.

If -MD is used in conjunction with -E, any -o switch is understood to specify the dependency output file, but if used without -E, each -o is understood to specify a target object file.
Since -E is not implied, -MD can be used to generate a dependency output file as a side-effect of the compilation process.

-MMD
Like -MD except mention only user header files, not system header files.

[링크 : https://linux.die.net/man/1/gcc]

Posted by 구차니
프로그램 사용/gcc2026. 6. 10. 11:57

리눅스에서 gcc로 빌드하면 시스템 절대 경로라고 해야하나.

아래의 경우, /lib/x86_64-linux-gnu/ 의 경로에 있는 so들을 보도록 되어있는데 (LD_LIBRARY_PATH)

이걸 빌드 시에 위치 기준 상대 경로를 보게 하는 옵션 인듯.

so 파일과 실행파일을 같이 배포할때 쓰이려나?

 

$ ldd untitled
linux-vdso.so.1 (0x00007fff3f7a7000)
libQt5Widgets.so.5 => /lib/x86_64-linux-gnu/libQt5Widgets.so.5 (0x00007a58ffe00000)
libQt5Gui.so.5 => /lib/x86_64-linux-gnu/libQt5Gui.so.5 (0x00007a58ff600000)
libQt5Core.so.5 => /lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007a58ff000000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007a58fec00000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007a5900f63000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007a58fe800000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007a5900519000)
libGL.so.1 => /lib/x86_64-linux-gnu/libGL.so.1 (0x00007a58ffd79000)
libpng16.so.16 => /lib/x86_64-linux-gnu/libpng16.so.16 (0x00007a59004de000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007a5900f45000)
libharfbuzz.so.0 => /lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007a58fef31000)
libmd4c.so.0 => /lib/x86_64-linux-gnu/libmd4c.so.0 (0x00007a59004cc000)
libdouble-conversion.so.3 => /lib/x86_64-linux-gnu/libdouble-conversion.so.3 (0x00007a58ffd64000)
libicui18n.so.70 => /lib/x86_64-linux-gnu/libicui18n.so.70 (0x00007a58fe400000)
libicuuc.so.70 => /lib/x86_64-linux-gnu/libicuuc.so.70 (0x00007a58fe205000)
libpcre2-16.so.0 => /lib/x86_64-linux-gnu/libpcre2-16.so.0 (0x00007a58ff576000)
libzstd.so.1 => /lib/x86_64-linux-gnu/libzstd.so.1 (0x00007a58fee62000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007a58feac5000)
/lib64/ld-linux-x86-64.so.2 (0x00007a5900faa000)
libGLdispatch.so.0 => /lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007a58fe747000)
libGLX.so.0 => /lib/x86_64-linux-gnu/libGLX.so.0 (0x00007a58ffd30000)
libfreetype.so.6 => /lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007a58fe13d000)
libgraphite2.so.3 => /lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007a58ffd09000)
libicudata.so.70 => /lib/x86_64-linux-gnu/libicudata.so.70 (0x00007a58fc400000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007a58fea4f000)
libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007a58fc2c0000)
libbrotlidec.so.1 => /lib/x86_64-linux-gnu/libbrotlidec.so.1 (0x00007a58ffcfb000)
libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007a58fee38000)
libbrotlicommon.so.1 => /lib/x86_64-linux-gnu/libbrotlicommon.so.1 (0x00007a58fea2c000)
libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007a5900f37000)
libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007a59004c4000)
libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007a58ffce3000)
libmd.so.0 => /lib/x86_64-linux-gnu/libmd.so.0 (0x00007a58ff569000)

 

[링크 : https://velog.io/@wjddms206/RPATH-한번에-이해하기]

[링크 : https://stackoverflow.com/questions/6324131/rpath-origin-not-having-desired-effect]

[링크 : https://stackoverflow.com/questions/38058041/correct-usage-of-rpath-relative-vs-absolute]

[링크 : https://stackoverflow.com/questions/38058041/correct-usage-of-rpath-relative-vs-absolute]

Posted by 구차니

vLLM 처럼 먼가 복수의 gpu를 복수의 사용자에게 서빙하는 걸 찾는 중인데..

이거 맞...나?

 

[링크 : https://github.com/turboderp-org/exllamav2]

[링크 : https://github.com/turboderp-org/exllamav3]

[링크 : https://github.com/theroyallab/tabbyAPI/]  exllama의 백엔드

   [링크 : https://www.reddit.com/r/LocalLLaMA/comments/1ijw4l5/stop_wasting_your_multigpu_setup_with_llamacpp/]

Posted by 구차니

음.. 내 gpu가 버틸수 있을까? ㅋㅋ

 

그런데 내용 자체가 쉽진 않아 보여서 어떻게 해야하나 see wiki를 눌러서 내용 보는 중

[링크 : https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Textual-Inversion]

 

+

[링크 : https://joonojoono.tistory.com/19]

[링크 : https://www.internetmap.kr/entry/Automatic1111-GUI-Beginners-Guide] 학습을 제외한 내용이 알참 -_ㅠ

 

일반적인 학습(?) 방법으로 길게 학습하고 중간중간 체크포인트 백업.. 용량 어쩔 ㅠㅠ

[링크 : https://www.reddit.com/r/StableDiffusion/comments/zw7qzo/automatic1111_dreambooth_how_to_continue_training/?tl=ko]

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

llama.cpp prompt 옵션  (0) 2026.06.10
exllama  (0) 2026.06.10
gemma4-e4b it qat / gemma4-12b mtp on 1080 ti 11GB  (0) 2026.06.08
nvidia 3070 8GB 테스트 gemma4-e4b  (0) 2026.06.08
sigLIP, CLIP  (0) 2026.06.05
Posted by 구차니
Linux2026. 6. 9. 14:28

폰트 파일을 /usr/share/fonts에 넣었는데 바로 인식안될 경우

리부팅 해도 되지만(!) 아래 명령으로 즉각적으로 갱신이 가능하다고 한다.

$ fc-cache -fv

 

아래 명령으로 현재 시스템의 인식된 폰트를 확인이 가능하다.

$ fc-list

[링크 : https://linux.die.net/man/1/fc-list]

[링크 : https://linux.die.net/man/1/fc-cache]

'Linux' 카테고리의 다른 글

hdmi 연결과 비디오 메모리 사용량  (0) 2026.05.02
jstest  (0) 2026.04.03
리눅스 메모리 timing 확인하기  (0) 2026.01.27
journalctl 옵션  (0) 2026.01.20
proc fs smp_affinity  (0) 2025.09.19
Posted by 구차니

요약

QAT는 생성속도 차이는 크게 없어 보임. 사용해봐야 결과 품질을 알 수 있을 듯 함.

MTP는 50% 정도 성능 향상이 되는 듯?

---

QAT

오오 3~4일 전 따끈한 모델!

용량이 3~4GB 정도라 정말 어떨지 궁금하다.

[링크 : https://huggingface.co/unsloth/gemma-4-E4B-it-qat-GGUF]

 

기존에 테스트 하던건 Q4_K_M 이라 비슷할진 모르겠다.

$ ../../llama-b9553/llama-cli -m gemma-4-E4B-it-qat-UD-Q2_K_XL.gguf -sm none
[ Prompt: 16.8 t/s | Generation: 38.6 t/s ]
[ Prompt: 97.9 t/s | Generation: 41.1 t/s ]
[ Prompt: 196.1 t/s | Generation: 39.9 t/s ]

 

$ ../../llama-b9553/llama-cli -m gemma-4-E4B-it-qat-UD-Q4_K_XL.gguf -sm none
[ Prompt: 737.0 t/s | Generation: 62.5 t/s ]
[ Prompt: 238.5 t/s | Generation: 61.4 t/s ]
[ Prompt: 292.3 t/s | Generation: 58.0 t/s ]

 

 

MTP

MTP는 multimodal 처럼 2개의 모델 파일이 필요하구나..

일단은 cuda enable 하고 빌드하려면.. sdk가 문제 없으려나.. 쩝

./build/bin/llama-server \
  -m gemma-4-12b-it-Q4_K_M.gguf \
  --model-draft MTP/gemma-4-12B-it-MTP-Q8_0.gguf \
  --spec-type draft-mtp --spec-draft-n-max 4 \
  -ngl 999 -fa on
Multi GPU: add --spec-draft-device CUDA0 -sm layer.

[링크 : https://huggingface.co/unsloth/gemma-4-12b-it-GGUF/blob/main/MTP/README.md]

 

+

음.. 장렬히 빌드 시도 폭★파 ㅋㅋㅋ

$ cmake -B build -DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES=61
CMAKE_BUILD_TYPE=Release
-- Warning: ccache not found - consider installing it for faster compilation or disable this warning with GGML_CCACHE=OFF
-- CMAKE_SYSTEM_PROCESSOR: x86_64
-- GGML_SYSTEM_ARCH: x86
-- Including CPU backend
-- x86 detected
-- Adding CPU backend variant ggml-cpu: -march=native 
-- Unable to find cublas_v2.h in either "/usr/local/cuda/include" or "/usr/math_libs/include"
-- CUDA Toolkit found
CMake Error at /usr/share/cmake-3.22/Modules/CMakeDetermineCompilerId.cmake:726 (message):
  Compiling the CUDA compiler identification source file
  "CMakeCUDACompilerId.cu" failed.

  Compiler: /usr/local/cuda/bin/nvcc

  Build flags:

  Id flags: --keep;--keep-dir;tmp;-gencode=arch=compute_61,code=sm_61 -v

  

  The output was:

  1

  nvcc fatal : Unsupported gpu architecture 'compute_61'

  

  

Call Stack (most recent call first):
  /usr/share/cmake-3.22/Modules/CMakeDetermineCompilerId.cmake:6 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
  /usr/share/cmake-3.22/Modules/CMakeDetermineCompilerId.cmake:48 (__determine_compiler_id_test)
  /usr/share/cmake-3.22/Modules/CMakeDetermineCUDACompiler.cmake:298 (CMAKE_DETERMINE_COMPILER_ID)
  ggml/src/ggml-cuda/CMakeLists.txt:59 (enable_language)


-- Configuring incomplete, errors occurred!
See also "/home/falinux/src/llama.cpp/build/CMakeFiles/CMakeOutput.log".
See also "/home/falinux/src/llama.cpp/build/CMakeFiles/CMakeError.log".

 

+

b9500 으로는 무리인가.. 아니면 vulkan 모델이라 안되는걸까?

$ ../../llama-b9500/llama-cli -m gemma-4-12b-it-Q4_0.gguf --model-draft gemma-4-12B-it-MTP-Q8_0.gguf --spec-type draft-mtp --spec-draft-n-max 4 -ngl 999 -fa on --verbose

 

0.19.888.319 E llama_model_load: error loading model: unknown model architecture: 'gemma4-assistant'
0.19.888.322 E llama_model_load_from_file_impl: failed to load model
0.19.888.324 E srv    load_model: failed to load draft model, 'gemma-4-12B-it-MTP-Q8_0.gguf'

 

b9953 으로 하니 돌아간다.

1080 ti 11GB / -sm none

$ ../../llama-b9553/llama-cli -m gemma-4-12b-it-Q4_0.gguf --model-draft gemma-4-12B-it-MTP-Q8_0.gguf --spec-type draft-mtp --spec-draft-n-max 4   -ngl 999 -fa on -sm none

 

Q4_0
[ Prompt: 48.6 t/s | Generation: 42.6 t/s ]
[ Prompt: 231.5 t/s | Generation: 36.6 t/s ]
[ Prompt: 241.1 t/s | Generation: 34.0 t/s ]

UD_Q2_K_XL
[ Prompt: 5.0 t/s | Generation: 21.1 t/s ]
[ Prompt: 80.7 t/s | Generation: 29.2 t/s ]
[ Prompt: 45.0 t/s | Generation: 24.4 t/s ]

 

1080 ti 11GB / -sm layer

$ ../../llama-b9553/llama-cli -m gemma-4-12b-it-Q4_0.gguf --model-draft gemma-4-12B-it-MTP-Q8_0.gguf --spec-type draft-mtp --spec-draft-n-max 4   -ngl 999 -fa on 

 

Q4_0
[ Prompt: 66.8 t/s | Generation: 28.5 t/s ]

[ Prompt: 126.1 t/s | Generation: 19.3 t/s ]
[ Prompt: 88.2 t/s | Generation: 16.3 t/s ]

UD_Q2_K_XL
[ Prompt: 36.5 t/s | Generation: 24.6 t/s ]
[ Prompt: 32.1 t/s | Generation: 17.1 t/s ]
[ Prompt: 47.3 t/s | Generation: 12.6 t/s ]  (한번 터졌음)

 

 

>>>>> 참조용 >>>>>

하드웨어 1080 ti -sm none

gemma-4 12B it Q4_0.gguf Reading Generation 25 tokens 0.9s 27.94 t/s
gemma-4 12B it Q4_0.gguf Reading Generation 255 tokens 8.9s 28.78 t/s
gemma-4 12B it Q4_0.gguf Reading Generation 1,404 tokens 55s 25.45 t/s

gemma-4 12B it UD Q2_K_XL.gguf Reading Generation 29 tokens 1.2s 23.71 t/s
gemma-4 12B it UD Q2_K_XL.gguf Reading Generation 373 tokens 16s 22.28 t/s
gemma-4 12B it UD Q2_K_XL.gguf Reading Generation 806 tokens 37s 21.34 t/s (터짐)


하드웨어 1080 ti -sm layer

gemma-4 12B it Q4_0.gguf Reading Generation 25 tokens 0.8s 31.04 t/s
gemma-4 12B it Q4_0.gguf Reading Generation 265 tokens 9.0s 29.60 t/s
gemma-4 12B it Q4_0.gguf Reading Generation 1,340 tokens 54s 24.43 t/s

gemma-4 12B it UD Q2_K_XL.gguf Reading Generation 31 tokens 1.3s 24.16 t/s
gemma-4 12B it UD Q2_K_XL.gguf Reading Generation 263 tokens 11s 23.70 t/s
gemma-4 12B it UD Q2_K_XL.gguf Reading Generation 620 tokens 29s 20.70 t/s (터짐)

2026.06.04 - [프로그램 사용/ai 프로그램] - gemma 12b, tesla t4 16GB / 1080 ti 11GB * 2

<<<< 참조용 <<<<

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

exllama  (0) 2026.06.10
stable diffusion train  (0) 2026.06.10
nvidia 3070 8GB 테스트 gemma4-e4b  (0) 2026.06.08
sigLIP, CLIP  (0) 2026.06.05
chatML  (0) 2026.06.04
Posted by 구차니

양자화 타입에 영향을 받을테니 bf16 이런걸 받아서 해봐야하나?

 일단.. 근소하게 1080 보단 좋긴하다. 텐서코어 쓰려면 다시 받아야 할 듯 쩝..

gemma-4-E4B-it-Q4_K_M.gguf Reading Generation 10 tokens 0.2s 61.57 t/s
gemma-4-E4B-it-Q4_K_M.gguf Reading Generation 929 tokens 16s 56.72 t/s
gemma-4-E4B-it-Q4_K_M.gguf Reading Generation 3,597 tokens 1min 8s 52.70 t/s

 

그 와중에 8기가와 11기가는 별 차이 없는것 같은데, 제법 로드 가능한 모델이 제한되네.

 

 

에라이

메모리가 적으니 멀 시도해볼수도 없네.

계륵이다 ㅠㅠ

 

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

stable diffusion train  (0) 2026.06.10
gemma4-e4b it qat / gemma4-12b mtp on 1080 ti 11GB  (0) 2026.06.08
sigLIP, CLIP  (0) 2026.06.05
chatML  (0) 2026.06.04
gemma 12b, tesla t4 16GB / 1080 ti 11GB * 2  (0) 2026.06.04
Posted by 구차니