Skip to content

Commit

Permalink
add flag for setting max split size
Browse files Browse the repository at this point in the history
  • Loading branch information
priyakasimbeg committed Oct 31, 2023
1 parent 152cf64 commit 119f8d7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,13 @@ To use the Docker container as an interactive virtual environment, you can run a
-v $HOME/algorithmic-efficiency:/algorithmic-efficiency \
--gpus all \
--ipc=host \
<<<<<<< HEAD
<docker_image_name> \
-keep_container_alive true
=======
<docker_image_name> \
--keep_container_alive true
>>>>>>> ba5c6f6175a0ce12f23a7f035613d9d1edc0b74a
```
Note: You may have to use double quotes around `algorithmic-efficiency` [path] in the mounting `-v` flag. If the above command fails try replacing the following line:
```bash
Expand Down
8 changes: 8 additions & 0 deletions submission_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@
None,
'Value of rng seed. If None, a random seed will'
'be generated from hardware.')
flags.DEFINE_boolean(
'set_pytorch_max_split_size',
None,
'If true, set pytorch max_split_size_mb to 256'
)
FLAGS = flags.FLAGS
USE_PYTORCH_DDP, RANK, DEVICE, N_GPUS = pytorch_setup()

Expand Down Expand Up @@ -601,6 +606,9 @@ def main(_):
# Prevent OOM on librispeech conformer.
if FLAGS.workload == 'librispeech_conformer':
os.environ['XLA_PYTHON_CLIENT_MEM_FRACTION'] = '0.85'

if FLAGS.set_pytorch_max_split_size is True:
os.environ['PYTORCH_CUDA_ALLOC_CONF'] = 'max_split_size_mb:256'

# Extend path according to framework.
workload_metadata['workload_path'] = os.path.join(
Expand Down

0 comments on commit 119f8d7

Please sign in to comment.