🚀 OpenCodeReasoning-Nemotron-32B-IOI GGUFモデル
OpenCodeReasoning-Nemotron-32B-IOI GGUFモデルは、コード生成の推論に特化した大規模言語モデルです。Qwen2.5-32B-Instructをベースにしており、32Kトークンのコンテキスト長をサポートし、商用・非商用利用に対応しています。
🚀 クイックスタート
モデルの推論実行
C++コーディング問題の推論
import transformers
import torch
model_id = "nvidia/OpenCodeReasoning-Nemotron-32B-IOI"
pipeline = transformers.pipeline(
"text-generation",
model=model_id,
model_kwargs={"torch_dtype": torch.bfloat16},
device_map="auto",
)
prompt = """You are a helpful and harmless assistant. You should think step-by-step before responding to the instruction below.
Please use c++ programming language only.
You must use ```cpp for just the final solution code block with the following format:
```cpp
// Your code here
{user}
"""
messages = [
{
"role": "user",
"content": prompt.format(user="Write a program to calculate the sum of the first $N$ fibonacci numbers")},
]
outputs = pipeline(
messages,
max_new_tokens=32768,
)
print(outputs[0]["generated_text"][-1]['content'])
#### Pythonコーディング問題の推論
```python
import transformers
import torch
model_id = "nvidia/OpenCodeReasoning-Nemotron-32B"
pipeline = transformers.pipeline(
"text-generation",
model=model_id,
model_kwargs={"torch_dtype": torch.bfloat16},
device_map="auto",
)
prompt = """You are a helpful and harmless assistant. You should think step-by-step before responding to the instruction below.
Please use python programming language only.
You must use ```python for just the final solution code block with the following format:
```python
# Your code here
{user}
"""
messages = [
{
"role": "user",
"content": prompt.format(user="Write a program to calculate the sum of the first $N$ fibonacci numbers")},
]
outputs = pipeline(
messages,
max_new_tokens=32768,
)
print(outputs[0]["generated_text"][-1]['content'])
## ✨ 主な機能
### モデル生成詳細
このモデルは、[llama.cpp](https://github.com/ggerganov/llama.cpp) のコミット [`92ecdcc0`](https://github.com/ggerganov/llama.cpp/commit/92ecdcc06a4c405a415bcaa0cb772bc560aa23b1) を使用して生成されました。
### 超低ビット量子化(IQ-DynamicGate、1 - 2ビット)
最新の量子化方法では、超低ビットモデル(1 - 2ビット)に対して**精度適応型量子化**を導入しており、**Llama-3-8B** でのベンチマークで改善が実証されています。このアプローチは、層ごとの戦略を使用して、極限のメモリ効率を維持しながら精度を保持します。
### モデル形式の選択
モデル形式の選択は、**ハードウェア能力**と**メモリ制約**に依存します。異なるモデル形式(BF16、F16、量子化モデルなど)には、それぞれ異なる精度、メモリ使用量、デバイス要件があり、適切な使用シナリオがあります。
## 📦 インストール
このREADMEには具体的なインストール手順が記載されていないため、インストールセクションは省略されます。
## 💻 使用例
上述のクイックスタートセクションに、C++とPythonのコーディング問題の推論実行のコード例があります。
## 📚 ドキュメント
### モデルの概要
OpenCodeReasoning-Nemotron-32B-IOIは、Qwen2.5-32B-Instructをベースとした大規模言語モデルで、コード生成の推論用にポストトレーニングされています。32Kトークンのコンテキスト長をサポートし、商用・非商用利用に対応しています。
### 評価結果
[OpenCodeReasoning](https://arxiv.org/abs/2504.01943) の評価結果が平均64回の評価で示されており、他のモデルとの比較が可能です。
### 再現方法
モデル、データセット、論文のリンクが提供されており、結果の再現が可能です。
### モデル形式の選択
異なるモデル形式(BF16、F16、量子化モデルなど)の特徴、メモリ使用量、デバイス要件、最適な使用シナリオがまとめられています。
### 含まれるファイルと詳細
各モデルファイル(OpenCodeReasoning-Nemotron-32B-IOI-bf16.gguf、OpenCodeReasoning-Nemotron-32B-IOI-f16.ggufなど)の特徴と使用方法が説明されています。
### モデルのテスト
モデルをテストする方法、テスト対象、各AIアシスタントの機能、テストコマンドの例が記載されています。
### 追加情報
モデルのアーキテクチャ、入力・出力の特性、ソフトウェア統合、モデルバージョン、トレーニングと評価データセット、ライセンス、デプロイメント地域、使用シナリオ、リリース日、参考文献、推論エンジン、エチカルな考慮事項などが記載されています。
## 🔧 技術詳細
### 超低ビット量子化(IQ-DynamicGate、1 - 2ビット)
#### ベンチマークのコンテキスト
すべてのテストは、**Llama-3-8B-Instruct** を使用して、標準のパープレキシティ評価パイプライン、2048トークンのコンテキストウィンドウ、すべての量子化で同じプロンプトセットを使用して実施されました。
#### 方法
- **動的精度割り当て**:最初/最後の25%の層はIQ4_XS(選択された層)、中央の50%はIQ2_XXS/IQ3_S(効率を向上)
- **重要コンポーネント保護**:埋め込み/出力層はQ5_Kを使用し、標準の1 - 2ビット量子化と比較してエラー伝播を38%削減します。
#### 量子化性能比較(Llama-3-8B)
| 量子化 | 標準PPL | DynamicGate PPL | ΔPPL | 標準サイズ | DGサイズ | Δサイズ | 標準速度 | DG速度 |
|--------------|--------------|------------------|---------|----------|---------|--------|-----------|----------|
| IQ2_XXS | 11.30 | 9.84 | -12.9% | 2.5G | 2.6G | +0.1G | 234s | 246s |
| IQ2_XS | 11.72 | 11.63 | -0.8% | 2.7G | 2.8G | +0.1G | 242s | 246s |
| IQ2_S | 14.31 | 9.02 | -36.9% | 2.7G | 2.9G | +0.2G | 238s | 244s |
| IQ1_M | 27.46 | 15.41 | -43.9% | 2.2G | 2.5G | +0.3G | 206s | 212s |
| IQ1_S | 53.07 | 32.00 | -39.7% | 2.1G | 2.4G | +0.3G | 184s | 209s |
### モデル形式の選択
異なるモデル形式(BF16、F16、量子化モデルなど)の技術的な説明があります。
## 📄 ライセンス
このモデルの使用は、[Apache 2.0](https://huggingface.co/nvidia/OpenCode-Nemotron-2-7B/blob/main/LICENSE) に準拠しています。