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., usingCUDA_VISIBLE_DEVICES).
Reddit +4
How to Configure
NVIDIA:SetCUDA_VISIBLE_DEVICES=0,1(comma-separated IDs) to enable multi-GPU.
AMD:UseROCR_VISIBLE_DEVICES=0,1.
Automatic Split:By default, Ollama handles the split automatically, but you can setPARAMETER num_gpu 999in a Modelfile to force all layers to be spread across all available GPUs.
하나 더 지르고.. 메인보드도 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 GPUs. This 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.
+-----------------------------------------------------------------------------------------+ | 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월입니다)까지의 정 보를 기반으로 답변을 제공합니다.
C:\>ollama run gemma3:1b --verbose >>> 안녕? 너에 대해서 설명해줘 안녕하세요! 저는 구글에서 훈련한 대규모 언어 모델입니다.
**간단히 말해서, 저는 텍스트와 이미지를 입력으로 받아 텍스트를 생성하는 데 특화된 AI 모델입니다.**
좀 더 자세히 설명하면 다음과 같습니다:
* **훈련 데이터:** 저는 방대한 양의 텍스트 데이터를 학습했습니다. 여기에는 책, 웹사이트, 기사, 코드 등 다양한 종류 의 텍스트가 포함됩니다. * **기능:** 저는 질문에 답하고, 텍스트를 요약하고, 번역하고, 창의적인 텍스트를 생성하고, 코드 등을 수행할 수 있습 니다. * **저의 한계:** 저는 아직 완벽하지 않습니다. 때로는 사실과 다른 정보나 편향된 내용을 생성할 수 있습니다. 또한, 저 또한 인간과 같은 감정을 가지고 있지 않으므로, 인간적인 상호작용에는 한계가 있습니다. * **현재 위치:** 저는 지속적으로 학습하고 개선되고 있습니다.
**제가 무엇을 도와드릴까요?** 궁금한 점이나 특정 작업을 위해 제가 할 수 있는 것이 있다면 말씀해주세요!
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.)
아는 분과 수다 떨다가 포르자 호라이즌 텔레메트리 정보에서 방향각 관련 변환 이야기 하다 얻은 키워드.
짐벌락 이야기 나오는거 보면 얼핏 본것도 같은데.. 기억이 안나네
회전을 표현하는 다른 방법인 Rotation Matrix(이전글)와 비교했을 때, Quaternion은 회전 계산량이 작으며메모리 효율적이고,Gimbal Lock(짐벌락) 현상이 발생하지 않는장점을 갖고 있습니다. 다만직관적으로 이해하거나 시각화기가 어렵다는단점을 갖고 있습니다.
토큰화 및 입력 임베딩 문자, 숫자, 구두점과 같은 글자 단위는 인간이 언어를 표현하는 기본 단위이지만, AI 모델이 사용하는 언어의 최소 단위는 토큰(token)입니다. 각 토큰은 고유한 ID 번호를 부여받으며, LLM은 단어 자체나 토큰 자체가 아니라 이 ID 번호를 통해 어휘 “데이터베이스”를 탐색합니다. 이러한 언어의 토큰화는 텍스트를 처리하는 데 필요한 계산량을 크게 줄여줍니다.
트랜스포머의 어텐션 레이어에 입력할 쿼리 및 키 벡터를 생성하기 위해, 모델은 각 토큰에 대한 초기 문맥 없는 벡터 임베딩이 필요합니다. 이러한 초기 토큰 임베딩은 학습 중에 새롭게 학습되거나, 사전학습된 단어 임베딩 모델에서 가져올 수 있습니다.
위치 인코딩 단어의 순서와 위치는 그 의미론적 의미에 큰 영향을 미칠 수 있습니다. RNN의 직렬적 구조는 각 토큰의 위치 정보를 자연스럽게 보존하지만, 트랜스포머 모델은 어텐션 메커니즘이 이를 고려할 수 있도록 명시적으로 위치 정보를 추가해야 합니다.
위치 인코딩을 사용하면 모델은 입력이 어텐션 메커니즘에 들어가기 전에 상대적 위치에서 파생된 각 토큰의 임베딩에 값 벡터를 추가합니다. 두 토큰이 가까울수록 포지션 벡터는 더 유사해지고, 그에 따라 위치 정보 추가로 인해 정렬 점수가 더 높아집니다. 이렇게 하여 모델은 인접한 토큰에 더 많은 주의를 기울이도록 학습하게 됩니다.