Article Complete
    AIM

    PyTorch Profiler: Major Features & Updates

    PyTorch Profiler: Major Features & Updates

    The Profiler collects both GPU and framework related information.

    PyTorch Profiler: Major Features & Updates
    Ambika Choudhury··Updated DECEMBER 30, 2024, 5:30 AM
    5 min

    Recently, Python’s popular open-source machine learning library, PyTorch announced its new performance debug profiler, PyTorch Profiler, along with its 1.8.1 version release. The new tool -- developed as a part of a collaboration between tech giants Facebook and Microsoft -- enables accurate and efficient performance analysis in large scale deep learning models.

    https://twitter.com/PyTorch/status/1375177895648235521

    Behind PyTorch Profiler

    With a new module namespace torch.profiler, PyTorch Profiler is the successor of PyTorch autograd profiler. This new tool uses a new GPU profiling engine -- built using the NVIDIA CUPTI APIs -- and can capture the GPU kernel events with high fidelity. PyTorch includes a simple profiler API that is useful when determining the most expensive operators in the model.

    The Profiler collects both GPU and framework related information. The tool then correlates them, performs automatic detection of bottlenecks in the model, generates recommendations on how to resolve these bottlenecks, and visualise them. The new Profiler API is natively supported in PyTorch. Users can profile their models using this API, without installing any additional packages and get results immediately in TensorBoard with the new PyTorch Profiler plugin.  

    PyTorch profiler accepts several parameters. some of the most valuable parameters to analyse the execution time are:

    • record_shapes - whether to record shapes of the operator inputs;
    • profile_memory - whether to report the amount of memory consumed by the model’s Tensors
    • use_cuda - whether to measure execution time of CUDA kernels.

    To analyse the memory consumption, the PyTorch Profiler can show the amount of memory used by the model’s tensors allocated during the execution of the model’s operators. 

    Importance of Profiler In ML

    Analysing and performance improvement of deep learning models are some of the existing challenges researchers and developers face as the model’s size increases. According to sources, for a long time now, PyTorch users have a hard time solving these challenges due to the lack of available tools. The standard performance debugging tools that provide GPU hardware level information missed the PyTorch-specific context of operations. 

    To recover the missed information, users needed to combine multiple tools or manually add minimum correlation information to make sense of the data. An autograd profiler, known as torch.autograd.profiler, could capture information about PyTorch operations but does not capture detailed GPU hardware-level information or support visualisation. 

    The PyTorch Profiler (torch.profiler) is a tool that can capture both information about PyTorch operations and capture detailed GPU hardware-level information. 

    Advantages of Profiler

    According to a few Reddit users, the new tool will be more useful than its previous version and NVVP (Nvidia visual profiler) as it provides profile data-loading, processing, matching of GPU operations to your PyTorch modules and more.  

    The advantages of PyTorch Profiler are as follows:

    • To gain insight regarding the operations run inside a model.
    • To diagnose performance issues and optimise deep learning models.
    • To analyse the performance profile.
    • Identifies the bottlenecks and eliminates them by following the recommendations.
    • Lets users inspect the cost of different operators inside the model - both on the CPU and GPU.
    • To measure the time and memory consumption of the model’s operators. 

    Your reaction

    Discussion

    What's your take on this story?

    0/1000

    No comments yet — be the first to share your view.

    Explore our newsletters

    Build your routine with some of our top newsletters or view them all here.

    Wake up informed

    Make sense of the day's AI news and breakthroughs with our morning briefing.

    Belamy
    WeeklyBelamySee the latest

    Industry intelligence

    Receive a roundup of AI adoption stories by industry vertical, curated for professionals.

    3x WeeklySector6See the latest

    By signing up, you agree to our Privacy Policy.

    Membership

    Stay ahead with AI insights.

    Unlimited access to premium articles, exclusive analysis, and the stories shaping India's AI economy.

    Subscribe now

    AIM Americas

    1190 Miraloma Way Suite P, Sunnyvale, CA 94085

    AIM India

    1st Floor, Sakti Statesman, Bellandur, Bengaluru – 560103

    © 2026 AIM. All rights reserved.