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-06-17 15:45:26 -04:00
|
|
|
env:
|
|
|
|
RIAGIT_USERNAME: ${{ secrets.USERNAME }}
|
|
|
|
RIAGIT_TOKEN: ${{ secrets.TOKEN }}
|
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-06-18 10:11:56 -04:00
|
|
|
pip install -r requirements.txt
|
2025-06-17 15:45:26 -04:00
|
|
|
|
2025-05-15 10:55:36 -04:00
|
|
|
|
2025-06-13 13:58:35 -04:00
|
|
|
- name: 1. Generate Recordings
|
|
|
|
run: |
|
|
|
|
mkdir -p data/recordings
|
2025-06-13 14:20:32 -04:00
|
|
|
PYTHONPATH=. python scripts/dataset_building/data_gen.py --output-dir data/recordings
|
2025-06-13 13:58:35 -04:00
|
|
|
echo "recordings produced successfully"
|
2025-06-17 14:16:16 -04:00
|
|
|
|
|
|
|
- name: 📦 Zip and Upload Recordings
|
|
|
|
run: |
|
|
|
|
echo "📦 Zipping recordings..."
|
|
|
|
zip -qr recordings.zip data/recordings
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: ⬆️ Upload zipped recordings
|
2025-06-13 13:58:35 -04:00
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: recordings
|
2025-06-17 14:16:16 -04:00
|
|
|
path: recordings.zip
|
2025-06-13 13:58:35 -04:00
|
|
|
|
|
|
|
- name: 2. Build HDF5 Dataset
|
2025-05-26 12:04:20 -04:00
|
|
|
run: |
|
|
|
|
mkdir -p data/dataset
|
2025-06-13 13:58:35 -04:00
|
|
|
PYTHONPATH=. python scripts/dataset_building/produce_dataset.py
|
2025-05-26 12:04:20 -04:00
|
|
|
echo "datasets produced successfully"
|
|
|
|
shell: bash
|
2025-05-26 09:44:53 -04:00
|
|
|
|
2025-06-17 14:16:16 -04:00
|
|
|
- name: 📦 Zip Dataset
|
|
|
|
run: zip -qr dataset.zip data/dataset
|
|
|
|
|
|
|
|
- name: 📤 Upload Zipped Dataset
|
2025-05-26 09:44:53 -04:00
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2025-06-16 09:29:08 -04:00
|
|
|
name: dataset
|
2025-06-17 14:16:16 -04:00
|
|
|
path: dataset.zip
|
2025-05-15 10:55:36 -04:00
|
|
|
|
2025-06-13 13:58:35 -04:00
|
|
|
- name: 3. 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-06-13 15:03:42 -04:00
|
|
|
mkdir -p checkpoint_files
|
2025-06-13 13:58:35 -04:00
|
|
|
PYTHONPATH=. python scripts/training/train.py
|
2025-05-15 10:55:36 -04:00
|
|
|
echo "training model"
|
2025-06-18 10:14:24 -04:00
|
|
|
|
|
|
|
- name: 4. Plot Model
|
|
|
|
env:
|
|
|
|
NO_NNPACK: 1
|
|
|
|
PYTORCH_NO_NNPACK: 1
|
|
|
|
run: |
|
|
|
|
PYTHONPATH=. python scripts/training/plot_data.py
|
|
|
|
|
2025-05-15 10:55:36 -04:00
|
|
|
|
2025-05-22 14:12:54 -04:00
|
|
|
- name: Upload Checkpoints
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2025-06-16 09:29:08 -04:00
|
|
|
name: checkpoints
|
2025-06-16 09:39:13 -04:00
|
|
|
path: checkpoint_files/*
|
2025-05-14 15:40:08 -04:00
|
|
|
|
2025-06-16 10:05:01 -04:00
|
|
|
|
2025-06-13 13:58:35 -04:00
|
|
|
- name: 4. Convert to ONNX file
|
2025-06-17 14:16:16 -04:00
|
|
|
env:
|
|
|
|
NO_NNPACK: 1
|
|
|
|
PYTORCH_NO_NNPACK: 1
|
2025-05-26 09:44:53 -04:00
|
|
|
run: |
|
2025-06-13 15:03:42 -04:00
|
|
|
mkdir -p onnx_files
|
2025-06-16 13:43:59 -04:00
|
|
|
MKL_DISABLE_FAST_MM=1 PYTHONPATH=. python scripts/onnx/convert_to_onnx.py
|
2025-05-26 09:44:53 -04:00
|
|
|
echo "building inference app"
|
2025-05-27 15:49:00 -04:00
|
|
|
|
2025-05-26 09:44:53 -04:00
|
|
|
- name: Upload ONNX file
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2025-06-16 13:43:59 -04:00
|
|
|
name: onnx-file
|
2025-05-26 09:44:53 -04:00
|
|
|
path: onnx_files/inference_recognition_model.onnx
|
2025-05-26 10:28:11 -04:00
|
|
|
|
2025-06-16 10:05:01 -04:00
|
|
|
- name: List checkpoint directory
|
2025-06-16 10:07:35 -04:00
|
|
|
run: ls -lh onnx_files
|
|
|
|
|
2025-06-16 10:05:01 -04:00
|
|
|
|
2025-06-13 13:58:35 -04:00
|
|
|
- name: 5. Profile ONNX model
|
2025-05-26 10:28:11 -04:00
|
|
|
run: |
|
2025-06-18 10:14:24 -04:00
|
|
|
PYTHONPATH=. python scripts/onnx/profile_onnx.py
|
2025-05-26 10:28:11 -04:00
|
|
|
|
|
|
|
- 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
|
|
|
|
2025-06-13 13:58:35 -04:00
|
|
|
- name: 6. Convert to ORT file
|
2025-05-26 09:44:53 -04:00
|
|
|
run: |
|
2025-06-16 13:43:59 -04:00
|
|
|
python -m scripts/ort/convert_to_ort.py
|
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-06-16 13:43:59 -04:00
|
|
|
name: ort-file
|
2025-05-26 09:44:53 -04:00
|
|
|
path: ort_files/inference_recognition_model.ort
|
|
|
|
|