Skip to content

Commit

Permalink
Ability to force a memory fraction to be unused in OOMptimizer
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Żelasko <[email protected]>
  • Loading branch information
pzelasko committed Jul 19, 2024
1 parent 9e632e4 commit b0e9057
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/speech_recognition/oomptimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,14 @@ def type_cast_value(self, ctx, value):
"By default we force 5% memory to be unused to account for non-training-loop related CUDA memory usage"
"in actual training scripts.",
)
@click.option(
"-d",
"--device",
default="cuda:0",
help="Device string to be passed to torch.device; due to MEMORY_FRACTION option, "
"it must specify the device index (e.g. cuda:0). "
"You can also leave the default index and select a specific GPU using env var CUDA_VISIBLE_DEVICES=<idx>",
)
def oomptimizer(
pretrained_name: str | None,
module_name: str | None,
Expand Down

0 comments on commit b0e9057

Please sign in to comment.