Large-Scale TensorCircuit Contractions on GPUs: Disabling XLA GPU Autotuning
When running large-scale tensor-network contractions with TensorCircuit-NG and the JAX GPU backend, disabling XLA GPU autotuning via `XLA_PYTHON_CLIENT_PREALLOCATE=false XLA_FLAGS=--xla_gpu_autotune_level=0` reduces persistent GPU memory usage. XLA GPU autotuning evaluates alternative algorithms or workspace configurations for kernels and custom calls, which is valuable for convolutions and large GEMMs but offers little optimization freedom for TensorCircuit contractions where the contraction path is already determined by OMECO or cotengra. The main benefit is not speed but lower persistent GPU memory usage from autotuning, making memory behavior during compilation and on the first visible GPU more predictable. In tested TensorCircuit contraction workloads, disabling autotuning also slightly improved steady-state runtime, but the memory savings were the more important result. The article recommends running an A/B test by defining environment variables before executing the Python script.
Disabling XLA GPU autotuning reduces memory overhead for TensorCircuit contractions, making GPU memory usage more predictable.