-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
203 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import json | ||
import sys | ||
from pathlib import Path | ||
from dataclasses import asdict | ||
|
||
sys.path.append("src/discord-cluster-manager") | ||
|
||
from leaderboard_eval import cu_eval | ||
from run_eval import run_cuda_script | ||
|
||
ref = Path("reference.cuh") | ||
sub = Path("train.cuh") | ||
|
||
comp, run = run_cuda_script(cu_eval, ref.read_text(), sub.read_text(), arch=None) | ||
|
||
|
||
result = { | ||
"compile": asdict(comp), | ||
"run": asdict(run) | ||
} | ||
|
||
Path("result.json").write_text(json.dumps(result)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters