-
Notifications
You must be signed in to change notification settings - Fork 9
55 lines (49 loc) · 1.4 KB
/
train_workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Training Workflow
on:
workflow_dispatch:
inputs:
script_content:
description: 'Content of training script (Python or CUDA)'
required: true
type: string
script_type:
description: 'Script type (py or cu)'
required: true
type: choice
options:
- py
- cu
jobs:
train:
runs-on: ubuntu-latest
steps:
- name: Install Python dependencies
if: inputs.script_type == 'py'
run: |
pip install numpy
# Add other Python dependencies as needed
- name: Install CUDA dependencies
if: inputs.script_type == 'cu'
run: |
sudo apt-get update
sudo apt-get install -y nvidia-cuda-toolkit
nvcc --version
- name: Create training script
run: |
echo '${{ inputs.script_content }}' > train.${{ inputs.script_type }}
cat train.${{ inputs.script_type }}
- name: Compile and run CUDA script
if: inputs.script_type == 'cu'
run: |
nvcc train.cu -o train_cuda
./train_cuda > training.log 2>&1
- name: Run Python script
if: inputs.script_type == 'py'
run: |
python train.py > training.log 2>&1
- name: Upload logs
uses: actions/upload-artifact@v3
if: always()
with:
name: training-logs
path: training.log