mirror of
https://github.com/hanzoai/papers.git
synced 2026-10-29 07:34:31 +00:00
128 lines
3.7 KiB
TeX
128 lines
3.7 KiB
TeX
\section{Evaluation}
|
|
|
|
\label{sec:evaluation}
|
|
|
|
\subsection{Experimental Setup}
|
|
|
|
We evaluate on three hardware configurations:
|
|
|
|
\begin{itemize}[leftmargin=1.1em]
|
|
\item \textbf{Server GPU}: NVIDIA A100 80GB, AMD EPYC 7763, 512GB RAM.
|
|
\item \textbf{Consumer GPU}: NVIDIA RTX 4090 24GB, Intel i9-14900K, 64GB RAM.
|
|
\item \textbf{Apple Silicon}: Apple M3 Max, 128GB unified memory.
|
|
\end{itemize}
|
|
|
|
Baselines: PyTorch 2.2 (with \texttt{torch.compile}), ONNX Runtime 1.17, llama.cpp (latest), TensorRT-LLM 0.8.
|
|
|
|
\subsection{Language Model Inference}
|
|
|
|
Throughput (tokens/second) for Llama-3-8B, batch size 1, generating 256 tokens:
|
|
|
|
\begin{table}[H]
|
|
\centering
|
|
\small
|
|
\begin{tabular}{lcccc}
|
|
\toprule
|
|
\textbf{Framework} & \textbf{A100} & \textbf{4090} & \textbf{M3 Max} \\
|
|
\midrule
|
|
PyTorch (eager) & 38.2 & 31.4 & --- \\
|
|
PyTorch (compile) & 52.1 & 42.8 & --- \\
|
|
ONNX Runtime & 48.7 & 39.1 & 18.2 \\
|
|
llama.cpp (Q4) & 67.3 & 54.8 & 32.1 \\
|
|
TensorRT-LLM & 71.8 & 58.2 & --- \\
|
|
\textbf{Candle (f16)} & \textbf{64.7} & \textbf{52.3} & \textbf{28.4} \\
|
|
\textbf{Candle (Q4)} & \textbf{72.1} & \textbf{59.4} & \textbf{35.7} \\
|
|
\bottomrule
|
|
\end{tabular}
|
|
\caption{Llama-3-8B inference throughput (tokens/second, batch=1).}
|
|
\label{tab:llm_bench}
|
|
\end{table}
|
|
|
|
\subsection{Batched Inference}
|
|
|
|
Throughput scaling with batch size (A100, Llama-3-8B, f16):
|
|
|
|
\begin{table}[H]
|
|
\centering
|
|
\small
|
|
\begin{tabular}{lcccc}
|
|
\toprule
|
|
\textbf{Framework} & \textbf{B=1} & \textbf{B=8} & \textbf{B=32} & \textbf{B=128} \\
|
|
\midrule
|
|
PyTorch (compile) & 52.1 & 312 & 847 & 1,423 \\
|
|
TensorRT-LLM & 71.8 & 489 & 1,412 & 2,847 \\
|
|
\textbf{Candle} & 64.7 & 421 & 1,234 & 2,612 \\
|
|
\bottomrule
|
|
\end{tabular}
|
|
\caption{Batched inference throughput (total tokens/second, A100).}
|
|
\label{tab:batch_bench}
|
|
\end{table}
|
|
|
|
\subsection{Latency Variance}
|
|
|
|
P99 latency over 10,000 sequential inferences (Llama-3-8B, A100, batch=1):
|
|
|
|
\begin{table}[H]
|
|
\centering
|
|
\small
|
|
\begin{tabular}{lccc}
|
|
\toprule
|
|
\textbf{Framework} & \textbf{P50 (ms)} & \textbf{P99 (ms)} & \textbf{P99/P50} \\
|
|
\midrule
|
|
PyTorch (eager) & 26.2 & 48.7 & 1.86x \\
|
|
PyTorch (compile) & 19.2 & 31.4 & 1.64x \\
|
|
ONNX Runtime & 20.5 & 28.9 & 1.41x \\
|
|
llama.cpp & 14.9 & 18.2 & 1.22x \\
|
|
\textbf{Candle} & \textbf{15.5} & \textbf{17.1} & \textbf{1.10x} \\
|
|
\bottomrule
|
|
\end{tabular}
|
|
\caption{Latency variance comparison. Candle's lack of GC results in 3.1x lower P99/P50 ratio than PyTorch.}
|
|
\label{tab:latency}
|
|
\end{table}
|
|
|
|
The P99/P50 ratio of 1.10x for Candle versus 1.86x for PyTorch demonstrates the benefit of Rust's deterministic memory management for latency-sensitive serving.
|
|
|
|
\subsection{Memory Efficiency}
|
|
|
|
Peak GPU memory usage for various model sizes:
|
|
|
|
\begin{table}[H]
|
|
\centering
|
|
\small
|
|
\begin{tabular}{lccc}
|
|
\toprule
|
|
\textbf{Model} & \textbf{PyTorch} & \textbf{Candle} & \textbf{Savings} \\
|
|
\midrule
|
|
Llama-3-8B (f16) & 16.8 GB & 15.2 GB & 9.5\% \\
|
|
Mistral-7B (f16) & 14.9 GB & 13.4 GB & 10.1\% \\
|
|
Llama-3-70B (Q4) & 42.1 GB & 37.8 GB & 10.2\% \\
|
|
Phi-3-mini (f16) & 8.2 GB & 7.4 GB & 9.8\% \\
|
|
\bottomrule
|
|
\end{tabular}
|
|
\caption{Peak GPU memory usage comparison.}
|
|
\label{tab:memory}
|
|
\end{table}
|
|
|
|
The 9--10\% memory savings come from arena allocation reducing fragmentation and zero-copy views avoiding temporary copies.
|
|
|
|
\subsection{Multimodal Benchmarks}
|
|
|
|
\begin{table}[H]
|
|
\centering
|
|
\small
|
|
\begin{tabular}{lcccc}
|
|
\toprule
|
|
\textbf{Model} & \textbf{Task} & \textbf{PyTorch} & \textbf{Candle} & \textbf{Speedup} \\
|
|
\midrule
|
|
CLIP & Embed (img) & 8.2ms & 4.7ms & 1.7x \\
|
|
Whisper-large & Transcribe & 3.2s & 2.1s & 1.5x \\
|
|
SAM & Segment & 42ms & 28ms & 1.5x \\
|
|
LLaVA-7B & VQA & 1.8s & 1.1s & 1.6x \\
|
|
SD-XL & Generate & 4.1s & 2.9s & 1.4x \\
|
|
\bottomrule
|
|
\end{tabular}
|
|
\caption{Multimodal model benchmarks (A100).}
|
|
\label{tab:multimodal}
|
|
\end{table}
|
|
|