← Blog
October 3, 2025

Una guía sencilla para el servicio de LLM con varias GPU

La mayoría de las aplicaciones pueden permanecer en una GPU más tiempo del que piensas. Cambie a varias GPU cuando los objetivos de memoria o rendimiento lo exijan, o cuando el tamaño del modelo supere la memoria de la GPU disponible. El paralelismo aumenta los costos de comunicación y genera nuevos modos de fallo: planifíquelo, pruébelo y mantenga sus límites ajustados.

Prueba Compute hoy mismo: Lanza un VLLM servidor de inferencia en Calcular con 2×, 4× o 8× Ajustes preestablecidos de GPU. Elige Francia o los Emiratos Árabes Unidos, haz streaming de forma predeterminada y ten en cuenta los límites máximos y contextuales mientras pruebas las formas por lotes.

Cuando la multiGPU realmente vale la pena

  • El modelo no se ajusta. Incluso con int8, el tamaño del modelo (pesos + caché KV) puede superar la VRAM de una sola tarjeta.
  • El contexto es largo. La alta concurrencia y las solicitudas/salidas largas (mayor longitud de la secuencia) hacen que la caché supere el margen de seguridad.
  • Límite de rendimiento. Necesitas más tokens/segundo en el mismo objetivo de latencia de los que puede entregar una tarjeta.

Ajustar el tamaño global del lote es importante para optimizar el rendimiento y la utilización de la GPU en configuraciones con varias GPU.

Si tu problema se debe principalmente a las colas o a los límites sobredimensionados, arréglalos primero. La multiGPU no salvará a un programador incorrecto.

first. It is simpler, isolates failures, and scales well for many workloads.

Why did latency get worse after going multi‑GPU?

Likely communication overhead or a batch shape that triggers cache pressure. Check interconnect bandwidth, trim caps, and re‑measure.

Can multi‑GPU help with long context?

Yes, by spreading memory across cards. But also consider RAG and quantization before adding complexity.

How do I know it’s time to upgrade?

When TTFT p95 rises and TPS flattens at steady traffic despite clean caps and healthy memory headroom on one GPU.

What is the role of the embedding layer in pipeline parallelism?

The embedding layer maps input vocabulary to hidden states. In pipeline parallelism, the embedding layer is often placed at the start of the pipeline and may be tied or shared across model stages to ensure consistency and efficiency.

How are transformer blocks and transformer layers distributed across GPUs?

Transformer blocks and transformer layers are split across GPUs in pipeline and tensor parallelism. Each GPU processes a subset of these layers, allowing the model to scale efficiently and handle larger architectures.

How are expert layers distributed in Mixture of Experts (MoE) models?

Expert layers in MoE architectures are distributed across multiple GPUs. This distribution enables parallel computation of different experts, improving scalability and computational efficiency during training and inference.

What are the challenges of training LLM with large activation memory?

Training LLM (large language models) requires managing significant activation memory. Specialized frameworks like NeMo help distribute activation data and optimize memory use, which is critical for efficient multi-GPU training.

How do the sequence and sequence dimension affect parallelism strategies?

Parallelism strategies like sequence parallelism partition and distribute activation data along the sequence dimension. This allows efficient handling of long input sequences and better utilization of GPU memory and compute resources.

What does linear propagation of data through pipeline stages mean?

Linear propagation means data moves sequentially through each pipeline stage, with each stage inferring shapes and processing outputs in order, without skip connections or complex routing.

How is pipeline parallelism implemented in popular frameworks?

Pipeline parallelism is implemented in frameworks like Megatron-LM and DeepSpeed by integrating with Data Parallelism (DP), Tensor Parallelism (TP), ZeRO, and various pipeline schedules. These frameworks provide practical configurations and codebases for deploying pipeline parallelism effectively.