Skip to content

Commit

Permalink
Merge pull request #3 from getwilds/add-gpu-test
Browse files Browse the repository at this point in the history
Adding GPU test WDL
  • Loading branch information
tefirman authored Jul 1, 2024
2 parents 5674d33 + e133806 commit 2c7b760
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/womtools-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
run: |
java -jar womtool-86.jar validate helloHostname/helloHostname.wdl
java -jar womtool-86.jar validate helloDockerHostname/helloDockerHostname.wdl
java -jar womtool-86.jar validate gpuMatrixMult/gpuMatrixMult.wdl
java -jar womtool-86.jar validate parseBatchFile/parseBatchFile.wdl -i parseBatchFile/parseBatchFile-inputs.json
java -jar womtool-86.jar validate variantCalling/variantCalling.wdl -i variantCalling/variantCalling-inputs.json
Expand Down
57 changes: 57 additions & 0 deletions gpuMatrixMult/gpuMatrixMult.wdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
version 1.0
## This is a test workflow that performs simple matrix
## multiplication using a single GPU.
#### WORKFLOW DEFINITION
workflow GpuMatrixMult {
call Hello {
}

output {
File stdout = Hello.response
}

parameter_meta {
stdout: "printed results of the gpu script in question"
}
}

#### TASK DEFINITIONS
task Hello {
command <<<
set -e
echo 'hello there from the WILDS'

python3 <<CODE
import tensorflow as tf
# Creates a constant tensor from a tensor-like object.
a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')
b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')
# Multiplies two tensors element-wise.
c = tf.matmul(a, b)
# Prints the result.
print(c)
# Check if GPU is available
print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU')))
CODE
echo 'bye for now'
>>>
output {
File response = stdout()
}
runtime {
docker: 'tensorflow/tensorflow:latest-gpu'
# modules: "TensorFlow/2.11.0-foss-2022a-CUDA-11.7.0"
gpus: '1'
}
parameter_meta {
response: "printed results of the gpu script in question"
}
}

0 comments on commit 2c7b760

Please sign in to comment.