# NVIDIA Nemotron-3-Super：运行指南

英伟达发布 **Nemotron-3-Super-120B-A12B**，一款具有12B活跃参数的120B开放混合推理MoE模型，此前已发布过 [Nemotron-3-Nano](https://unsloth.ai/docs/zh/mo-xing/nemotron-3)，它是其30B的对应版本。Nemotron-3-Super 旨在为多代理AI提供高效性和高精度。拥有 **1M 令牌** 上下文窗口，它在 AIME 2025、Terminal Bench 和 SWE-Bench Verified 基准中在同类规模中领先，同时实现了最高吞吐量。

Nemotron-3-Super 可在具有 **64GB** 的 RAM、显存或统一内存的设备上运行，现在可以在本地进行微调。感谢 NVIDIA 在第一天就为 Unsloth 提供支持。

<a href="..#run-nemotron-3-super-120b" class="button primary">Nemotron 3 Super</a><a class="button secondary">Nemotron 3 Nano</a>

GGUF： [Nemotron-3-Super-120B-A12B-GGUF](https://huggingface.co/unsloth/NVIDIA-Nemotron-3-Super-120B-A12B-GGUF) • [NVFP4](https://huggingface.co/unsloth/NVIDIA-Nemotron-3-Super-120B-A12B-NVFP4) • [FP8](https://huggingface.co/unsloth/NVIDIA-Nemotron-3-Super-120B-A12B-FP8) • [BF16](https://huggingface.co/unsloth/NVIDIA-Nemotron-3-Super-120B-A12B)

### ⚙️ 使用指南

NVIDIA 推荐以下推理设置：

{% columns %}
{% column %}
**一般聊天/指令（默认）：**

* `temperature = 1.0`
* `top_p = 1.0`
  {% endcolumn %}

{% column %}
**调用工具的用例：**

* `temperature = 0.6`
* `top_p = 0.95`
  {% endcolumn %}
  {% endcolumns %}

**对于大多数本地使用，请设置：**

* `max_new_tokens` = `32,768` 为 `262,144` 针对最多 1M 令牌的标准提示
* 根据您的 RAM/显存情况增加以进行深度推理或长文本生成。

当我们使用下面内容时，可以找到聊天模板格式：

{% code overflow="wrap" %}

```python
tokenizer.apply_chat_template([
    {"role" : "user", "content" : "What is 1+1?"},
    {"role" : "assistant", "content" : "2"},
    {"role" : "user", "content" : "What is 2+2?"}
    ], add_generation_prompt = True, tokenize = False,
)
```

{% endcode %}

{% hint style="success" %}
因为模型是用 NoPE 训练的，您只需更改 `max_position_embeddings`。该模型不使用显式位置嵌入，因此不需要 YaRN。
{% endhint %}

#### Nemotron 3 聊天模板格式：

{% hint style="info" %}
Nemotron 3 使用 `<think>` 其令牌 ID 为 12 且 `</think>` 其令牌 ID 为 13 用于推理。使用 `--special` 可以查看 llama.cpp 的这些令牌。您可能还需要 `--verbose-prompt` 以查看 `<think>` 因为它被预置了。
{% endhint %}

{% code overflow="wrap" lineNumbers="true" %}

```
<|im_start|>system\n<|im_end|>\n<|im_start|>user\nWhat is 1+1?<|im_end|>\n<|im_start|>assistant\n<think></think>2<|im_end|>\n<|im_start|>user\nWhat is 2+2?<|im_end|>\n<|im_start|>assistant\n<think>\n
```

{% endcode %}

### 🖥️ 运行 Nemotron-3-Super-120B-A12B

根据您的用例，您需要使用不同的设置。由于模型架构（例如 [gpt-oss](https://unsloth.ai/docs/zh/mo-xing/gpt-oss-how-to-run-and-fine-tune)）具有不能被 128 整除的维度，某些 GGUF 的大小最终会类似，因此部分无法量化到更低位。访问 GGUF： [这里](https://huggingface.co/unsloth/NVIDIA-Nemotron-3-Super-120B-A12B-GGUF).

模型的 4-bit 版本需要约 \~64GB - 72GB RAM。8-bit 需要 128GB。

#### Llama.cpp 教程（GGUF）：

在 llama.cpp 中运行的说明（注意我们将使用 4-bit 以适配大多数设备）：

{% stepper %}
{% step %}
获取最新的 `llama.cpp` 在 [GitHub 这里](https://github.com/ggml-org/llama.cpp)。您也可以按下面的构建说明操作。若没有 GPU 或仅想使用 CPU 推理，请将 `-DGGML_CUDA=ON` 为 `-DGGML_CUDA=OFF` 更改为

{% code overflow="wrap" %}

```bash
apt-get update
apt-get install pciutils build-essential cmake curl libcurl4-openssl-dev -y
git clone https://github.com/ggml-org/llama.cpp
cmake llama.cpp -B llama.cpp/build \
    -DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=ON
cmake --build llama.cpp/build --config Release -j --clean-first --target llama-cli llama-mtmd-cli llama-server llama-gguf-split
cp llama.cpp/build/bin/llama-* llama.cpp
```

{% endcode %}
{% endstep %}

{% step %}
您可以直接从 Hugging Face 拉取。您可以根据 RAM/显存情况将上下文增加到 1M。

参照此用于 **通用指令** 的用例：

```bash
./llama.cpp/llama-cli \
    -hf unsloth/NVIDIA-Nemotron-3-Super-120B-A12B-GGUF:UD-Q4_K_XL \
    --ctx-size 16384 \
    --temp 1.0 --top-p 1.0
```

参照此用于 **调用工具** 的用例：

```bash
./llama.cpp/llama-cli \
    -hf unsloth/NVIDIA-Nemotron-3-Super-120B-A12B-GGUF:UD-Q4_K_XL \
    --ctx-size 32768 \
    --temp 0.6 --top-p 0.95
```

{% endstep %}

{% step %}
通过以下方式下载模型（在安装 `pip install huggingface_hub hf_transfer` 之后）。您可以选择 Q4\_K\_M 或其他量化版本，例如 `UD-Q4_K_XL` 。我们建议至少使用 2-bit 动态量化以平衡大小和精度， `UD-Q2_K_XL` 如果下载卡住，请参见： [hugging-face-hub-xet-debugging](https://unsloth.ai/docs/zh/ji-chu/troubleshooting-and-faqs/hugging-face-hub-xet-debugging "mention")

```bash
hf download unsloth/NVIDIA-Nemotron-3-Super-120B-A12B-GGUF \
    --local-dir unsloth/NVIDIA-Nemotron-3-Super-120B-A12B-GGUF \
    --include "*UD-Q4_K_XL*" # 对于动态 2bit 使用 "*UD-Q2_K_XL*"
```

{% endstep %}

{% step %}
然后以对话模式运行模型：

{% code overflow="wrap" %}

```bash
/llama.cpp/llama-cli \
    --model unsloth/NVIDIA-Nemotron-3-Super-120B-A12B-GGUF/UD-Q4_K_XL/NVIDIA-Nemotron-3-Super-120B-A12B-UD-Q4_K_XL-00001-of-00003.gguf \
    --ctx-size 16384 \
    --seed 3407 \
    --prio 2 \
    --temp 0.6 \
    --top-p 0.95
```

{% endcode %}

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FiGf05CCDNnMGE9g7KtqE%2Fimage.png?alt=media&#x26;token=24cd05c6-4fd5-4e9b-9057-822fe27bf255" alt=""><figcaption></figcaption></figure>

另外，根据需要调整 **上下文窗口** 。确保您的硬件可以处理超过 256K 的上下文窗口。将其设置为 1M 可能会触发 CUDA OOM 并导致崩溃，这就是默认值为 262,144 的原因。
{% endstep %}
{% endstepper %}

### 🦥 对 Nemotron 3 的微调和强化学习（RL）

Unsloth 现在支持对所有 Nemotron 模型进行微调，包括 Nemotron 3 Super 和 Nano。有关 Nano 的笔记本示例，请参阅我们的 Nemotron 3 [Nano 微调指南](https://unsloth.ai/docs/zh/mo-xing/nemotron-3).

#### Nemotron 3 Super

* 路由层微调默认已禁用以保证稳定性。
* Nemotron-3-Super-120B - bf16 LoRA 在 256GB 显存上可用。如果您使用多 GPU，请添加     `device_map = "balanced"` 或遵循我们的 [多 GPU 指南](https://unsloth.ai/docs/zh/ji-chu/multi-gpu-training-with-unsloth).

### 🦙Llama-server 提供服务与部署

要将 Nemotron 3 部署到生产环境，我们使用 `llama-server` 在新终端（例如通过 tmux）中，通过以下方式部署模型：

{% code overflow="wrap" %}

```bash
./llama.cpp/llama-server \
    --model unsloth/NVIDIA-Nemotron-3-Super-120B-A12B-GGUF/UD-Q4_K_XL/NVIDIA-Nemotron-3-Super-120B-A12B-UD-Q4_K_XL-00001-of-00003.gguf \
    --alias "unsloth/NVIDIA-Nemotron-3-Super-120B-A12B" \
    --prio 3 \
    --min_p 0.01 \
    --temp 0.6 \
    --top-p 0.95 \
    --ctx-size 16384 \
    --port 8001
```

{% endcode %}

运行上述命令后，您将获得：

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FfEwDrf2FRCuWV7t7i7L6%2Fimage.png?alt=media&#x26;token=e2449552-27f5-4238-9e09-c708377a4e61" alt=""><figcaption></figcaption></figure>

然后在新的终端中，在执行 `pip install openai`之后，执行：

{% code overflow="wrap" %}

```python
from openai import OpenAI
import json
openai_client = OpenAI(
    base_url = "http://127.0.0.1:8001/v1",
    api_key = "sk-no-key-required",
)
completion = openai_client.chat.completions.create(
    model = "unsloth/NVIDIA-Nemotron-3-Super-120B-A12B",
    messages = [{"role": "user", "content": "What is 2+2?"},],
)
print(completion.choices[0].message.reasoning_content)
print(completion.choices[0].message.content)
```

{% endcode %}

输出将为：

{% code overflow="wrap" %}

```
好的，用户问了 "What is 2+2?" 这看起来是一个非常基础的算术问题。

嗯，也许他们在测试我是否注意力集中，或者他们是一个正在学习数学的年幼儿童。也可能是有人在检查我是否会把一个简单问题复杂化。

我应该保持直接，因为查询中没有欺骗的迹象。答案肯定是 4——没有必要对基本加法再三怀疑。

不过我也有一部分想知道他们是否在准备一个笑话（比如“2+2=5 当 2 很大时”），但既然他们没有提供任何上下文，我就假定是认真的询问。

最好清晰而友好地回答——如果他们在学习，可能会鼓励他们问更多问题。不过无需赘述；直接有帮助地陈述事实即可。

2 + 2 等于 **4**。

这是十进制表示法中的一个基本算术事实。如果您在不同的上下文中提问（例如模算术、二进制，或是玩笑/引用），请随时说明——我很乐意调整！😊
```

{% endcode %}

### 基准测试

与类似规模的模型相比，Nemotron 3 Super 在性能上具有竞争力，同时提供最高的吞吐量。

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fe2p2jCqKu7D9pTtJpOQN%2Faccuracy_chart(1).png?alt=media&#x26;token=df1805ab-f005-4a7f-bd77-b91f84a2c76f" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://unsloth.ai/docs/zh/mo-xing/nemotron-3/nemotron-3-super.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
