0Pricing
CUDA Academy · Lección

Varias GPU con NCCL

Comunicación colectiva para escalar

Varias GPU con NCCL es una lección gratuita de CUDA Academy en CoddyKit. Esta es la lección 4 de 4. Puedes leer la lección completa abajo gratuitamente — luego la practicas en el navegador con un editor de código integrado y un tutor de IA 24/7. Forma parte de la ruta de aprendizaje de CUDA Academy, y tu progreso se sincroniza en la web y la app de CoddyKit. El curso de CUDA Academy incluye 4 lecciones en total.

Partes de esta lección aún no han sido traducidas y se muestran en inglés.

Hand-Rolled Gets Hard

Wiring peer copies by hand across many GPUs becomes messy fast. For real scaling you want a library built for collective communication.

Meet NCCL

NVIDIA's answer is NCCL, the collective communications library. It moves data among GPUs using the fastest links it can find, automatically.

What a Collective Is

A collective is one operation that every GPU joins together, like summing a value held on each card. All devices cooperate in a single call.

The Star Collective: AllReduce

The workhorse is AllReduce. It combines a buffer from every GPU, say by adding, and hands the same result back to all of them.

ncclAllReduce(send, recv, n, ncclFloat, ncclSum, comm, stream);

More Collectives

NCCL also offers Broadcast to share one GPU's data with all, plus AllGather and ReduceScatter for other common exchange patterns.

The Communicator

The GPUs that talk together form a group tracked by a communicator. Every collective call passes this handle so NCCL knows the participants.

Ranks Identify GPUs

Inside a communicator each GPU gets a number called its rank, from 0 up. Ranks let you say who sends, who receives, and who is the root.

Building the Communicators

For GPUs in one process, ncclCommInitAll sets up every communicator at once from the list of device ids you provide.

ncclCommInitAll(comms, nGpus, devs);

Stream Aware

Every NCCL call takes a stream. Operations queue there and run alongside your kernels, so communication overlaps computation.

Grouping Calls

To issue collectives on many GPUs without deadlock, wrap them between ncclGroupStart and ncclGroupEnd so NCCL launches them together.

ncclGroupStart();
// per-GPU calls
ncclGroupEnd();

Why Training Loves It

Deep learning syncs gradients across GPUs every step. AllReduce is exactly that, which is why NCCL powers nearly all multi-GPU training.

Quick Check

Recall the NCCL collective that sums a buffer across GPUs and returns the result to all of them.

Recap

NCCL runs collectives like AllReduce over fast links, organized by a communicator of ranked GPUs. It is the backbone of multi-GPU training. Course complete. ✨

Preguntas frecuentes

¿La lección «Varias GPU con NCCL» es gratis?

Sí — el texto completo de «Varias GPU con NCCL» es gratis para leer aquí en la web. Para practicarla de forma interactiva (editor de código integrado y tutor de IA 24/7) y desbloquear el resto del curso de CUDA Academy, actualiza a CoddyKit PRO. El curso de CUDA Academy incluye 4 lecciones en total.

¿Qué aprenderé en «Varias GPU con NCCL»?

Comunicación colectiva para escalar Practicas CUDA Academy con código real que ejecutas directamente en el navegador, y un tutor de IA 24/7 responde tus preguntas mientras trabajas en la lección.

¿Necesito experiencia previa para empezar CUDA Academy?

No se requiere experiencia previa. CUDA Academy en CoddyKit está estructurado para principiantes hasta estudiantes avanzados, así que puedes empezar aquí o desde el inicio y avanzar a tu ritmo. Esta es la lección 4 de 4.

¿Cuánto tiempo toma la lección «Varias GPU con NCCL»?

La mayoría de las lecciones de CoddyKit toman alrededor de 5–10 minutos. Cada una es compacta e interactiva, así que avanzas constantemente y retomas exactamente por donde dejaste en la web y la app.

¿Puedo escribir y ejecutar código en esta lección de CUDA Academy?

Sí. Cada lección de CUDA Academy incluye un editor de código integrado, así que escribes y ejecutas código real directamente en tu navegador y obtienes retroalimentación instantánea de IA — sin configuración local necesaria.

Todas las lecciones de este curso

  1. Enumeración y selección de dispositivos
  2. Partición del trabajo entre GPU
  3. Acceso entre pares a la memoria
  4. Varias GPU con NCCL
← Volver a CUDA Academy