🔎 From low-level kernels to real-world applications in scientific computing and machine learning
✍️ Niels Cautaerts, Hossein Ghorbanfekr

#GPU
#Python
#CUDA
#NVIDIA
#CuPy
#JAX
#RAPIDS
🚀 شتابدهی کدهای پایتون با پردازنده گرافیکی و CUDA
🐘 راهنمای جامع برنامهنویسی و بهینهسازی پردازندههای گرافیکی برای توسعهدهندگان پایتون
📚 این کتاب بهت نشون میده که چطور بدون نیاز به تغییر زبان به C++، کدهای پایتون خودت رو با استفاده از پلتفرم CUDA انویدیا و ابزارهای مدرن شتابدهی کنی و برنامههایی سریعتر و مقیاسپذیرتر بسازی.
✨ ویژگیهای کلیدی
🛠️ پایههای محکم برنامهنویسی CUDA با پایتون رو از طراحی کرنل گرفته تا اجرا و دیباگ کردن یاد میگیری.
⚙️ کارایی GPU رو با دسترسی به حافظه بهینه، جریانهای CUDA و مقیاسپذیری چند پردازندهای به اوج میرسونی.
🔄 با استفاده از JAX، CuPy، RAPIDS و Numba محاسبات عددی و یادگیری ماشین رو به شکل چشمگیری سرعت میدی.
🧩 برنامههای کاربردی GPU از جمله حلکنندههای PDE، پردازش تصویر و مدلهای ترنسفورمر رو به صورت عملی پیادهسازی میکنی.
📘 توضیح کتاب
🧠 نوشتن کدهای با کارایی بالا در پایتون نیازی به تعویض زبان نداره و این کتاب بهت نشون میده چطور از پلتفرم CUDA انویدیا و اکوسیستم مدرن ابزارهای پایتون به بهترین شکل استفاده کنی.
📊 مسیر آموزشی با مبانی برنامهنویسی CUDA در پایتون با کمک Numba-CUDA شروع میشه تا یاد بگیری چطور سختافزار GPU کار میکنه و چطور میشه کرنلهای سفارشی نوشت و اجرا کرد.
🧩 در ادامه کتاب به سراغ بهینهسازی دسترسی به حافظه، اجرای ناهمگام با جریانهای CUDA و مقیاسپذیری چند پردازندهای با Dask-CUDA میره تا تسلط کاملی روی سختافزار پیدا کنی.
📌 تحلیل و تنظیم کارایی با استفاده از پروفایلرهای NVIDIA Nsight در تمام طول کتاب مورد تاکید قرار گرفته تا بتونی گلوگاههای کد خودت رو شناسایی و رفع کنی.
🌐 کتاب همچنین استفاده از کتابخانههای سطح بالا مثل JAX، CuPy و RAPIDS رو برای شتابدهی کارهای علمی با حداقل تغییر در کدها آموزش میده.
🎯 چیزهایی که یاد میگیری
🚀 با نحوه اجرای موازی روی GPU و مدل برنامهنویسی CUDA آشنا میشی.
🛠️ میتونی کرنلهای سفارشی CUDA رو با پایتون بنویسی، اجرا و دیباگ کنی.
⚙️ کدها رو با ابزار NVIDIA Nsight پروفایل میکنی و دسترسی به حافظه رو بهبود میدی.
🔄 با استفاده از CUDA استریمها، محاسبات و انتقال دادهها رو همپوشانی میکنی.
📊 کتابخانههای JAX، CuPy و RAPIDS رو در محاسبات عددی و یادگیری ماشین به کار میگیری.
🧩 بارهای کاری GPU رو با استفاده از Dask بین چند پردازنده مقیاسبندی میکنی.
📌 حلکنندههای PDE، شبیهسازیها و پردازش تصویر رو روی GPU شتابدهی میکنی.
🌐 یک مدل زبانی مبتنی بر ترنسفورمر رو از صفر تا صد روی GPU میسازی و آموزش میدی.
👤 این کتاب برای چه کسانیه؟
💼 این کتاب برای توسعهدهندگان پایتون، دانشمندان داده، مهندسان و پژوهشگرانی مناسبه که میخوان محاسبات عددی خودشون رو بدون مهاجرت به زبانهای سطح پایین شتابدهی کنن.
🌐 مباحث کتاب برای کسانی طراحی شده که با پایتون علمی مثل NumPy، Pandas و SciPy آشنایی دارن و میخوان کنترل عمیقتری روی کارایی برنامهها در محیطهای GPU به دست بیارن.
📖 فهرست مطالب
👤 درباره نویسندگان
👨💻 Hossein Ghorbanfekr یک فیزیکدان محاسباتی با بیش از یک دهه تجربه در زمینه برنامهنویسی علمی برای مدلسازی مواد است که تخصص ویژهای در C/C++ و پایتون دارد. او در دوران دکتری خود کدهای مختلفی با استفاده از پردازش موازی و شتابدهی GPU نوشته است و از سال ۲۰۲۰ به عنوان دانشمند داده روی یادگیری ماشین و محاسبات با کارایی بالا در پروژههای پژوهشی فعالیت میکنه.
📚 Dr. Niels Cautaerts دارای ۱۰ سال تجربه در زمینه برنامهنویسی پایتون برای کاربردهای علمی است و دکترای خود را در رشته فیزیک کاربردی دریافت کرده است. او از سالها پیش به نوشتن کرنلهای CUDA برای پروژههای متنباز مشغول بوده و به عنوان توسعهدهنده نرمافزار پژوهشی و دانشمند داده فعالیت میکنه.
Accelerate your Python code on the GPU using CUDA, Numba, and modern libraries to solve real-world problems faster and more efficiently.
Writing high-performance Python code doesn’t have to mean switching to C++. This book shows you how to accelerate Python applications using NVIDIA’s CUDA platform and a modern ecosystem of Python tools and libraries. Aimed at researchers, engineers, and data scientists, it offers a practical yet deep understanding of GPU programming and how to fully exploit modern GPU hardware.
You’ll begin with the fundamentals of CUDA programming in Python using Numba-CUDA, learning how GPUs work and how to write, execute, and debug custom GPU kernels. Building on this foundation, the book explores memory access optimization, asynchronous execution with CUDA streams, and multi-GPU scaling using Dask-CUDA. Performance analysis and tuning are emphasized throughout, using NVIDIA Nsight profilers.
You’ll also learn to use high-level GPU libraries such as JAX, CuPy, and RAPIDS to accelerate numerical Python workflows with minimal code changes. These techniques are applied to real-world examples, including PDE solvers, image processing, physical simulations, and transformer models.
Written by experienced GPU practitioners, this hands-on guide emphasizes reproducible workflows using Python 3.10+, CUDA 12.3+, and tools like the Pixi package manager. By the end, you’ll have future-ready skills for building scalable GPU applications in Python.
Python developers, (data) scientists, engineers, and researchers looking to accelerate numerical computations without switching to low-level languages. This book is ideal for those with experience in scientific Python (NumPy, Pandas, SciPy) and a basic understanding of computing fundamentals who want deeper control over performance in GPU environments.
Hossein Ghorbanfekr is a computational physicist with over a decade of expertise in scientific programming for material modeling, specializing in C/C++ and Python. During his Ph.D., he wrote various codes, utilizing parallel computing and GPU acceleration. Since 2020, he has been working as a data scientist, focusing on machine learning and high-performance computing in research projects. Hossein has contributed to the development of an object detection framework for waste stream analysis and created GEOBERTje, a domain-specific large language model in geology. His recent work includes Pantea, an open-source, GPU-accelerated machine learning framework for molecular simulations.
Dr. Niels Cautaerts has 10 years of experience writing Python for scientific applications. Five years ago he became interested to leverage hardware acceleration in his code. Soon after, he began contributing CUDA kernels to open source projects in his field of research. He has since applied his expertise to build GPU accelerated code in various projects, including a low latency framework for object detection in continuous image streams. Niels maintains a small following on YouTube and Medium, where he shares educational content about tech. Currently Niels works as a research software developer and data scientist. He has also worked as a big-data engineer. Niels has a background in materials science and holds a Ph.D. in applied Physics.









