🤖 AI Summary
This work addresses the lack of efficient support for high-precision integer division in the range of $2^{15}$ to $2^{18}$ bits on general-purpose GPUs. We propose a fully integer-based Newton–Raphson division algorithm that leverages shift-based inversion, prefix sums, and multi-precision multiplication to enable data-parallel acceleration on CUDA platforms, achieving the first efficient implementation for this precision range. A performance cost model centered on the number of multiplications guides our algorithmic optimizations. Experimental results demonstrate that the proposed method attains near-theoretical-optimal performance within the target precision and significantly outperforms the state-of-the-art CGBN library in handling medium-sized large integer divisions.
📝 Abstract
This paper presents the issues arising in implementing a fast integer division algorithm on general purpose GPUs. The algorithm uses a Newton iteration based on the shifted inverse operation, keeping all arithmetic in the integer domain and relying on data-parallel operators. The principal contribution is an efficient GPU/CUDA implementation for integer precisions from $2^{15}$ to $2^{18}$ -- sizes not supported by \cgbn{} division. We propose algorithmic refinements, define a cost model in terms of multiplications, build on prefix sums and previous work on multi-precision multiplication, and present an evaluation showing near-optimal performance relative to the model for the target precision.