Skip to content

Conversation

@davidjurado
Copy link
Contributor

@davidjurado davidjurado commented Dec 1, 2023

GPUs example

NOTE: This example depends on: MLCUBE PR 345

Project setup

An important requirement is that you must have Docker and/or Singularity installed.

# Create Python environment and install MLCube with runners 
virtualenv -p python3 ./env && source ./env/bin/activate && pip install mlcube-docker mlcube-singularity
# Fetch the gpus example from GitHub
git clone https://github.com/mlcommons/mlcube_examples && cd ./mlcube_examples
git fetch origin pull/68/head:feature/gpu_example && git checkout feature/gpu_example
cd ./gpus/

MLCube tasks

There is only one taks that will output the variable CUDA_VISIBLE_DEVICES along with the ouput of the nvidia-smi command:

mlcube run --task=check_gpus

You can modify the number of gpus by editing the number of accelerator_count inside the mlcube.yaml file.

Also you can override the number of gpus to use by using the --gpus flag when running the command, example:

mlcube run --task=check_gpus --gpus=2

Singularity

For running on Singularity, you can define the platform while running the command as follows:

mlcube run --task=check_gpus --platform=singularity

@davidjurado davidjurado requested a review from a team as a code owner December 1, 2023 15:13
@github-actions
Copy link

github-actions bot commented Dec 1, 2023

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@davidjurado davidjurado changed the title Add gpus example [WIP] Add gpus example Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant