以下為一系列使用TWCC 建立GPGPU Container 執行運算工作的教學:
- 各項Tutorial的前置作業
Tutorial 1 -- MNIST(手寫數字辨識資料集)
- 進行MNIST手寫數字圖像的AI training。
Tutorial 2 -- GPU Burn Testing
- 利用GPU Burn來測試GPU用量是否正常。
Tutorial 3 -- InceptionV3 Training
- Container掛載S3 bucket,以S3 tool將dataset上傳至S3 bucket後,再進行影像辨識training;結果儲存於S3 bucket,以供外部存取。
Tutorial 4 -- InceptionV3 Inference
- 使用InceptionV3進行影像辨識。
- 請先申請iService帳號與可使用TWCC資源之計畫
- 登入TWCC
-
掛載S3 Bucket (Only for Tutorial 3)
Storage需掛載上傳dataset所使用的S3 bucket。 p.s. 左側Storage選完已建立的S3 bucket後①,需點右邊的加號才能完成掛載S3 bucket②,完成結果將顯示在下方③。
- 下載S3 tool (S3儲存工具),如S3 browser (for Windows)或Cyberduck (for Linux)。
- 執行S3 tool,依TWCC S3 Storage Overview提供之URL、Access Key與Secret Key連線。
- 以S3 browser為例:
-
從Container細節頁面點擊使用Jupyter terminal進入container(或以SSH連線進入)。
若欲以Jupyter terminal連線,點擊右側的New①與內部的Terminal②以開啟連線。 若以SSH連線,請使用iService主機帳號與密碼登入。
-
輸入以下指令,將NCHC_GitHub training程式複製到container。
git clone https://github.com/TW-NCHC/AI-Services.git
-
輸入以下指令,進入Tutorial_Two目錄。
cd AI-Services/Tutorial_Two
-
輸入以下指令,會將GPU_Burn程式下載下來並開始進行GPU。
bash gpu_testing.sh
- 從Cifar 10下載dataset (CIFAR-10 python version):
-
輸入以下指令,進入Tutorial_Three目錄。
cd AI-Services/Tutorial_Three
-
輸入以下指令,在GPFS備好dataset。資料將從S3 bucket移至GPFS掛載路徑且準備進行訓練。
bash V3_training.sh --path <your_S3_bucket_name>
從TWCC的container列表可刪除container。 若S3 bucket內的檔案不需保留,可利用S3 tool刪除檔案。
### Step 1. AI Inference
-
開啟cmd,使用SSH連線進入Container。
ssh -p <container_port> -L 5000:127.0.0.1:5001 <computer_account>@<container_ip>
指令的參數可點入container細節頁面查詢: ① container_port ② computer_account ③ container_ip
-
輸入以下指令,進入Tutorial_Three目錄。
cd AI-Services/Tutorial_Three
-
輸入以下指令,會開啟AI Inference 的服務。
bash V3_inference.sh
-
開啟瀏覽器,並輸入以下網址可開始使用AI Inference 的服務。
localhost:5000