MegBA: A GPU-Based Distributed Library for Large-Scale Bundle Adjustment
This repo contains an official implementation of MegBA.
MegBA is a fast and distributed library for large-scale Bundle Adjustment (BA). MegBA has a novel end-to-end vectorised BA algorithm which can fully exploit the massive parallel cores on GPUs, thus speeding up the entire BA computation. It also has a novel distributed BA algorithm that can automatically partition BA problems, and solve BA sub-problems using distributed GPUs. The GPUs synchronise intermediate solving state using network-efficient collective communication, and the synchronisation is designed to minimise communication cost. MegBA has a memory-efficient GPU runtime and it exposes g2o-compatible APIs. Experiments show that MegBA can out-perform state-of-the-art BA libraries (i.e., Ceres and DeepLM) by ~50x and ~5x respectively, in public large-scale BA benchmarks.
Paper: https://arxiv.org/abs/2112.01349 (updated version)
Dependencies:
You can also easily install all dependencies with script: script
Demo with BAL dataset:
Download any pre.txt.bz2 file from BAL Dataset: https://grail.cs.washington.edu/projects/bal/ and uncompressed.
Compile
If you want to use the distributed feature, use cmake -DMEGBA_ENABLE_NCCL ..
instead of cmake ..
.
git submodule update --init
mkdir build
cd build
cmake .. # enable nccl by using cmake -DMEGBA_ENABLE_NCCL ..
make -j4 BAL_Double
Run the demo (Venice-1778)
cd examples
./BAL_Double --path /path/to/your/dataset --world_size 2 --max_iter 100 --solver_tol 1e-1 --solver_refuse_ratio 1 --solver_max_iter 100 --tau 1e4 --epsilon1 1 --epsilon2 1e-10
Under doc/ (Coming soon...)
Please check here for MegBA's future plan.
If you are interested in MegBA and want to collaborate, you can:
Contact Information:
If you find MegBA useful for your project, please consider citing:
@inproceedings{2021megba,
title={MegBA: A GPU-Based Distributed Library for Large-Scale Bundle Adjustment},
author={Jie Ren and Wenteng Liang and Ran Yan and Luo Mai and Shiwen Liu and Xiao Liu},
booktitle={European Conference on Computer Vision},
year={2022}
}
MegBA is licensed under the Apache License, Version 2.0.