diff --git a/algorithm_store.json b/algorithm_store.json index 0872808..b8c7252 100644 --- a/algorithm_store.json +++ b/algorithm_store.json @@ -21,7 +21,7 @@ }, { "name": "partial", - "description": "Retrieves GPU accessibility details for TensorFlow and PyTorch.", + "description": "Retrieves GPU accessibility details for TensorFlow.", "type": "federated", "databases": [], "arguments": [] diff --git a/docs/v6-gpu-accessibility/Implementation.rst b/docs/v6-gpu-accessibility/Implementation.rst index 7ac155d..21014d3 100644 --- a/docs/v6-gpu-accessibility/Implementation.rst +++ b/docs/v6-gpu-accessibility/Implementation.rst @@ -20,14 +20,9 @@ node. ``partial`` ~~~~~~~~~~~ -The partial function retrieves GPU accessibility details for TensorFlow and PyTorch through the respective helper functions. +The partial function retrieves GPU accessibility details for TensorFlow through the helper function. ``get_tensorflow_gpu_details`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This function checks if TensorFlow is accessible on the GPU. If a GPU is available it returns the GPU device name(s), memory, cores, and compute capability. - -``get_pytorch_gpu_details`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -This function checks if PyTorch is accessible on the GPU. -If a GPU is available it returns the GPU device name(s), memory, cores, and compute capability. diff --git a/docs/v6-gpu-accessibility/Validation.rst b/docs/v6-gpu-accessibility/Validation.rst index 3eef81c..4ac7754 100644 --- a/docs/v6-gpu-accessibility/Validation.rst +++ b/docs/v6-gpu-accessibility/Validation.rst @@ -6,7 +6,6 @@ The following steps can be taken to verify the GPU accessibility: .. code-block:: python import tensorflow as tf - import torch gpus = tf.config.list_physical_devices('GPU') if not gpus: @@ -18,14 +17,3 @@ The following steps can be taken to verify the GPU accessibility: "cores": [tf.config.experimental.get_device_details(gpu)['core_count'] for gpu in gpus], "compute capability": [tf.config.experimental.get_device_details(gpu)['compute_capability'] for gpu in gpus] }) - - if not torch.cuda.is_available(): - print('No GPUs available for PyTorch') - else: - print({ - "number of GPUs": torch.cuda.device_count(), - "memory": f'{[torch.cuda.get_device_properties(i).total_memory for i in range(torch.cuda.device_count())]} bytes', - "cores": [torch.cuda.get_device_properties(i).multi_processor_count for i in range(torch.cuda.device_count())], - "compute capability": [torch.cuda.get_device_properties(i).major for i in range(torch.cuda.device_count())] - }) - diff --git a/requirements.txt b/requirements.txt index 6a1f8fc..65ff5c9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ vantage6-algorithm-tools pandas tensorflow -torch diff --git a/setup.py b/setup.py index ad4fcef..36b70dc 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,6 @@ install_requires=[ 'vantage6-algorithm-tools', 'pandas', - 'tensorflow', - 'torch' + 'tensorflow' ] ) diff --git a/v6-gpu-accessibility/partial.py b/v6-gpu-accessibility/partial.py index e00f721..2444d91 100644 --- a/v6-gpu-accessibility/partial.py +++ b/v6-gpu-accessibility/partial.py @@ -7,7 +7,6 @@ or directly to the user (if they requested partial results). """ import tensorflow as tf -import torch from typing import Any @@ -19,20 +18,19 @@ @algorithm_client def partial(client: AlgorithmClient) -> Any: """ - Retrieves GPU accessibility details for TensorFlow and PyTorch. + Retrieves GPU accessibility details for TensorFlow. Args: client (AlgorithmClient): The algorithm client instance. Returns: - dict: A dictionary containing the organisation ID and GPU accessibility details for TensorFlow and PyTorch. + dict: A dictionary containing the organisation ID and GPU accessibility details for TensorFlow. """ info("Retrieving details of any GPUs available to the algorithm's Docker container") return { 'organisation_id': client.organization_id, 'gpu_accessibility': { - "Tensorflow": get_tensorflow_gpu_details(), - "PyTorch": get_pytorch_gpu_details() + "Tensorflow": get_tensorflow_gpu_details() } } @@ -54,21 +52,3 @@ def get_tensorflow_gpu_details() -> dict or str: "cores": [tf.config.experimental.get_device_details(gpu)['core_count'] for gpu in gpus], "compute capability": [tf.config.experimental.get_device_details(gpu)['compute_capability'] for gpu in gpus] } - - -def get_pytorch_gpu_details() -> dict or str: - """ - Retrieves details about available PyTorch GPUs. - - Returns: - dict or str: A dictionary containing the number of GPUs, their names, memory, cores, - and compute capability if GPUs are available. Otherwise, returns 'No GPUs available'. - """ - if not torch.cuda.is_available(): - return 'No GPUs available' - return { - "number of GPUs": torch.cuda.device_count(), - "memory": f"{[(torch.cuda.get_device_properties(i).total_memory/ (1024 * 1024)) for i in range(torch.cuda.device_count())]} MB", - "cores": [torch.cuda.get_device_properties(i).multi_processor_count for i in range(torch.cuda.device_count())], - "compute capability": [torch.cuda.get_device_properties(i).major for i in range(torch.cuda.device_count())] - }