Skip to content

Maximising multi-instance and multi-GPU utilisation

0

Hi,

I've been trying to distribute the MNIST example across instances and GPUs with SageMaker Tensorflow, but I'm not seeing the kind of benefit that I was hoping for. I'm not sure whether I'm just setting the job up incorrectly or whether this example is just not suited to distribution and was wondering if anyone has any ideas which it might be please?

I'm using TensorFlow 1.9 because I think MPI/Horovod doesn't work with 1.12 which I was using originally?

In my test I get these results with a batch size of 512:
1 Instance 1 GPU 13.5 global_step/sec
2 Instance 1 GPU 7.3 global_step/sec
1 Instance 8 GPU 18.8 global_step/sec

If I reduce the batch size I get lower overall throughput, and see little benefit when increasing beyond 512.

My job specification looks as below and mnist.py is the file which comes with the examples, though I changed batch_size=100 to batch_size=512 in the script:

estimator = TensorFlow(entry_point='mnist.py',
                  role=role,
                  framework_version='1.9.0',
                  training_steps=1250, 
                  evaluation_steps=10,
                  train_max_run=5*60,    
                  output_path=output_location,
                  checkpoint_path=output_location,
                  code_location=output_location,
                  model_dir=output_location,
                  train_instance_count=1,
                  train_instance_type='ml.p3.16xlarge',
                  base_job_name='PerformanceTest-p3-16xlarge-1-instance',
                  distributions={
                    'mpi': {
                      'enabled': True,
                      'processes_per_host': 8,
                      'custom_mpi_options': '--NCCL_DEBUG INFO'
                    }
                  })

What I was hoping to see was a single 8-GPU instance hitting global_step/sec of 70.2-97.2. Based on 8x the global_step/sec of a single instance, scaled with 60-90% efficiency. Any help or clarification on this would be greatly appreciated!

Thanks,

Carl

asked 8 years ago402 views

2 Answers
0

Hi,

Sorry that we are not clear in the doc.

MPI/Horovod support is only available since 1.12 in script mode. So according to your codes, if you use 1.9, then the mpi related parameter doesn't work. We will add version check in the codes.

So my recommendation for your test is,

  1. You need to use 1.12 as explained above.
  2. MNIST may not be a good example for performance testing. It's pretty small.

answered 8 years ago

0

Thanks for the reply. I'll try to rerun the experiment, I'll also try with a different network.

Cheers,

Carl

answered 8 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.