Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
msaroufim committed Nov 12, 2024
2 parents 6d0dddd + 955fa65 commit 8a88a1c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/train_workflow.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: AMD PyTorch Job
name: NVIDIA PyTorch Job

on:
workflow_dispatch:
Expand All @@ -10,8 +10,9 @@ on:

jobs:
train:
runs-on: [amdgpu-mi250-x86-64]

runs-on: [gpumode-nvidia-arc]
container:
image: nvidia/cuda:12.4.0-devel-ubuntu22.04
steps:
- name: Setup Python
uses: actions/setup-python@v4
Expand All @@ -21,7 +22,7 @@ jobs:
- name: Install dependencies
run: |
pip install numpy
pip install torch --index-url https://download.pytorch.org/whl/rocm6.2
pip install torch
- name: Create training script
shell: python
Expand Down
12 changes: 4 additions & 8 deletions train.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import torch

a = torch.Tensor([1, 2, 3, 4, 5]).to("cuda")
b= torch.Tensor([1, 2, 3, 4, 5]).to("cuda")

if torch.cuda.is_available():
gpu_name = torch.cuda.get_device_name(0)
print(f"GPU Name: {gpu_name}")
else:
print("No GPU available")
a = torch.Tensor([1, 2, 3, 4, 5]).cuda()
b= torch.Tensor([1, 2, 3, 4, 5]).cuda()

print(a)
print(b)
print(a + b)

0 comments on commit 8a88a1c

Please sign in to comment.