Is there a pytorch profiler integration with huggingface trainer?

I am trying to profile various resource utilization during training of transformer models using HuggingFace Trainer. Since the HF Trainer abstracts away the training steps, I could not find a way to use pytorch trainer as shown in here. I can extend the HF Trainer class and overwrite the train() function to integrate the profiler.step() instruction, but the train() function is a lengthy and complex one. Is there an easy way to using PyTorch Profiler with HuggingFace Trainer class?