PyTorch and CPU-GPU Synchronizations [PyCon DE & PyData 2026] @PyDataTV
PyTorch and CPU-GPU Synchronizations [PyCon DE & PyData 2026]  @PyDataTV
Uploaded August 2026 | Updated December 2026, 4 days ago
🔊 Recorded at PyCon DE & PyData 2026, 15.04.2026
2026.pycon.de/talks/RNT9FV

🎓 Watch Tomas Ruiz reveal how to identify and eliminate hidden CPU-GPU synchronizations in PyTorch to unlock maximum hardware performance and throughput.

Speakers:
Tomas Ruiz

Description:
PyTorch executes GPU operations asynchronously, allowing the CPU to schedule tasks and run ahead of the GPU. Performance degradation occurs during CPU-GPU synchronization, which happens when the CPU must block and wait for data to return from the GPU to make a decision or allocate memory. This creates "bubbles" of inactivity on both the CPU and GPU, reducing overall hardware utilization.

Common triggers for synchronization include calling .item(), .cpu(), or printing tensors, as well as using GPU tensors within conditional if-else branching. More subtle synchronizations arise from operations that result in dynamic shapes, where the output size depends on the tensor data. Examples include boolean indexing, slicing with a GPU-resident integer, torch.non_zero(), and torch.unique(). Because the CPU manages memory allocation, it must synchronize to determine the output shape before the GPU can proceed.

To mitigate these issues, developers can reduce the frequency of synchronization—such as printing loss every 100 iterations instead of every one—or use padding to maintain static shapes. Some PyTorch APIs, such as torch.repeat_interleave(), provide optional parameters to specify the output size, bypassing the need for synchronization.

Profiling tools like NVIDIA Nsight Systems can visualize these delays as CUDA stream synchronize calls. For automated detection, PyTorch offers an experimental debug mode via torch.cuda.set_synchronize_debug_mode(), which can be set to warning or error. This allows for the creation of unit tests using decorators that fail if a function triggers a GPU synchronization, ensuring production code remains efficient.

⭐️ About PyCon DE:
PyCon DE is the leading conference on open-source Python applications in AI and data science. It brings together industry professionals, researchers, AI and data science practitioners, and software engineering communities, providing a unique platform for collaboration, knowledge sharing, and innovation.

The PyCon DE & PyData 2026 conference delivered an exceptional experience, fostering stronger connections within the Python community while showcasing the latest advancements in artificial intelligence and data science. Attendees enjoyed a diverse and engaging program of talks, workshops, and networking opportunities, further establishing the conference as a premier event for Python, AI, and data science enthusiasts across Germany.

PyCon DE 2027 will take place in Heidelberg from 19 to 23 April 2027.

Follow us:
• Newsletter: 2027.pycon.de/newsletter
• LinkedIn: linkedin.com/company/pyconde
• X: x.com/pyconde

Links:
• Conference website: pycon.de
• Other sessions: 2026.pycon.de/talks

The conference was organized by
• Python Softwareverband e.V.: pysv.org
• Pioneers Hub gemeinnützige GmbH: pioneershub.org
in collaboration with NumFOCUS Inc.: numfocus.org


If you enjoyed this session, please like, and subscribe to our channel for more insightful talks and discussions.
Share this video with your network to spread the knowledge!

Hashtags:
#Python #PyConDE #PyData #OpenSource #AI #DataScience #MachineLearning #SoftwareEngineering #LLMs #Community #Sovereignty

Acknowledgements:
Special thanks to all the volunteers and sponsors who made this event possible.

About:
Python Softwareverband e.V.:
PySV is a non-profit that promotes the use and development of Python in Germany through events, education, and advocacy, fostering an open Python community.

Pioneers Hub gemeinnĂźtzige GmbH:
is a non-profit fostering innovation in AI and tech by connecting experts and promoting knowledge exchange through events and collaborative initiatives.

NumFOCUS Inc.
supports open-source scientific computing by providing financial and logistical support to key projects like NumPy and Jupyter, promoting sustainable development and collaboration.


pydata.org

PyData is an educational program of NumFOCUS, a 501(c)3 non-profit organization in the United States. PyData provides a forum for the international community of users and developers of data analysis tools to share ideas and learn from each other. The global PyData network promotes discussion of best practices, new approaches, and emerging technologies for data management, processing, analytics, and visualization. PyData communities approach data science using many languages, including (but not limited to) Python, Julia, and R.
PyTorch and CPU-GPU Synchronizations [PyCon DE & PyData 2026]Airflow for Geospatial Pipelines | Kevin LaiBuilding an AI Delivery Robot in PythonLin Jia & Kexin Fei - The A_B Testing Blind Spot_ Solving the Opt-In Paradox with Causal InferenceKumar, Mustafina, & Vriends Systems for Scale: Architecting a Nationwide Energy Forecasting PlatformEverything That Happens to Data Before Model Input During Training3er PyData Santander - VisualizaciĂłn Computacional para la ObservaciĂłn del Territorio en CantabriaClementi, McCarty - GPU-Accelerated Data Science for PyData Users | PyData Vermont 2025The AI Security Paradox: Asymmetric Threats and the Future of Defense - Ammar AlimWhat comes next? (And what were not prepared for) | Rashad Hassanein - Give Me 5 Season 3/Episode 7Rediscovering single-node processing: When does it make sense to move from Spark to Polars?Laura Summers & Andy Kitchen - Mothering the Machine
PyData |

PyTorch and CPU-GPU Synchronizations [PyCon DE & PyData 2026]

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER