Each backend maintains its own runtime, model coverage, and deployment configurations. Select its tab below for details.
SGLang-TorchTPU
SGL-JAX
PyTorch serving on TPU
SGLang-TorchTPU runs the SGLang serving engine on Google TPUs through torch_tpu and Pallas kernels. You can use PyTorch models with SGLang’s OpenAI-compatible serving API, eager execution, and TPU compilation.Development and testing focus on TPU7x (Ironwood). A single host has four chips and eight TensorCores. Multi-host configurations use tensor and expert parallelism; disaggregated configurations separate prefill and decode across hosts.
Model coverage
Model integrations include Muse Spark Open, GLM-5.3-Flash, Kimi-K3, Kimi-K3.1-Pro, DeepSeek-V4-Flash, Qwen3.8-27B, GPT-OSS, and Gemma 4. Coverage ranges from serving recipes to registered accuracy tests; Kimi-K3 currently has a small-model compile test with dummy weights.The backend includes prefix caching, host-memory KV offload, EAGLE3 and DFlash speculative decoding, and prefill/decode disaggregation. Available combinations depend on the model and topology. Check the repository’s support guide for feature restrictions and experimental capabilities.
Deployment resources
Follow the SGLang-TorchTPU getting-started guide for runtime prerequisites, installation, and a first request.Find model-specific configurations in the repository’s TPU serving recipes. Run these recipes from the TorchTPU checkout with its matching runtime.Report PyTorch TPU issues in sglang-torchtpu, including the TPU generation, topology, model, and runtime versions.
This tab covers the JAX backend. Report JAX-specific issues in sglang-jax.
System Requirements
Supported TPU Hardware
TPU Type
HBM Memory
Availability
TPU v6e
32 GB
Google Cloud
TPU v7
96 GB per core
Google Cloud
Software Requirements
Python: 3.12 or higher
JAX: Latest version with TPU support
Environment: Google Cloud TPU VM or compatible TPU runtime
Optional: SkyPilot for simplified cloud deployment
Feature Support Matrix
SGLang-JAX provides comprehensive TPU-optimized features for production LLM serving:
Feature
Support Status
Description
High-Throughput Continuous Batching
✅
Dynamic request batching for maximum TPU utilization
Radix Tree KV Cache
✅
Memory-efficient prefix sharing between requests
FlashAttention Backend
✅
TPU-optimized attention kernel for long sequences
Tensor Parallelism
✅
Distribute models across multiple TPU cores
Paged Attention
✅
Flexible KV cache management with paging
Speculative Decoding (EAGLE/EAGLE3)
✅
20-40% throughput improvement for compatible models
Chunked Prefill
✅
Mixed prefill-decode batching
OpenAI-Compatible API
✅
Drop-in replacement for OpenAI API
Data Parallel Attention
🚧
In development - Attention computation with data parallelism
Quantization
🚧
In development - Model quantization for reduced memory usage
Multi-LoRA
🚧
In development - Serve multiple LoRA adapters simultaneously
Attention Backend Comparison
Backend
Paged Attention
Spec Decoding
MLA
Sliding Window
FlashAttention (fa)
✅
✅
❌
✅
Native
❌
❌
❌
❌
NOTE: FlashAttention backend is recommended for production workloads due to superior memory efficiency and performance.
Optimized Model List
SGLang-JAX supports the following model families. Use the linked TPU cookbooks for deployment instructions.
NOTE: Speculative decoding is currently supported for Qwen3 and LLaMA model families. See the Speculative Decoding documentation for detailed configuration guidance.
To minimize time-to-first-token (TTFT) and inter-token latency:
Reduce --page-size to 1-4
Lower --max-running-requests (16-32) for smaller batches
Reduce --chunked-prefill-size
Use conservative memory settings to avoid GC pauses
TPU-Specific Optimizations
JIT Compilation Cache:
Command
export JAX_COMPILATION_CACHE_DIR=/tmp/jit_cache
Always set this environment variable to cache compiled kernels and accelerate server startup.
Data Type Optimization:
Use --dtype=bfloat16 for TPU native optimization. TPUs are specifically designed for bfloat16 computations.
Tensor Parallelism:
Match --tp-size to your TPU core configuration (1, 4, or 8) for optimal model distribution.
Attention Backend:
Always use --attention-backend=fa (FlashAttention) for production workloads.
Troubleshooting
OOM (Out of Memory) Errors
If you encounter out-of-memory errors:
Reduce --mem-fraction-static from 0.8 to 0.5 or lower
Decrease --max-prefill-tokens from 8192 to 4096 or 2048
Lower --max-running-requests to reduce concurrent batch size
Increase --page-size for better memory layout efficiency
Compilation Long-Time
If the server takes too long to start:
Ensure JAX_COMPILATION_CACHE_DIR is properly set
Understand that the first run requires JIT compilation (this is normal)
Subsequent runs will be significantly faster with cached compilations
Consider using --skip-server-warmup to defer compilation until first request
Low Throughput
If you’re not achieving expected throughput:
Verify --tp-size matches your TPU core configuration
Check that --attention-backend=fa is enabled
Increase --max-running-requests to enable larger batch formation
Consider enabling speculative decoding for compatible models
Ensure memory settings allow for sufficient batch sizes
Connection Issues
If clients cannot connect to the server:
Ensure --host=0.0.0.0 for external access (not just 127.0.0.1)
Verify firewall rules allow traffic on the specified port (default: 30000)
Check that the server process is running: curl http://localhost:30000/health
Advanced Features
Speculative Decoding
SGLang-JAX supports EAGLE and EAGLE3 speculative decoding algorithms for Qwen3 and LLaMA model families. Speculative decoding can improve throughput by 20-40% without affecting output quality.See the Speculative Decoding documentation for detailed configuration and supported model combinations.
Chunked Prefill
Enable mixed prefill-decode batching for better TPU utilization:
Command
--chunked-prefill-size=2048 --enable-mixed-chunk
This allows the scheduler to mix prefill operations with decode operations in the same batch, improving overall throughput.
Custom Attention Backends
SGLang-JAX supports a plugin-based attention backend system. You can implement custom attention kernels optimized for specific use cases.See the Attention Backend documentation for implementation details.