Is there a way to use the PyTorch profiler when using Amazon SageMaker?
Or can we call PyTorch profiler in the profiler config for SageMaker debugger
Question posted in Amazon Web Sevices
The official Amazon Web Services documentation can be found here.
The official Amazon Web Services documentation can be found here.
2
Answers
You can use the below snippet to initiate a Profiler .
Then you can pass the
profilfer_config
to thePytorch
estimator.To use the PyTorch vanilla profiler in SageMaker Training jobs:
estimator = PyTorch(..., disable_profiler=True, ...)
on_trace_ready=torch.profiler.tensorboard_trace_handler(f'{args.output_data_dir}/profile')
estimator.latest_job_tensorboard_artifacts_path()