Skip to content

TIGRE v3.3.1

Latest

Choose a tag to compare

@AnderBiguri AnderBiguri released this 23 Nov 23:28
· 149 commits to master since this release
9341da7

This release is about speed. It makes the projection operators faster on every problem size. The biggest gains are where a call's fixed costs used to dominate: small images, 2D (fan-beam) problems, and the operators inside iterative algorithms and neural networks. Results are the same as in 3.3.0, bit for bit, except for two tiny rounding differences listed below.

TIGRE 3.3.1 against the ASTRA Toolbox

The technical note TIGRE 3.3.1 and ASTRA 2.5: a speed comparison of the projection operators on one and several GPUs compares the two toolboxes on an RTX 4070 and on a server with four Quadro RTX 6000. It covers cone, parallel and fan beam, from 32³ to 1536³, with NumPy arrays and GPU tensors. For every case where ASTRA is faster, it gives the reason.

  • On one GPU, TIGRE is faster in 129 of 205 comparisons on the RTX 4070. Leaving out TIGRE's interpolated projector, which this release did not optimise, it is faster in 127 of 151.
  • In 3D, TIGRE's Siddon projector takes about half of ASTRA's forward-projection time.
  • TIGRE's backprojectors take 0.54–0.67 of ASTRA's backprojection time in 3D, and about a fifth in 2D.
  • On a 1536³ problem with 1536 angles, larger than one GPU, TIGRE's forward projection is 4.1× faster than ASTRA's on one GPU and 2.3× on four.
  • ASTRA is faster than TIGRE's interpolated projector, in 2D Siddon projection, and on several GPUs for most problems that fit in one. The multi-GPU results come from a single server; see #919.

Highlights

  • Faster backprojection. The cone-beam backprojectors read the projections through layered 2D textures: a bilinear fetch instead of a trilinear one, which costs half as much and gives the same value (#912).
    • 3D: Atb is 1.4–1.6× faster than in 3.3.0 (RTX 4070 and Quadro RTX 6000).
    • Fan beam: 5.1–7.8× faster.
  • Faster Siddon forward projection.
    • The ray walk takes several steps per pass, so several texture reads are in flight at once (#913, #916). The number of steps is chosen from the detector and image sizes, which avoids a slowdown with coarse detectors.
    • 3D cone beam: 1.1–1.2× faster on an RTX 4070, 1.7–2.2× on a Quadro RTX 6000.
    • Fan beam: 4.9–10× faster.
  • Much lower fixed cost per call (#904, #907, #911).
    • Launch shapes suited to thin problems such as fan beam and images with few slices.
    • The geometry is copied from Python faster.
    • No needless waits for the GPU, and no needless allocation or page-locking.
    • A fan-beam Ax of a 256² image with 360 angles took 7.9 ms and now takes 1.1 ms (GPU tensors, RTX 4070). Small 3D problems are 1.6–2.3× faster.
  • Multi-GPU.
    • The caller's arrays are page-locked only when the image is split or more than two GPUs are used (#905, #917). On one GPU and on two it cost more than it saved: 2-GPU calls are 5–21% faster than with page-locking.
    • On 1, 2 and 4 GPUs, every operator is now as fast as in 3.3.0 (within measurement noise) or faster.
    • Images larger than GPU memory are page-locked and split as before.
  • FDK.
    • Thin detectors (fan beam) filter several projections per FFT call.
    • The cosine weights are applied while the projections are copied into the FFT buffer, instead of in a pass of their own (#914).
  • SIRT, SART, OS-SART, CGLS update their vectors in place, without full-size temporaries (#915). Same arithmetic, less memory.

Fixes

  • Atb crashed at 1024³ when the sizes were passed as 32-bit integers (#903).
  • If page-locking host memory fails, TIGRE falls back to pageable memory, with a warning (#903).
  • A cone-beam backprojection on 4 or more GPUs, where one GPU got no slices, crashed the call and the CUDA context (#906).

Results that change

  • Parallel-beam backprojection: about 2e-6 relative. The per-projection set-up moved to the host, which changes the order of a sum (#912).
  • Fan-beam FDK filtering: up to 3e-7 relative on some CPUs, from FFT batching (#914).
  • Everything else is bit-identical to 3.3.0.

For developers

  • tigre.utilities.filtering.filtering takes optional weights= (applied while filtering) and out= arguments (#914).
  • New headers in Common/CUDA:
    • launch_shapes.hpp: launch shapes, and the Siddon steps-per-pass rule tigre::siddonStepsPerPass;
    • page_locking.hpp: one page-locking rule for all operators, tigre::worthPageLocking.
  • The Siddon cone-beam kernel is renamed kernelPixelDetector_siddon. MSVC gave kernelPixelDetector<1> the same symbol as the interpolated projector's kernelPixelDetector<true>.

Install

pip install git+https://github.com/CERN/TIGRE.git@v3.3.1, or the wheels attached to this release.

The raw results of the speed note, and the scripts that make its tables, are in tigre-3.3.1-speed-results.zip, attached to this release.

Help wanted: the multi-GPU measurements come from a single server. If you have a machine with several GPUs, please run the comparison suite and post the results in #919.

The full list of changes is in changelog.md.

What's Changed

  • Fix Atb crash with 32-bit voxel counts; fall back to pageable memory when page-locking fails by @AnderBiguri in #903
  • Faster projectors for fan beam and thin images (launch shapes) by @AnderBiguri in #904
  • One page-locking rule for all projectors and backprojectors by @AnderBiguri in #905
  • Backprojection on 4+ GPUs: fix the crash when a GPU gets no slices by @AnderBiguri in #906
  • Cut the fixed cost per call of the projectors and backprojectors by @AnderBiguri in #907
  • Cone backprojectors: no wait for the GPU between the kernels of a chunk by @AnderBiguri in #911
  • Backprojectors: layered 2D textures; parallel kernel folded on the host by @AnderBiguri in #912
  • Siddon forward projectors: branch-free ray walk; next launch prepared while the kernels run by @AnderBiguri in #913
  • SIRT/SART/OS-SART/CGLS: vector updates without full-size temporaries by @AnderBiguri in #915
  • FDK: filtering several projections per FFT call; cosine weights applied while filtering by @AnderBiguri in #914
  • Siddon forward projectors: 1, 2 or 4 steps per pass, chosen from the ray spacing by @AnderBiguri in #916
  • Page-lock the host arrays of unsplit calls only from three GPUs by @AnderBiguri in #917
  • Docs for 3.3.1: speed note against ASTRA, revised Siddon note, changelog by @AnderBiguri in #918
  • Release 3.3.1: version numbers and changelog heading by @AnderBiguri in #920

Full Changelog: v3.3.0...v3.3.1