0
نام کتاب
CUDA for LLMs

Building fast transformer kernels

Elliot Arledge

Print Length406 Pages
PublisherManning
Edition1
LanguageEnglish
Year2026
ISBN9781633434899
984
A7406
انتخاب نوع چاپ:
جلد سخت
1,405,000ت
0
جلد نرم
1,255,000ت
0
طلق پاپکو و فنر
1,265,000ت
0
مجموع:
0تومان
کیفیت متن:اورجینال انتشارات
قطع:B5
رنگ صفحات:دارای متن و کادر رنگی
پشتیبانی در روزهای تعطیل!
ارسال به سراسر کشور

#LLM

#CUDA

#GPU

#NVIDIA

#AI

توضیحات

⚡ برنامه‌نویسی CUDA؛ از اولین Kernel تا Flash Attention


💭 «یک راهنمای پایه‌ای برای CUDA، معماری مدرن GPU و کاربردهای آن‌ها در حوزه هوش مصنوعی.»

— برایس ادلستین لِلباخ، NVIDIA


🚀 فرق بین مدلی که استنتاج را در چند میلی‌ثانیه به‌جای چند ثانیه انجام میده یا در چند روز به‌جای چند هفته آموزش می‌بینه، به نحوه استفاده از سخت‌افزار برمیگرده. برای بیرون کشیدن تمام توان پردازشی GPUهای NVIDIA باید Kernelهای اختصاصی CUDA نوشته بشن و این کتاب دقیقا همین مهارت را آموزش میده.

الیوت آرلج در ۴۰۸ صفحه مصور و پر از کد، برنامه‌نویسی مدرن GPU را از اولین Kernel شروع میکنه و تا Flash Attention، هسته‌های Tensor و آموزش توزیع‌شده روی چند GPU پیش میبره. مطالب براساس جدیدترین سخت‌افزارهای NVIDIA نوشته شدن، اما اصولی را آموزش میدن که با عوض شدن نسل GPUها همچنان کاربردی باقی میمونن.


🧩 چون برنامه‌نویسی GPU پیچیده است، کتاب مهارت‌ها را لایه‌به‌لایه و با یک ساختار شش‌مرحله‌ای برای بهینه‌سازی Kernel جلو میبره. کار با نوشتن یک Kernel برای جمع برداری شروع میشه تا مشخص بشه Grid، Block و Thread چطور روی سخت‌افزار واقعی اجرا میشن.

بعد نوبت پیاده‌سازی نسخه‌های ابتدایی Kernelهایی میرسه که تقریبا همه مدل‌های Deep Learning به آن‌ها وابسته هستن؛ از GEMM و Softmax گرفته تا کانولوشن یک‌بعدی و دوبعدی، Max Pooling و ترانهاده ماتریس. در ادامه یک شبکه عصبی کامل در شش نسخه ساخته و آموزش داده میشه که هر نسخه از قبلی سریع‌تره. Backpropagation از پایه استخراج و کدنویسی میشه و کار با cuBLAS به‌صورت عملی پیش میره.


🛠️ تمرکز اصلی کتاب روی بهینه‌سازی واقعی است. یک Transformer برای اجرای Inference به CUDA منتقل میشه و Kernelهای آن یکی‌یکی بهینه میشن. رمزگشای GEMV با Coalesced Access، کاهش در سطح Block و Vectorization سریع‌تر میشه. Softmax به نسخه‌های Online، مبتنی بر Warp Shuffle و Fused ارتقا پیدا میکنه. GEMM هم با Thread Remapping، کاشی‌بندی Shared Memory، Block Tiling یک‌بعدی و دوبعدی و بارگذاری برداری بهبود داده میشه.

تمام بهینه‌سازی‌ها Profile میشن و نتیجه هر Profile توضیح داده میشه تا مشخص باشه هر تغییر دقیقا چه اثری روی عملکرد GPU میذاره.


🔥 فصل‌های پایانی سراغ فناوری‌های پیشرفته‌تر میرن. برنامه‌نویسی هسته‌های Tensor با مجموعه‌دستورهای WMMA و WGMMA برای سخت‌افزار Hopper آموزش داده میشه و مشخص میشه چطور جابه‌جایی داده تحت مدیریت سخت‌افزار می‌تونه جای Tiling دستی را بگیره.

همچنین Flash Attention با Tiling و Online Softmax پیاده‌سازی میشه، مدل‌ها Quantize میشن و مقیاس‌پذیری تا ۱۶ GPU با Tensor Parallelism، Pipeline Parallelism و NCCL بررسی میشه. در پایان، بیش از ۵۰ Kernel قابل اجرا در اختیار خواننده قرار میگیره و دید فنی لازم برای طراحی Kernel روی نسل‌های آینده سخت‌افزار شکل میگیره.


✨ ویژگی‌های کلیدی

• آموزش CUDA و برنامه‌نویسی GPU از پایه

• اجرای Tensor Parallelism و Pipeline Parallelism روی چند GPU

• ساخت افزونه‌های ++PyTorch C برای عرضه Kernelهای اختصاصی


📑 فهرست مطالب

۱. وقتی PyTorch دیگر کافی نیست

۲. اولین برنامه CUDA

۳. Kernelهای ابتدایی

۴. آموزش و اعتبارسنجی شبکه‌های عصبی با CUDA خام

۵. اجرای Inference مدل Transformer در CUDA

۶. بهینه‌سازی Kernelهای Transformer

۷. هسته‌های Tensor

۸. Flash Attention

۹. Quantization

۱۰. محاسبات توزیع‌شده

۱۱. CUTLASS

۱۲. حالا چه کار کنیم؟

ضمیمه A. نصب و راه‌اندازی

ضمیمه B. اجرای نمونه‌کدها

ضمیمه C. عیب‌یابی و روش‌های توسعه

ضمیمه D. مرجع CUDA؛ دستورات، سخت‌افزار، Templateها و Bindingها

ضمیمه E. منابع تکمیلی


👥 مخاطبان کتاب

این کتاب برای مهندسان نرم‌افزار و هوش مصنوعی آشنا با C یا ++C نوشته شده و برای شروع آن نیازی به تجربه قبلی کار با CUDA نیست.


✍️ درباره نویسنده

الیوت آرلج مهندس عملکرد GPU و مدرس برنامه‌نویسی است. تمام Kernelهای کتاب از روند واقعی کار او در نوشتن، Profile کردن و اعتبارسنجی CUDA روی سخت‌افزارهای مصرفی و دیتاسنتری به دست اومدن. او دوره رایگان ۱۲ ساعته CUDA در freeCodeCamp را ساخته و در زمینه بهینه‌سازی عملکرد Deep Learning مشاوره میده.


“A fundamental guide for CUDA and modern GPU architecture and their application in the field of AI.”

—Bryce Adelstein Lelbach, NVIDIA


The difference between a model that infers in milliseconds instead of seconds, or one that trains in days instead of weeks, is in how effectively you use your hardware. To squeeze every last teraflop out of an NVIDIA GPU, you need to write your own CUDA kernels, and this book will get you there! This book is a friendly hands-on tour of the modern GPU programming stack, written for the latest NVIDIA hardware, and grounded in fundamentals that will outlast any single generation of chips. In 408 fully-illustrated, code-rich pages, author Elliot Arledge guides you from your first kernel all the way to Flash Attention, tensor cores, and multi-GPU distributed training.


GPU programming is complicated, so this book builds your skills one layer at a time using a six-level kernel optimization stack. You’ll start by writing a vector addition kernel, learning how grids, blocks, and threads map onto real hardware. From there, you’ll implement the naive versions of the kernels every deep learning model depends on: GEMM, softmax, 1D and 2D convolution, max pooling, and matrix transpose. Then you’ll build and train a full neural network in six progressively faster implementations and dig into cuBLAS, with backpropagation derived and coded from scratch.


Throughout this book, your focus will stay on real optimization work. You’ll port a transformer to CUDA inference and attack each kernel in turn. Your GEMV decoder gets coalesced access, block-level reduction, and vectorization. Softmax becomes online, warp-shuffled, and fused. GEMM progresses through thread remapping, shared memory tiling, 1D and 2D blocktiling, and vectorized loads. Every optimization is profiled, and every profile is explained.


The final chapters take you to the frontier. You’ll program tensor cores using the WMMA and WGMMA instruction sets for Hopper hardware and see how manual tiling gets replaced by hardware-managed data movement. You’ll implement Flash Attention with tiling and online softmax, quantize models, and explore scaling up to 16 GPUs with tensor and pipeline parallelism over NCCL. By the end, you’ll have both a portfolio of more than 50 working kernels and the mental models to write new ones for hardware that doesn’t exist yet.


What's inside

• CUDA and GPU programming from the ground up

• Tensor and pipeline parallelism across multiple GPUs

• PyTorch C++ extensions for shipping custom kernels


Table of Contents

1. When PyTorch Just Isn't Enough

2. Your First CUDA Program

3. Naive Kernels

4. Training and Verifying Neural Nets in Raw CUDA

5. Transformer Inference in CUDA

6. Optimizing Our Transformer Kernels

7. Tensor Cores

8. Flash Attention

9. Quantization

10. Distributed Computing

11. CUTLASS

12. Now What?


Appendix A. Installation and Setup

Appendix B. Running the Code Examples

Appendix C. Troubleshooting and Development Practices

Appendix D. CUDA Reference: Commands, Hardware, Templates, and Bindings

Appendix E. Additional Resources


About the reader

For software and AI engineers comfortable with C/C++. No prior CUDA experience required.


About the author

Elliot Arledge is a GPU performance engineer and educator. Every kernel in this book comes from his workflow of writing, profiling, and verifying CUDA on both consumer and datacenter hardware. He created freeCodeCamp’s 12-hour CUDA course and consults on deep learning performance.

دیدگاه خود را بنویسید
نظرات کاربران (0 دیدگاه)
نظری وجود ندارد.
کتاب های مشابه
LLM
973
Large Language Models
1,780,000 تومان
LLM
1,025
Domain-Specific Small Language Models
1,183,000 تومان
LLM
785
Building Applications with Large Language Models
1,000,000 تومان
LLM
1,298
LLMs in Enterprise
1,916,000 تومان
LLM
573
LLM Design Patterns
1,842,000 تومان
هک و امنیت
890
Jailbreaking LLMs
2,387,000 تومان
LLM
464
A Simple Guide to Retrieval Augmented Generation
895,000 تومان
LLM
1,294
LLM Engineer's Handbook
1,816,000 تومان
LLM
801
Mastering Large Language Models
2,072,000 تومان
LLM
905
LLMs and Generative AI for Healthcare
813,000 تومان
قیمت
منصفانه
ارسال به
سراسر کشور
تضمین
کیفیت
پشتیبانی در
روزهای تعطیل
خرید امن
و آسان
آرشیو بزرگ
کتاب‌های تخصصی
هـر روز با بهتــرین و جــدیــدتـرین
کتاب های روز دنیا با ما همراه باشید
آدرس
پشتیبانی
مدیریت
ساعات پاسخگویی
درباره اسکای بوک
دسترسی های سریع
  • راهنمای خرید
  • راهنمای ارسال
  • سوالات متداول
  • قوانین و مقررات
  • وبلاگ
  • درباره ما