RadioImagerGPU is a project developed as part of the CS 179 course at Caltech. It focuses on developing a GPU-accelerated imager for radio telescope arrays, optimizing the imaging process in arrays with dense UVW sampling. By leveraging the parallel processing capabilities of GPUs, this project aims to enhance the efficiency and performance of radio imaging, potentially simplifying the imaging pipeline and reducing the reliance on complex deconvolution algorithms.
- Description and Overview
- Introduction
- System Requirements
- Installation and Building the Project
- Configuration
- GPU Implementation
- CPU Implementation
- Running Tests
- Analysis
- Documentation
- Additional Notes
- Contact Information
Radio telescopes capture data known as visibilities, which are the Fourier transform of the sky's brightness distribution. Processing this data involves complex calculations that can be computationally intensive, especially for large datasets. Traditional CPU-based methods often struggle with the high computational load, leading to slower processing times.
GPUs, with their ability to perform parallel processing, are well-suited for handling these intensive computations. They can efficiently manage the gridding of visibilities, apply complex weighting schemes, and perform fast Fourier transforms (FFTs). This makes GPUs ideal for enhancing the speed and efficiency of radio imaging processes, allowing for real-time imaging and handling larger datasets with higher precision.
Additionally, the project involves calculating UVW coordinates from XYZ positions of the antennas. The visibility function is calculated using an integral that accounts for the brightness distribution of the sky as a function of celestial coordinates and spatial frequency coordinates.
By optimizing these computations using GPU acceleration, RadioImagerGPU aims to provide a more efficient and scalable solution for radio telescope imaging.
To fully utilize the GPU acceleration capabilities, ensure you have a compatible NVIDIA GPU. Below is the hardware and software setup used for developing and testing this project:
- OS: Ubuntu 22.04.4 LTS (Jammy)
- Kernel: Linux 6.5.0-28-generic
- Driver Version: 550.54.15
- CUDA Version: 12.4
- GPUs:: NVIDIA GeForce GTX TITAN X (2 units, 12 GB each)
- Version: CUDA 12.4
- Python Version: 3.10.12
- The required Python packages are listed in
requirements.txt
.
Clone the repository and navigate to the project directory:
git clone --recurse-submodules https://github.com/nkosogor/RadioImagerGPU.git
cd RadioImagerGPU
pip install -r requirements.txt
Use CMake to configure and build the project:
mkdir build
cd build
cmake ..
make
The config.json
file is used to configure key parameters for the RadioImager
program. This file should be located in the root directory of the repository. The configuration parameters include:
IMAGE_SIZE
: The size of the output image in pixels.PREDEFINE_MAX_UV
: The predefined maximum UV distance parameter essentially makes the resolution of the final images predefined and not dependent on the calculated UV coordinates when the corresponding option is enabled.
One can run the GPU-accelerated imager from the root of the repository with:
./build/RadioImager [OPTIONS]
For detailed GPU implementation instructions, please refer to the src/README.md.
To run the CPU version from the root of the repository, use:
python3 python/imaging_cpu.py [OPTIONS]
For detailed CPU implementation instructions, please refer to the python/README.md.
To run the tests and compare images generated by CUDA and Python implementations, execute the following script from the root of the project:
python3 tests/compare_images.py
For detailed information about the tests, refer to Tests README.
The GPU-accelerated RadioImager shows improvements compared to the CPU implementation. Below is an example of a performance comparison with different numbers of arrays (elements) in the case of 10 directions. The plots on the left show a log scale, and on the right, a linear scale. The GPU outperforms the optimized CPU version, which uses vectorized NumPy operations, for different parts of the calculation (UVW, Imaging, and Total times). For a more detailed description of the results, please refer to the analysis/README.md.
Apart from the aforementioned READMEs, additional documentation is available in the docs
directory as HTML files, which were generated with Doxygen and the Doxyfile. These can be examined either in the docs
directory or or here.
This is a toy imager that needs to be updated to be used in practical real-world scenarios. Some features that can be added for that include:
- Acceptance of Arbitrary Visibilities: Currently, all visibilities are set to 1, so the final image effectively looks like a PSF. Allowing for arbitrary visibilities would make the imager more versatile.
- Addition of W-Projection: For wider fields of view or directions where w-terms become significant, adding w-projection would improve image accuracy.
- Reconstruction of Conjugate Visibilities: Implementing the ability to reconstruct conjugate visibilities from UV coordinates to enhance imaging accuracy.
For questions, please contact nakosogorov@gmail.com or open an issue on GitHub.