Mar 28, 2023 | Read time 8 min

How to Accurately Time CUDA Kernels in Pytorch

In a world of increasingly costly machine learning model deployments, ensuring accurate GPU operation timing is key to resource optimization. In this blog post, we explore best practices to achieve this in PyTorch.
PyTorch timing operations
Lawrence Atkins
Lawrence AtkinsMachine Learning Engineer
David MacLeod
David MacLeodMachine Learning Architect
References[1] Hoffmann, Jordan, et al. "Training compute-optimal large language models." arXiv preprint arXiv:2203.15556 (2022).

[2] Dao, Tri, et al. "Flashattention: Fast and memory-efficient exact attention with io-awareness." Advances in Neural Information Processing Systems 35 (2022): 16344-16359.

[3] Yao, Zhewei, et al. "ZeroQuant: Efficient and affordable post-training quantization for large-scale transformers." Advances in Neural Information Processing Systems 35 (2022): 27168-27183.

[4] Fawzi, Alhussein, et al. "Discovering faster matrix multiplication algorithms with reinforcement learning." Nature 610.7930 (2022): 47-53.
AuthorsLawrence Atkins & David MacLeod
AcknowledgementsCaroline Dockes, Ed Rees, Ellena Reid & Markus Hennerbichler
A black server rack surrounded by a koala, birds, a kangaroo, and two wombats against a white background.
Product

Australian Data Residency for Real-Time and Batch Transcription, in One Line of Config

Brad Phipps
Brad PhippsDirector, SaaS & Infrastructure
API Application Programming Interface, woman using laptop, tablet and smartphone with virtual screen API icon.
General

The Ultimate Guide to Speech-to-Text API Pricing: What Enterprises Need to Know in 2026

Speechmatics
SpeechmaticsEditorial Team
AI Chatbot Interface on Tablet Business Professional Interacting with Virtual Assistant Technology.
General

How to Integrate Speech-to-Text Into a CRM or Helpdesk Platform

Speechmatics
SpeechmaticsEditorial Team
Hand with speech bubble and text in many important languages. Translator and languages education with Artificial Intelligence concept.
General

A Practical Guide to Selecting a Speech-to-Text Provider for Multilingual Support

Speechmatics
SpeechmaticsEditorial Team
Voice Assistant Technology Person Using Smartphone with Digital Voice Recognition Interface and Laptop.
General

How to Reduce Latency in Real-Time Speech-to-Text Applications

Speechmatics
SpeechmaticsEditorial Team
Female hand interacting with a digital compliance interface in a futuristic setting emphasizing regulatory adherence and corporate governance.
General

The Complete Guide to Speech-to-Text for Compliance and Regulated Industries in 2026

Speechmatics
SpeechmaticsEditorial Team