Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
cad1d44
Update README.md
acc-mu3n May 8, 2025
70b0ea5
Update Start-NIM-RAG.ipynb
acc-mu3n May 8, 2025
bf7f9b7
translated Start-NIM-RAG.ipynb and rag_nim_endpoints.ipynb to jp
acc-mu3n May 8, 2025
9ee5cf5
translate nim_lora_adapter.ipynb to jp
acc-mu3n May 8, 2025
5de513d
translated locally_deployed_nim & custom_lora ipynb to jp
acc-mu3n May 9, 2025
f7b6b11
updated locally_deployed_nim & custom_lora ipynb
acc-mu3n May 9, 2025
e738fa9
Merge pull request #1 from acc-mu3n/work-mana
acc-mu3n May 9, 2025
1846288
Translation corrections. Correction of wording; correction of typos.
acc-mu3n May 13, 2025
ae6e7b9
updated the ipynb-jp
acc-mu3n May 14, 2025
0afc0fa
Merge pull request #2 from acc-mu3n/work-mana
acc-mu3n May 14, 2025
8b3aa5a
Localize: custome pdf chain
turabe777 May 26, 2025
d622ccf
Merge remote-tracking branch 'origin/japanese-translation' into work-…
turabe777 May 26, 2025
29efcc9
fix: minor cleanup
turabe777 May 26, 2025
8f64661
Localize
turabe777 May 26, 2025
b41cd30
add k8s workshop
turabe777 May 27, 2025
55f6280
delete output
turabe777 May 27, 2025
2fba51f
Update .gitignore to exclude temporary and output files
turabe777 May 28, 2025
22cbc53
Merge pull request #3 from acc-mu3n/work-tatsuya
acc-mu3n May 28, 2025
386d418
localized (ja) lora notebooks
omihub777 May 31, 2025
64b5107
change lora r=32
omihub777 Jun 2, 2025
0b792f3
Merge pull request #4 from acc-mu3n/work-omi
acc-mu3n Jun 2, 2025
7203929
Remove jupyter_notebook_k8s directory after moving notebook
turabe777 Jun 13, 2025
8a0b199
fix YAML filename
turabe777 Jun 13, 2025
06a3054
change directory name (suffix -jp)
turabe777 Jun 13, 2025
71960a4
Ignore .DS_Store files
turabe777 Jun 13, 2025
3617cf3
delete .DS_Store
turabe777 Jun 13, 2025
0ac9a59
added jp version of doc
acc-mu3n Jun 16, 2025
1f52c00
Correction of deletion of some English version notebooks and md files
acc-mu3n Jun 24, 2025
c3497b4
added nim details explanation
acc-mu3n Jun 30, 2025
eabee5f
added optional contents
acc-mu3n Jul 1, 2025
efdea7a
fix typo
acc-mu3n Jul 2, 2025
0690ac2
fix typo for the explanation
acc-mu3n Jul 2, 2025
8cac118
fixed bugs and modified for locally embedding nim
acc-mu3n Jul 5, 2025
fa2ce26
fixed typo
acc-mu3n Jul 5, 2025
f158792
fix double endpoint setting
turabe777 Jul 6, 2025
eb9dd3c
Merge pull request #6 from acc-mu3n/work-tatsuya
acc-mu3n Jul 7, 2025
acac0cd
Merge pull request #7 from acc-mu3n/work-mana
turabe777 Jul 7, 2025
15e044e
updated for using latest llm-nim container
acc-mu3n Jul 9, 2025
c81b507
Update bootcamp_requirements.txt
turabe777 Jul 14, 2025
d8ed19f
synced from gitlab nim-bootcamp-on-curiosity
turabe777 Aug 1, 2025
171f85e
sync loccal_deployed_nim.ipynb
turabe777 Aug 1, 2025
2bdb145
Merge pull request #8 from acc-mu3n/turabe777-patch-1
turabe777 Aug 1, 2025
8cf38e6
combine gke handson
turabe777 Aug 26, 2025
3724146
removed deprecated notebook
acc-mu3n Aug 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,11 @@ cython_debug/

# PyPI configuration file
.pypirc

# Custom: Ignore notebook execution outputs
workspace-nim-with-rag/jupyter_notebook/embed/
workspace-nim-with-rag/jupyter_notebook/nim_llm_values.yaml
workspace-nim-with-rag/jupyter_notebook/nim-llm-1.7.0.tgz

# Mac
*.DS_Store
127 changes: 127 additions & 0 deletions Deployment_Guide-jp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# NIM ブートキャンプ

このブートキャンプは、開発者が実際のGenAIアプリケーションを構築することで、NVIDIA® NIM™を使い始めることができるように設計されています。
ラボでは、参加者がNIM Dockerコンテナをセットアップし、推論リクエストを提供するためにREST API Endpointを利用することをガイドします。さらに、参加者は、LLaMA-3 8Bモデルのアダプターをファインチューニングする実習を体験しながら、LoRAのようなPEFT(Parameter Efficient Fine-Tuning)テクニックを使ったモデルのファインチューニングを探求します。

## ラボのデプロイ

### 前提条件

このチュートリアルを実行するには、Ampereまたはそれ以降の世代の80GB GPUを最低1つ搭載したラップトップ/ワークステーション/DGXマシンが必要です。

- 最新の[Docker](https://docs.docker.com/engine/install/)をインストールし、GPUアクセスを可能にするNVIDIA Container Toolkitがインストールに含まれていることを確認してください。
- ファインチューニングのラボでは、モデルの重みをダウンロードするためにHuggingfaceセキュリティトークンが必要です。手順は[こちらのリンク]( https://huggingface.co/docs/hub/en/security-tokens )にあります。

### テスト環境

Ampere A100 GPUを搭載したDGXマシンですべてのラボをテスト・実行しました。

#### 1. 仮想環境のセットアップ

まず、このリポジトリをクローンし、プロジェクト・ディレクトリに移動します:
```bash
git clone https://github.com/openhackathons-org/NIM-Bootcamp/tree/main
cd NIM-Bootcamp
```

新しい仮想環境を作成し、アクティブにします:
```bash
# Create virtual environment
python -m venv nim-bootcamp-env

# Activate virtual environment
source nim-bootcamp-env/bin/activate
```

#### 2. 必要なパッケージのインストール

仮想環境を起動した状態で、必要なパッケージをインストールします:
```bash
# Upgrade pip (recommended)
pip install --upgrade pip

# Install requirements
pip install -r https://github.com/openhackathons-org/NIM-Bootcamp/blob/main/bootcamp_requirements.txt
```

#### 3. GPU アクセスの検証

お使いの環境が GPU リソースにアクセスできることを確認するには、以下の Python コマンドを実行します:
```python
import torch

# Check if CUDA is available
print(f"CUDA available: {torch.cuda.is_available()}")

# If CUDA is available, show device information
if torch.cuda.is_available():
print(f"Current device: {torch.cuda.get_device_name(0)}")
print(f"Device count: {torch.cuda.device_count()}")
```

これらのコマンドは、Pythonターミナルで実行することも、簡単なスクリプトを作成することもできます。

#### 4. JupyterLab の起動

ポート8888でJupyterLabを起動します:
```bash
#Choose the desired workspace:
cd workspace-nim-with-rag
# Basic start
jupyter lab --port 8888

# If you want to make it accessible from other machines on your network
jupyter lab --port 8888 --ip 0.0.0.0

# If you want to specify a particular browser
jupyter lab --port 8888 --browser="chrome"
```

コマンドを実行すると、次のような出力が表示されるはずです:
```
[I 2025-01-29 10:00:00.000 LabApp] JupyterLab extension loaded from /path/to/extension
[I 2025-01-29 10:00:00.000 LabApp] JupyterLab application directory is /path/to/app
[I 2025-01-29 10:00:00.000 ServerApp] Serving notebooks from local directory: /path/to/your/project
[I 2025-01-29 10:00:00.000 ServerApp] Jupyter Server 1.x is running at:
[I 2025-01-29 10:00:00.000 ServerApp] http://localhost:8888/lab
```

出力されたURLをコピーし、ブラウザに貼り付けます。トークンの入力を求められたら、ターミナルの出力でそれを見つけることができます。

#### トラブルシューティング

何らかの問題が発生した場合:

1. **仮想環境の問題**
- 仮想環境を作成する際に、正しいディレクトリにいることを確認してください。
- 仮想環境が有効になっていることを確認します。(ターミナルプロンプトに `(nim-bootcamp-env)` と表示されるはずです)

2. **Package Installation Issues**
- Try updating pip before installing requirements: `pip install --upgrade pip`
- If a package fails to install, try installing it separately

3. **GPU アクセスの問題**
- NVIDIAドライバが正しくインストールされているか確認します。
- CUDAツールキットがインストールされていて、PyTorchのバージョンと一致しているか確認します。
- ターミナルで `nvidia-smi` を実行して GPU が認識されていることを確認します。

4. **JupyterLab アクセスの問題**
- ポート8888が他のアプリケーションによって使用されていないか確認してください。
- 他のマシンからアクセスする場合、ファイアウォール設定が接続を許可していることを確認します。
- ポート8888が使用できない場合は、別のポートを試してください。

追加のヘルプが必要な場合は、GitHubリポジトリでissueをオープンして下さい。

`http://localhost:8888`でブラウザを開き、`Start_Here.ipynb`をクリックします。
残りのラボの作業が終わり次第、`File > Shut Down`を選択してjupyterラボをシャットダウンし、ターミナルウィンドウで`exit`とタイプするか、`ctrl+d`を押してコンテナをシャットダウンします。

これでNIM Bootcampのビルドとデプロイは完了です!









46 changes: 46 additions & 0 deletions README-jp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# NVIDIA NIM ブートキャンプ
NVIDIA® NIM™ ブートキャンプへようこそ!このハンズオン学習プログラムでは、NVIDIA® NIM™ を使用した本番環境対応の生成AIアプリケーション構築スキルを習得できます。
参加者は「検索拡張生成(Retrieval Augmented Generation: RAG)」のクラウドベースとローカル展開の両シナリオを実践を通じて学びます。包括的なラボでは以下を指導します:

* NIM Dockerコンテナのセットアップと運用
* 推論用REST APIエンドポイントの実装と利用
* エンドツーエンドRAGアプリケーションの構築
* PEFT(Parameter Efficient Fine-Tuning)手法の探索
* カスタムLoRA(Low-Rank Adaptation)モデルのトレーニングとデプロイ
* Llama-3 8Bなど最新モデルのアダプターのファインチューニング

## ブートキャンプ内容
3つの主要ラボとオプショナルのLoRAファインチューニングNotebookから構成されます:

- Lab 1: NVIDIA NIM APIを利用したRAG構築
- Lab 2: ローカル環境でのNVIDIA NIM活用
- Lab 3: LoRAアダプターを用いたNIM運用
- [オプション] カスタムデータセットでのアダプタートレーニング
- NIM Blueprintsの応用(近日公開)

## 使用ツールとフレームワーク

ブートキャンプの教材で使用するツールとフレームワークは以下の通りです:

- [NVIDIA NIM™](https://developer.nvidia.com/nim)


## 所要時間

合計約3時間30分


## ブートキャンプのマテリアルのデプロイ方法

ラボの展開手順は[デプロイガイド](https://github.com/openhackathons-org/NIM-Bootcamp/blob/main/Deployment_Guide.md)
を参照して下さい。

## 出典

この教材はOpenHackathons GitHubリポジトリが起源です。追加マテリアルは [こちらから](https://github.com/openhackathons-org)ご確認下さい。

[Open Hackathons Resources](https://www.openhackathons.org/s/technical-resources) の確認や、あなたの経験のシェアやコミュニティからより多くの助けを得るために[OpenACC and Hackathons Slack Channel](https://www.openacc.org/community#slack)への参加もお忘れなく!

## Licensing

Copyright © 2025 OpenACC-Standard.org. This material is released by OpenACC-Standard.org, in collaboration with NVIDIA Corporation, under the Creative Commons Attribution 4.0 International (CC BY 4.0). These materials may include references to hardware and software developed by other entities; all applicable licensing and copyrights apply.
1 change: 1 addition & 0 deletions bootcamp_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ pycryptodomex==3.20.0
pydantic==2.8.2
pydantic_core==2.20.1
Pygments==2.18.0
pypdf==5.7.0
python-dateutil==2.9.0.post0
python-json-logger==2.0.7
pytz==2024.1
Expand Down
115 changes: 115 additions & 0 deletions workspace-nim-with-rag-jp/Start-NIM-RAG.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "aad2fbb6-2499-4d0e-8869-41dd8ff57c11",
"metadata": {},
"source": [
"# RAG(検索拡張生成)によるNIMアプリケーション \n",
"---"
]
},
{
"cell_type": "markdown",
"id": "2abac7d8-8d46-4a88-83f7-e543b8529369",
"metadata": {},
"source": [
"## NVIDIA推論マイクロサービス NVIDIA NIM 入門"
]
},
{
"cell_type": "markdown",
"id": "8587527a-eb01-4dff-9f38-bbea97270dc2",
"metadata": {},
"source": [
"This contents was last updated on Jul 17, 2025. \n",
"\n",
"NVIDIA AI Enterpriseの一部であるNVIDIA NIM™は、生成AIモデルのデプロイを加速するために設計された、使いやすいマイクロサービスのセットです。これは、クラウド、データセンター、ワークステーションを含むさまざまな環境にわたって、事前学習済みAIモデルとカスタマイズされたAIモデルの両方に対してGPUによって高速化された推論マイクロサービスをセルフホストするためのコンテナを提供します。モデルは、業界標準のAPIから呼び出すだけで利用できます。これらのマイクロサービスは、モデル・ファミリーやモデルごとに分類され、さまざまなAIデプロイのニーズに対して柔軟性と拡張性を提供します。NIMは、実行エンジンやランタイム操作などのモデル推論内部を抽象化します。\n",
"\n",
"<div style=\"text-align: center;\">\n",
"<img src=\"jupyter_notebook/imgs/nim-benefits.png\" style=\"width: 90%; max-width: 800px;\" text-align: center>\n",
"</div>\n",
"\n",
"**主なメリット:**\n",
"1. **市場投入期間の短縮**: NVIDIA NIMは使いやすくスケーラブルなモデル推論ソリューションとして設計されているため、開発者はインフラストラクチャの構築やスケールアウトにサイクルを費やすことなく、アプリケーションロジックの開発に集中することができます。\n",
"2. **適応可能なスケーラビリティ**: このシステムは、少数のユーザーから数百万人規模のユーザーまで、容易に拡張できる高性能なデプロイメントを提供し、一貫したパフォーマンスを保証します。\n",
"3. **包括的な言語モデルのサポート**: 最先端の大規模言語モデル(LLM)アーキテクチャに最適化されたエンジンを提供し、高度な言語処理能力を実現します。\n",
"4. **シームレスな統合**: このマイクロサービスは、既存のシステムやアプリケーションに簡単に統合できるように設計されています。開発者には、OpenAI API互換のプログラミングインターフェースと、機能強化のためのNVIDIA独自の拡張機能が提供されます。\n",
"5. **強固なセキュリティ対策**: このプラットフォームは、セーフセンサーの実装、テクノロジースタック内の共通脆弱性・暴露(CVE)の継続的な監視と対処、定期的な内部セキュリティ評価の実施により、エンタープライズレベルのセキュリティを優先しています。\n",
"<div style=\"text-align: center;\">\n",
"<img src=\"jupyter_notebook/imgs/practitioner-nim.png\" style=\"width: 70%; max-width: 800px;\" text-align: center>\n",
"</div>"
]
},
{
"cell_type": "markdown",
"id": "f612c9b4-3408-4867-a35f-35c4a39415b3",
"metadata": {},
"source": [
"以下の目次を通じて、RAGとNIMのアプローチについて説明し、含まれるチャレンジではコンセプトの理解を確認しましょう。"
]
},
{
"cell_type": "markdown",
"id": "5dd69f64-5e2a-43f5-9afd-2cd7bb11f81e",
"metadata": {},
"source": [
"### 目次\n",
"\n",
"1. [NVIDIA NIM APIを利用したRAG構築](jupyter_notebook/rag_nim_endpoints.ipynb)\n",
"1. [ローカル環境でのNVIDIA NIM活用](jupyter_notebook/locally_deployed_nim.ipynb)\n",
"1. [LoRAアダプターを用いたNIM運用](jupyter_notebook/nim_lora_adapter.ipynb) \n",
"1. [エージェントとしてのNVIDIA NIM](jupyter_notebook/nim_agent_main.ipynb)"
]
},
{
"cell_type": "markdown",
"id": "5e276b10-01c2-47a4-adf9-22f81724681a",
"metadata": {},
"source": [
"### チュートリアル時間\n",
"\n",
"合計3時間のセッション\n",
"\n",
"### 内容レベル\n",
"初級~上級\n",
"\n",
"### 対象者および前提条件\n",
"このラボの対象者は、GPUを使用した生成AIタスクを解決するためのRAG(Retrieval Augmented Generation)とNVIDIA NIMアプローチに興味のある研究者、開発者、大学院生です。受講者は、Pythonプログラミングと自然言語処理の知識を持ち、NVIDIA NGCとAPIキーを所有していることが期待されます。"
]
},
{
"cell_type": "markdown",
"id": "c2cab51b-02ab-49ff-9c2c-84a5a08a0f06",
"metadata": {},
"source": [
"---\n",
"\n",
"## Licensing\n",
"\n",
"Copyright © 2024 OpenACC-Standard.org. This material is released by OpenACC-Standard.org, in collaboration with NVIDIA Corporation, under the Creative Commons Attribution 4.0 International (CC BY 4.0). These materials include references to hardware and software developed by other entities; all applicable licensing and copyrights apply."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.11"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading