
NVIDIA Dynamo is an open-source inference framework for deploying large-scale generative AI models across multi-node, multi-GPU environments. Disaggregated serving architecture separates prompt processing (prefill) and token generation (decode) phases across different GPU workers, enabling independent scaling and optimization of each phase based on their distinct computational characteristics.
This guide covers building disaggregated inference deployments with NVIDIA Dynamo using AIConfigurator for optimal configuration discovery, deploying on Kubernetes with RDMA, and validating performance. Disaggregated architecture can achieve up to 1.7x throughput improvement over aggregated serving for large models (32B+) with long input contexts. For smaller models, AIConfigurator automatically determines when aggregated serving is more efficient.
Before you begin, ensure you have one of the following environments:
For Kubernetes Deployment:
kubectl configured to access your cluster.For Standalone Instance Deployment:
Common Requirements:
Disaggregated serving splits LLM inference into two specialized phases, each optimized for different computational characteristics:
Prefill Workers:
Decode Workers:
Request Routing:
Use Disaggregated Serving When:
Use Aggregated Serving When:
Performance Benefits (for Large Models):
RDMA is Required: Disaggregated serving requires RDMA for KV cache transfer. Without RDMA, performance degrades by 40x (TTFT increases from ~400ms to 10+ seconds) as the system falls back to TCP transfer, creating a severe bottleneck.
AIConfigurator is a performance optimization tool that automatically determines the optimal configuration for deploying LLMs with Dynamo by evaluating both aggregated and disaggregated architectures.
Create a Python 3 virtual environment.
Activate the virtual environment.
Install AIConfigurator using pip.
Verify the installation.
The output displays the installed version.
View available parameters and help documentation.
AIConfigurator requires the following key parameters:
How AIConfigurator Works:
AIConfigurator considers factors like model size, KV cache transfer overhead, and GPU utilization to determine whether disaggregated serving will outperform aggregated for your specific workload.
Use AIConfigurator to discover the best configuration for your model and hardware.
Run AIConfigurator with your model and system specifications.
The command evaluates all possible configurations for 4× H200 GPUs with the specified model and SLA targets, generating deployment manifests in the ./results_vllm directory.
Review the AIConfigurator output summary.
The summary shows that for this 4B model, aggregated serving performs better than disaggregated (3785.20 vs 3067.51 tokens/s/gpu). This is expected for smaller models where the overhead of KV cache transfer outweighs the benefits of phase separation. Disaggregated serving becomes advantageous with larger models (32B+) and longer context lengths.
Review the detailed configuration comparison.
Understanding the Output:
256 (=64x4) = batch size 64 × 4 replicas)Model Size Matters: Disaggregated serving becomes advantageous with larger models (32B+) where the benefits of phase-specific optimization outweigh KV cache transfer overhead. For smaller models like this 4B example, aggregated serving is more efficient.
Examine the generated directory structure.
The results are organized by model name and experiment parameters. While aggregated serving is optimal for this 4B model, the following sections demonstrate disaggregated deployment for learning purposes and larger model scenarios.
While AIConfigurator determined that aggregated serving is optimal for this 4B model, the following sections demonstrate disaggregated deployment for learning purposes. Use disaggregated architecture when deploying larger models (32B+) or when AIConfigurator recommends it for your specific workload.
Kubernetes deployment provides the infrastructure for disaggregated serving with RDMA-accelerated KV cache transfer.
Before deploying disaggregated workloads, install the NVIDIA Dynamo platform on your Kubernetes cluster. Follow the How to Optimize GPU Resource Planning with NVIDIA Dynamo guide to:
Set your Kubernetes namespace as an environment variable.
Replace YOUR_NAMESPACE with the namespace where you want to deploy Dynamo workloads.
Create the namespace.
Export your Hugging Face token.
Replace YOUR_HF_TOKEN with your Hugging Face access token.
Create a Hugging Face token secret for accessing gated models.
Create a persistent volume claim for caching model weights.
This PVC uses ReadWriteMany (RWX) access mode, which allows multiple pods to mount the volume simultaneously for shared model caching. Ensure your cluster has a StorageClass that supports RWX access mode (such as NFS, CephFS, or cloud-provider RWX storage). Verify available StorageClasses:
Apply the PVC configuration.
Verify the RDMA device plugin is running.
The output should show RDMA device plugin pods running on GPU nodes. If not installed, follow the Mellanox RDMA device plugin installation guide.
Verify RDMA resources are available on your nodes.
Replace NODE-NAME with your GPU node name. The output should show rdma/hca_shared_devices resources:
The rdma/hca_shared_devices: "1k" entry confirms RDMA resources are available. If this resource is missing, verify the RDMA device plugin DaemonSet configuration and node labels.
Review the generated disaggregated deployment manifest.
The file contains a DynamoGraphDeployment custom resource with frontend, prefill workers, and decode workers configured according to AIConfigurator's recommendations.
Create the complete deployment manifest with RDMA configuration.
Critical RDMA Configuration:
rdma/hca_shared_devices resources: Request RDMA resources matching tensor parallelism size (1 for both prefill and decode with TP1)IPC_LOCK capability: Required for RDMA memory registrationPOD_UID environment variable: Retrieves pod UID from metadata for worker identificationUCX_TLS environment variable: Enables RDMA transports (rc_x, dc_x for InfiniBand)UCX_RNDV_SCHEME=get_zcopy: Enables zero-copy RDMA transfers for maximum performanceUCX_RNDV_THRESH=0: Forces RDMA usage for all message sizes--trust-remote-code flag: Allows execution of custom model code from Hugging Facenvcr.io/nvidia/ai-dynamo/vllm-runtime:0.9.0-cuda13 for GPU compatibilityDeploy the configuration to Kubernetes.
Monitor the deployment progress.
Wait for all pods to reach Running status. This may take several minutes as models are downloaded and loaded.
Check pod status and resource allocation.
The output shows all pods running successfully:
Verify RDMA is active by checking worker logs.
Replace PREFILL-WORKER-POD with your prefill worker pod name from the previous step. The output shows NIXL initialization logs:
The key indicators confirm RDMA is working:
Test inference through the frontend service.
In a separate terminal, send a test request:
The output displays the model's response in JSON format.
Monitor worker metrics to verify disaggregated flow.
The output displays the metrics showing successful request processing:
For standalone instance deployments (non-Kubernetes), refer to the backend-specific deployment guides that cover disaggregated serving:
These guides provide:
After deployment, validate AIConfigurator's predictions against actual performance using AIPerf.
Install AIPerf benchmarking tool.
Derive AIPerf parameters from AIConfigurator output.
Values used for testing:
--concurrency 30 (AIConfigurator recommends 208 for max throughput)--num-requests 800 (Recommended: 8320 = concurrency × 40 for statistical stability)--isl 4000 --osl 500 (Match your AIConfigurator inputs)--extra-inputs "ignore_eos:true" (Ensures exact OSL tokens generated)Run AIPerf benchmark against the deployment.
The command above uses --concurrency 30 and --num-requests 800 for early success and faster testing. For best throughput validation, use the recommended values: --concurrency 208 and --num-requests 8320 (concurrency × 40 for statistical stability).
The benchmark runs 800 requests with 30 concurrent connections. The output displays performance metrics:
Compare actual vs predicted performance.
The per-GPU throughput (6,232.31 ÷ 2 GPUs = 3,116 tokens/s/gpu) closely matches AIConfigurator's prediction of 3,067.51 tokens/s/gpu. The total throughput (6,232.31 tokens/s) actually exceeds the prediction for 2 GPUs (6,135.02 tokens/s). This benchmark was run with 2 GPUs (1 prefill + 1 decode worker); scaling to 4 GPUs (2 prefill + 2 decode workers as shown in the deployment manifest) would double the throughput to approximately 12,464 tokens/s. The lower throughput compared to maximum capacity is due to using concurrency 30 instead of the recommended 208. The Inter Token Latency (3.75ms) significantly outperforms predictions, demonstrating efficient token generation.
Run benchmarks inside the Kubernetes cluster (using a Job pod) to eliminate network latency. External benchmarking adds latency that affects TTFT measurements but provides realistic end-to-end performance metrics.
Understanding the request flow helps troubleshoot issues and optimize configuration.
Request Routing to Prefill Worker
KV Cache Generation (Prefill Phase)
NIXL-Based KV Cache Transfer
rc_x or dc_x transport) for GPU-to-GPU transfer.kv_transfer_params with block IDs and GPU memory addresses.bootstrap_info with KV cache layout and tensor locations.opaque_state with serialized KV cache metadata.Decode Worker Receiving KV Cache
Token Generation on Decode Worker
Performance Characteristics:
Prefill Workers:
Decode Workers:
Example Configuration (4 GPUs):
Different TP settings for prefill and decode workers enable independent optimization.
Example: 4× H200 GPUs, 4B model
Prefill Workers:
Decode Workers:
Network Requirements:
Configuration Requirements:
rdma/hca_shared_devices resources requested matching tensor parallelism size.IPC_LOCK capability for memory registration.Verification:
rdma resource show.ib_write_bw or rdma_bw tools.Disaggregated serving provides the greatest benefit in these scenarios:
Large Model Deployments (32B+ parameters):
Long Context Workloads (ISL > 4000):
High Throughput Requirements:
Production Deployments with Variable Load:
When Aggregated Is Better:
You have successfully used AIConfigurator to discover optimal configurations and deploy disaggregated inference with NVIDIA Dynamo. For this 4B model, aggregated serving performed 23% better, while larger models (32B+) benefit from disaggregated architecture with up to 1.7x throughput improvement. Disaggregated serving requires RDMA infrastructure for efficient KV cache transfer but enables superior per-GPU efficiency and independent scaling. Always follow AIConfigurator's recommendations and validate with AIPerf benchmarking for production deployments. For advanced configurations, refer to the official NVIDIA Dynamo documentation.
0 Comments
Be the first to comment and share your perspective with the community.