Source-linked AI summary

gpuRIR: A Python Library for Room Impulse Response Simulation with GPU Acceleration

David Diaz-Guerra, Antonio Miguel, Jose R. Beltran

arXiv:1810.11359v4eess.AScs.SD

TL;DR

Accurate ISM-based RIR simulation becomes costly as reverberation and the number of required RIRs increase. The paper introduces a GPU-parallel Python library using performance-oriented arithmetic and lookup-table techniques, reports about one hundred times faster execution than state-of-the-art CPU libraries, and provides a broadly usable open-source implementation.

  • Problem

    ISM offers flexible, accurate RIR simulation, but its computational cost grows rapidly with reverberation and many source–receiver configurations, limiting applications needing large numbers of simulations.

  • Method

    The paper implements ISM on GPUs, parallelizing multiple RIRs, image-source computation, and filtering while studying lookup tables and mixed-precision arithmetic.

  • Results

    About one hundred times faster than other state-of-the-art CPU libraries, the GPU library uses lookup tables by default because they remain compatible with most CUDA GPUs.

  • Takeaways & Limitations

    The free and open-source library is intended to support large acoustic datasets and can be upgraded to exploit future GPU features.

  • Takeaways & Limitations

    The mixed-precision implementation reduces accuracy and is incompatible with lookup tables, while 16-bit arithmetic is compatible only with newer GPUs.

Abstract

from arXiv · show

The Image Source Method (ISM) is one of the most employed techniques to calculate acoustic Room Impulse Responses (RIRs), however, its computational complexity grows fast with the reverberation time of the room and its computation time can be prohibitive for some applications where a huge number of RIRs are needed. In this paper, we present a new implementation that dramatically improves the computation speed of the ISM by using Graphic Processing Units (GPUs) to parallelize both the simulation of multiple RIRs and the computation of the images inside each RIR. Additional speedups were achieved by exploiting the mixed precision capabilities of the newer GPUs and by using lookup tables. We provide a Python library under GNU license that can be easily used without any knowledge about GPU programming and we show that it is about 100 times faster than other state of the art CPU libraries. It may become a powerful tool for many applications that need to perform a large number of acoustic simulations, such as training machine learning systems for audio signal processing, or for real-time room acoustics simulations for immersive multimedia systems, such as augmented or virtual reality.

1 Introduction

The paper targets the rapidly growing cost of accurate ISM-based RIR simulation, especially when many room configurations or source–receiver pairs must be computed. It introduces a GPU-accelerated, open-source Python implementation designed for broad usability and substantially higher speed.

  • 1 Introduction: The implementation is positioned for applications requiring many acoustic simulations, including machine-learning data generation and real-time room-acoustics scenarios.The paper compares the library with several state-of-the-art ISM implementations.
  • 1 Introduction: ISM enables flexible and accurate RIR simulation, but its computational complexity rises quickly with the number of reflections and required source–receiver positions.The method supports changes to room size, wall absorption, and source and receiver positions.
  • 1 Introduction: GPU parallelization is used to accelerate both multiple-RIR simulation and the computation of image sources within each RIR.The implementation is designed for newer GPU architectures and increases the degree of parallelism compared with the prior GPU approach.
  • 1 Introduction: Lookup tables and 16-bit floating-point arithmetic are studied as additional techniques for increasing GPU simulation performance.The paper presents these techniques as part of its performance-oriented implementation strategy.
  • 1 Introduction: The authors provide a free and open-source Python library that can be used without GPU-programming knowledge, given a CUDA-compatible GPU and toolkit.It can be installed and used similarly to a CPU RIR simulation library.

2 The Image Source Method (ISM)

The ISM models room reflections with equivalent image sources, then constructs RIRs from their delays and amplitudes. For long reverberation, the method can combine early ISM reflections with a diffuse noise tail to reduce computation.

  • Original Allen and Berkley algorithm: The ISM represents each reflected wave-front as a direct path from an equivalent image source in a grid of mirrored rooms.The image-source grid is formed by reflecting the room across each dimension.
  • Original Allen and Berkley algorithm: For each image source, the receiver distance determines the arrival delay, using the Euclidean norm and the speed of sound.The delay is τ_n = d_n/c.
  • Original Allen and Berkley algorithm: Each image contribution is scaled by the product of wall reflection coefficients crossed by its path, producing its amplitude factor.The reflection coefficients are defined for the near and far walls along each room axis.
  • Fractional delays: The RIR is obtained by summing the contributions from all image sources, while fractional delays are represented with a windowed sinc instead of nearest-sample rounding.The sinc is windowed by a Hanning function; typical settings are T_ω = 4 ms and f_c = f_s/2.
  • Computational complexity: The number of image sources per dimension grows linearly with reverberation time, making the operation count in the RIR sum grow cubically.This motivates approximating late reverberation separately from early reflections.
  • Diffuse reverberation: A late reverberation tail can be modeled with noise shaped by an exponential power envelope based on the Sabine reverberation-time model.The model uses T60, room volume, wall areas, and absorption coefficients; α is defined from pressure reflection coefficients as α_i = 1 − β_i^2.

3 Parallel implementation

The GPU implementation parallelizes independent image-source and RIR computations while using staged reductions for the shared contribution sum. Memory-aware accumulation, lookup tables, and mixed precision target the sinc-function bottleneck, with accuracy and compatibility trade-offs.

  • Parallelization: Independent image-source delays, amplitudes, sinc functions, and same-room RIRs are computed in parallel, while summing image contributions requires specialized reduction.RIRs from different rooms are not parallelized because varying image-source counts would force a worst-case allocation and reduce average performance.
  • Performance bottleneck: Most simulation time is spent in generateRIR because many sinc functions must be evaluated, making it the principal optimization target.The same sinc workload also dominates sequential implementations, while GPU parallelism reduces the corresponding CPU computation time.
  • Memory-aware reduction: Each thread sequentially sums 512 image contributions for one RIR time sample, reducing GPU tensor memory without lowering performance when enough threads keep the GPU busy.The reduced tensor is then accumulated with recursive pairwise reductions.
  • Memory-aware reduction: The reduction is pairwise because concurrent writes to shared result locations would corrupt the RIR, and each time sample is summed in parallel.The reduction proceeds through repeated reduceRIR kernel calls.
  • Optimization techniques: Half precision reduces accuracy over time, so the implementation performs t − τ_n subtraction in 32-bit arithmetic before converting the result to 16-bit precision.This preserves maximum precision near the sinc center while leaving lower accuracy outside the Hanning window.

4 Python library

The paper packages the GPU implementation as an installable Python library with a CPU-library-like interface. It supports configurable RIR simulation, reverberation utilities, filtering, and on-demand simulation for machine-learning applications.

  • Library interface: The implementation is distributed as a Python library that can be compiled and installed with pip.It is intended to be used similarly to a CPU library.
  • Library interface: The main function accepts room, wall, source, receiver, image-count, duration, reverberation-transition, and sampling parameters, returning a 3D tensor of RIRs.Receiver polar patterns and orientations can also be included.
  • Supporting utilities: Additional functions predict attenuation times, derive wall coefficients for a target T60, select image counts, and filter signals with multiple RIRs.These utilities support reverberation control and moving-source simulation.
  • Configuration: Lookup-table sinc computation is enabled by default because its precision loss is described as negligible, while users can activate mixed-precision kernels separately.The library also provides options to disable the LUT and use CUDA trigonometric functions.
  • Application: The library has been used to generate training signals on demand for a 3D convolutional sound-source-tracking system instead of relying on a pre-simulated dataset.The paper reports that prior-library simulation times would have made this approach unfeasible.

5 Results

The evaluation compares gpuRIR with established RIR libraries across workload sizes, reverberation times, lookup-table use, and mixed precision. gpuRIR substantially reduces runtime, while its accuracy-preserving speedups depend on GPU architecture and workload.

  • 5.1 Base implementation: gpuRIR simulates about 100 times more RIRs per second than the Matlab library and is also about 100 times faster than RIR Generator in the reported comparison.The comparison uses a 3 m × 4 m × 2.5 m room with T60 = 0.7 s and a gaming-oriented GTX 980 Ti GPU.
  • 5.1 Base implementation: On a Tesla V100, gpuRIR computes ten times more RIRs per second than pyroomacoustics without lookup tables.On the GTX 980 Ti, pyroomacoustics performs similarly because it uses lookup tables for sinc computation.
  • 5.1 Base implementation: The Tesla V100 is more than 5 times faster than the GTX 980 Ti, while the Tesla T4 slightly outperforms the Tesla P100.The results are consistent with computation time being mostly limited by the number of operations performed per second.
  • 5.1 Base implementation: gpuRIR is about two orders of magnitude faster than sequential alternatives without lookup tables when computing 128 RIRs across reverberation times.The experiment uses a 3 m × 4 m × 2.5 m room and varies reverberation time.
  • 5.2 Lookup tables: Lookup tables usually accelerate gpuRIR, but their benefit is smaller than in CPU implementations because GPUs compute trigonometric functions efficiently.The Tesla P100 obtains the highest lookup-table speedups among the studied GPUs.
  • 5.2 Lookup tables: Lookup-table error is negligible at roughly three orders of magnitude below the RIR amplitude, whereas mixed-precision error later becomes relatively more prominent as the RIR decays.The mixed-precision error is three orders of magnitude below the RIR amplitude initially, but its signal-to-error ratio deteriorates over time.
  • 5.3 Mixed precision: Mixed precision consistently provides greater speedup than lookup tables, with the Tesla P100 approaching a speedup of 2 for high workloads.Mixed precision is unavailable on the older GTX 980 Ti, and Tesla T4 speedups are more erratic than those of other GPUs.

6 Conclusions

The paper concludes that gpuRIR is a free, open-source GPU library that greatly accelerates RIR simulation. Its default lookup-table implementation favors broad CUDA compatibility, while mixed precision offers higher speed on newer GPUs.

  • 6 Conclusions: gpuRIR is a free and open-source GPU library that is about one hundred times faster than state-of-the-art CPU libraries.The authors describe it as the first library with these combined features to their knowledge.
  • 6 Conclusions: The library could support generating large audio datasets and computing Virtual Reality scene acoustics in real time.These applications are presented as examples of uses enabled by its freely available implementation and reduced simulation time.
  • 6 Conclusions: Sixteen-bit arithmetic is the fastest strategy studied, but lookup tables in texture memory are the default because they work with most CUDA GPUs.Mixed precision is compatible only with newer GPUs, whereas the lookup-table implementation has broader hardware compatibility.
  • 6 Conclusions: The authors expect gpuRIR to help audio signal-processing applications that need large simulated datasets and to remain upgradeable as GPU features evolve.The open-source release permits upgrades by the authors or other researchers.
Loading 1810.11359v4…