Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to specify the number of GPUs #125

Merged
merged 2 commits into from
Jul 26, 2023
Merged

Conversation

jan-janssen
Copy link
Member

No description provided.

@jan-janssen jan-janssen merged commit e51652f into main Jul 26, 2023
15 of 16 checks passed
@jan-janssen jan-janssen deleted the gpu_support branch July 26, 2023 16:19
@jan-janssen
Copy link
Member Author

Simple example code:

from pympipool import Executor
from tensorflow.python.client import device_lib

def get_available_gpus():
    local_device_protos = device_lib.list_local_devices()
    return [x.name for x in local_device_protos if x.device_type == 'GPU']


if __name__ == "__main__":
    with Executor(cores=1, gpus_per_task=1, enable_flux_backend=True) as exe:
        fs = exe.submit(get_available_gpus)
    
    print(fs.result())

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.

None yet

1 participant