NVIDIA L4 vs NVIDIA L40, AI & Machine Learning Comparison

NVIDIA L4
NVIDIA L4
vs
NVIDIA L40
NVIDIA L40

NVIDIA L40 wins 10 of 11 benchmarks, averaging 150.6% faster.

NVIDIA L40's numbers are anchored estimates calibrated against our measured cards, pending first-party measurement. Treat small gaps as ties.

What the numbers say

The gap is widest in Qwen3-32B, where NVIDIA L40 leads by 174% (12.42 vs 34.08 tok/s); the closest fight is Stable Diffusion XL (116% apart); VRAM decides part of this one: NVIDIA L40 runs 138 of our 12 AI workloads while the other card runs 11, models that don't fit score zero.

Benchmark results head-to-head

BenchmarkNVIDIA L4NVIDIA L40Difference
Qwen3-4B tok/s84211.33-60%
Llama 3.1 8B tok/s50.45135.12-63%
Qwen2.5-Coder 14B tok/s27.4674.27-63%
Qwen3-32B tok/s12.4234.08-64%
Llama 3.3 70B tok/s00n/a
Stable Diffusion XL images/min5.1811.2-54%
Z-Image Turbo images/min2.4755.625-56%
FLUX.1 dev images/min02.464n/a
FLUX.1 Kontext dev images/min01.114n/a
Qwen-Image-Edit images/min00.48n/a
Wan 2.2 5B (720p) frames/s0.150.37-59%

Whole-job comparison

How long each card takes to finish a complete pipeline, not just one model. NVIDIA L4 is faster on 0 of 3; NVIDIA L40 on 3.

WorkflowNVIDIA L4NVIDIA L40DifferenceCost per run
24-frame storyboard12.2 min7 minNVIDIA L40 1.74x faster$0.089 vs $0.080
Full codebase review36.4 min13.5 minNVIDIA L40 2.70x faster$0.267 vs $0.155
10 short social clips60.3 min28.2 minNVIDIA L40 2.14x faster$0.442 vs $0.324

Renting by the hour, NVIDIA L40 finishes 3 of 3 cheaper. The quicker card is not automatically the cheaper way to get the work done.

Cost to rent

CardPer hour
NVIDIA L4$0.440
NVIDIA L40$0.690

NVIDIA L4 is 1.57x cheaper per hour. Cheapest on-demand rate we see across RunPod and Vast.

Specifications compared

NVIDIA L4NVIDIA L40
VRAM24GB48GB
ArchitectureAda LovelaceAda Lovelace
Memory bandwidth300 GB/s864 GB/s
Boost clock2,040 MHz2,490 MHz
TDP72 W300 W
Launch MSRP$2,500$7,000
Release2023-03-212022-10-13

FAQ

Which is better for ai & machine learning: NVIDIA L4 or NVIDIA L40?
NVIDIA L40 performs better for ai & machine learning, winning 10 of 11 benchmarks in our suite with an average 150.6% advantage.
What are the main hardware differences between NVIDIA L4 and NVIDIA L40?
NVIDIA L4 has 24GB VRAM and a 72W TDP, while NVIDIA L40 has 48GB VRAM and a 300W TDP.
Does VRAM matter more than speed between NVIDIA L4 and NVIDIA L40?
For AI, yes, NVIDIA L40 fits 24 more of our 12 workloads than NVIDIA L4. A model that exceeds VRAM doesn't run slower, it doesn't run at all, so the card that fits the model wins that workload outright.
Where is the biggest performance difference between NVIDIA L4 and NVIDIA L40?
Qwen3-32B: NVIDIA L40 leads by roughly 174% (12.42 vs 34.08 tok/s) in our testing.

NVIDIA L4 full review · NVIDIA L40 full review · All AI & Machine Learning rankings