Skip to content

NVIDIA CUDA Job

NVIDIA CUDA Job #23

name: NVIDIA CUDA Job
on:
push:
branches:
- '**'
workflow_dispatch:
inputs:
script_content:
description: 'Content of CUDA script'
required: true
type: string
reference_content:
description: 'Content of the reference code script'
required: true
type: string
jobs:
run:
runs-on: [gpumode-nvidia-arc]
timeout-minutes: 10
container:
image: nvidia/cuda:12.4.0-devel-ubuntu22.04
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Create input files
shell: bash
run: |
cat > "train.cuh" <<EOL
${{ github.event.inputs.script_content }}
EOL
cat "train.cuh" # Debug: show file contents
echo "Creating reference script..."
cat > "reference.cuh" <<EOL
${{ github.event.inputs.reference_content }}
EOL
cat "reference.cuh" # Debug: Show file contents
- name: Run script
shell: bash
run: |
python .github/workflows/run-cuda.py
cat result.json # Debug: show output
- name: Upload training artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: run-result
path: |
result.json
train.cuh
env:
CUDA_VISIBLE_DEVICES: 0