2025-05-14 15:40:08 -04:00
|
|
|
name: RIA Hub Workflow Demo
|
|
|
|
|
2025-05-15 10:55:36 -04:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
[main]
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
[main]
|
2025-05-14 15:40:08 -04:00
|
|
|
|
|
|
|
jobs:
|
2025-05-15 10:55:36 -04:00
|
|
|
ria-demo:
|
2025-05-22 15:57:40 -04:00
|
|
|
runs-on: ubuntu-latest-2080
|
2025-05-15 10:55:36 -04:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Print GPU information
|
|
|
|
run: |
|
|
|
|
if command -v nvidia-smi &> /dev/null; then
|
|
|
|
echo "✅ NVIDIA GPU is available"
|
|
|
|
nvidia-smi
|
|
|
|
else
|
|
|
|
echo "⚠️ No NVIDIA GPU found"
|
|
|
|
fi
|
|
|
|
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
lfs: true
|
|
|
|
|
|
|
|
- name: Set up Python
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: "3.10"
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
2025-05-16 14:00:27 -04:00
|
|
|
pip install -r requirements.txt
|
2025-05-15 10:55:36 -04:00
|
|
|
|
2025-05-26 10:06:18 -04:00
|
|
|
# - name: 1. Build HDF5 Dataset
|
|
|
|
# run: |
|
|
|
|
# mkdir -p data/dataset
|
|
|
|
# PYTHONPATH=. python data/scripts/produce_dataset.py
|
|
|
|
# echo "datasets produced successfully"
|
|
|
|
# shell: bash
|
2025-05-26 09:44:53 -04:00
|
|
|
|
|
|
|
- name: Upload Dataset Artifacts
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ria-dataset
|
|
|
|
path: data/dataset/**
|
|
|
|
|
2025-05-15 10:55:36 -04:00
|
|
|
|
|
|
|
- name: 2. Train Model
|
2025-05-23 10:06:46 -04:00
|
|
|
env:
|
|
|
|
NO_NNPACK: 1
|
2025-05-23 10:10:07 -04:00
|
|
|
PYTORCH_NO_NNPACK: 1
|
2025-05-15 10:55:36 -04:00
|
|
|
run: |
|
2025-05-23 10:10:07 -04:00
|
|
|
PYTHONPATH=. python data/training/train.py 2>/dev/null
|
2025-05-15 10:55:36 -04:00
|
|
|
echo "training model"
|
|
|
|
|
2025-05-22 14:12:54 -04:00
|
|
|
- name: Upload Checkpoints
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ria-checkpoints
|
|
|
|
path: checkpoint_files/inference_recognition_model.ckpt
|
2025-05-14 15:40:08 -04:00
|
|
|
|
2025-05-26 09:44:53 -04:00
|
|
|
- name: 3. Convert to ONNX file
|
|
|
|
run: |
|
2025-05-26 10:28:11 -04:00
|
|
|
PYTHONPATH=. python onnx_scripts/convert_to_onnx.py
|
2025-05-26 09:44:53 -04:00
|
|
|
echo "building inference app"
|
2025-05-26 10:28:11 -04:00
|
|
|
|
2025-05-26 09:44:53 -04:00
|
|
|
- name: Upload ONNX file
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ria-demo-onnx
|
|
|
|
path: onnx_files/inference_recognition_model.onnx
|
2025-05-26 10:28:11 -04:00
|
|
|
|
|
|
|
- name: 4. Profile ONNX model
|
|
|
|
run: |
|
|
|
|
PYTHONPATH=. python onnx_scripts/profile_onnx.py
|
|
|
|
|
|
|
|
- name: Upload JSON profiling data
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: profile-data
|
|
|
|
path: '**/onnxruntime_profile_*.json'
|
2025-05-26 09:44:53 -04:00
|
|
|
|
|
|
|
- name: 4. Convert to ORT file
|
|
|
|
run: |
|
|
|
|
python -m onnxruntime.tools.convert_onnx_models_to_ort \
|
2025-05-26 10:52:04 -04:00
|
|
|
/onnx_files/inference_recognition_model.onnx \
|
|
|
|
--output_dir /ort_files \
|
2025-05-26 10:28:11 -04:00
|
|
|
--optimization_style Fixed \
|
|
|
|
--target_platform amd64
|
2025-05-14 15:40:08 -04:00
|
|
|
|
2025-05-26 10:52:04 -04:00
|
|
|
|
2025-05-26 09:44:53 -04:00
|
|
|
- name: Upload ORT file
|
2025-05-22 14:12:54 -04:00
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2025-05-26 09:44:53 -04:00
|
|
|
name: ria-demo-ort
|
|
|
|
path: ort_files/inference_recognition_model.ort
|
|
|
|
|