Skip to content

Commit

Permalink
Add torch and GPU
Browse files Browse the repository at this point in the history
  • Loading branch information
msaroufim committed Nov 11, 2024
1 parent 668e4ea commit 9c5c588
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/train_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ on:

jobs:
train:
runs-on: ubuntu-latest
runs-on: [gpumode-nvidia-arc, amd-mi250] # Add more GPUs as we get them here
steps:
- name: Install dependencies
run: |
pip install numpy
# pip install torch - need to find a way to cache this otherwise it will take a long time to install
pip install numpy torch
- name: Create and run training script
run: |
Expand Down
12 changes: 8 additions & 4 deletions train.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import numpy
import torch

a = numpy.array([1, 2, 3])
b = numpy.array([4, 5, 6])


# Vector addition
a = torch.tensor([1, 2, 3]).cuda()
b = torch.tensor([4, 5, 6]).cuda()
c = a + b

print(c)
print(a)
print(b)
print(c)

0 comments on commit 9c5c588

Please sign in to comment.