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

chore: rename use_gpu to disable_gpu in TorchAlgo #436

Merged
merged 5 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/436.changed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Apply `use_gpu` to `diasble_gpu` renaming on SubstraFL in all `TorchAlgo`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Apply `use_gpu` to `diasble_gpu` renaming on SubstraFL in all `TorchAlgo`
Apply `use_gpu` to `disable_gpu` renaming on SubstraFL in all `TorchAlgo`

Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@
" index_generator=index_generator,\n",
" dataset=TorchDataset,\n",
" seed=seed,\n",
" use_gpu=False,\n",
" disable_gpu=True,\n",
" )"
]
},
Expand Down Expand Up @@ -558,7 +558,7 @@
"The [Dependency](https://docs.substra.org/en/stable/substrafl_doc/api/dependency.html) object is instantiated in order to install the right libraries in\n",
"the Python environment of each organization.\n",
"\n",
"The CPU torch version is installed here to have a `Dependency` object as light as possible as we don't use GPUs (`use_gpu` set to `False`). Remove the `--extra-index-url` to install the cuda torch version."
"The CPU torch version is installed here to have a `Dependency` object as light as possible as we don't use GPUs (`disable_gpu` set to `True`). Remove the `--extra-index-url` to install the cuda torch version."
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@
" index_generator: NpIndexGenerator,\n",
" dataset: torch.utils.data.Dataset,\n",
" seed: Optional[int] = None,\n",
" use_gpu: bool = True,\n",
" disable_gpu: bool = False,\n",
" *args,\n",
" **kwargs,\n",
" ):\n",
Expand All @@ -678,7 +678,7 @@
" dataset (torch.utils.data.Dataset): an instantiable dataset class whose ``__init__`` arguments are\n",
" ``x``, ``y`` and ``is_inference``.\n",
" seed (typing.Optional[int]): Seed set at the algo initialization on each organization. Defaults to None.\n",
" use_gpu (bool): Whether to use the GPUs if they are available. Defaults to True.\n",
" disable_gpu (bool): Force to disable GPUs usage. Defaults to False.\n",
" \"\"\"\n",
" super().__init__(\n",
" model=model,\n",
Expand All @@ -688,7 +688,7 @@
" dataset=dataset,\n",
" scheduler=None,\n",
" seed=seed,\n",
" use_gpu=use_gpu,\n",
" disable_gpu=disable_gpu,\n",
" *args,\n",
" **kwargs,\n",
" )\n",
Expand Down Expand Up @@ -815,7 +815,7 @@
" index_generator=index_generator,\n",
" dataset=TorchDataset,\n",
" seed=seed,\n",
" use_gpu=False,\n",
" disable_gpu=True,\n",
" )\n",
"\n",
"\n",
Expand Down
Loading