To begin with, great respect for fantastic work which is OpenMVG.
While using SIFT_Anatomy_Image_describer I discovered a discrepancy when it comes to the output it produces - the results are consistent on the same platform, however, they start to differ when running on a different device.
The problem can be reproduced by running a particular test - openMVG_test_sift which yields slightly different output image (gaussian_octave_*.png) on an M1 Mac and on a generic Ubuntu PC, with the same image on the input.
I include my Mac/Ubuntu build scripts here: https://github.com/migr8/openmvg-build-scripts/
The README in the root of the repository describes the exact usage.
The test.sh script will run this specific test case and print MD5 hash of the output gaussian_octave images - they are different based on different platforms:
Most of them conclude that this is due to OMP parallelization.
I made sure no OMP is used through:
Explicitly disabling OMP when building Ceres
Explicitly disabling OMP when building OpenMVG
Exporting OMP_NUM_THREADS=1 when running the test
However, the result is still the same, that is - they differ.
As a note, contents of the patches directory on the build scripts repo could be upstreamed to the OpenMVG repository - I solved the problem of building on an M1 Mac (running OpenMVG on it right now :)) and even targeting iOS through ios-cmake toolchain file - which solves relevant issues:
In total, I ran OpenMVG on x86_64 Windows, x86_64 Ubuntu, ARM64 Android, ARM64 iOS, ARM64 Mac and x86_64 Mac - all to see how the output differs across the platforms.
Results are, that all Apple results are consistent (scratch that, see Intel vs ARM Mac above), and all non-Apple results are consistent - which would suggest this has something to do specifically with Apple.
Another path I explored is compiling OpenMVG on Mac using GCC 12 - different results than using clang, but not the same as on non-Apple devices.
Also, I tested how setting constant seed through std::srand will affect the test - it does not.
Hello,
To begin with, great respect for fantastic work which is OpenMVG.
While using
SIFT_Anatomy_Image_describer
I discovered a discrepancy when it comes to the output it produces - the results are consistent on the same platform, however, they start to differ when running on a different device.The problem can be reproduced by running a particular test -
openMVG_test_sift
which yields slightly different output image (gaussian_octave_*.png
) on an M1 Mac and on a generic Ubuntu PC, with the same image on the input.I include my Mac/Ubuntu build scripts here: https://github.com/migr8/openmvg-build-scripts/ The README in the root of the repository describes the exact usage. The
test.sh
script will run this specific test case and print MD5 hash of the outputgaussian_octave
images - they are different based on different platforms:I traced similar reports on the OpenMVG issue page:
https://github.com/openMVG/openMVG/issues/1707 https://github.com/openMVG/openMVG/issues/1966 https://github.com/openMVG/openMVG/issues/471 https://github.com/openMVG/openMVG/issues/1707 https://github.com/openMVG/openMVG/issues/2030 https://github.com/openMVG/openMVG/issues/1928 https://github.com/openMVG/openMVG/issues/1840 https://github.com/openMVG/openMVG/issues/1128
Most of them conclude that this is due to OMP parallelization. I made sure no OMP is used through:
OMP_NUM_THREADS=1
when running the testHowever, the result is still the same, that is - they differ.
As a note, contents of the
patches
directory on the build scripts repo could be upstreamed to the OpenMVG repository - I solved the problem of building on an M1 Mac (running OpenMVG on it right now :)) and even targeting iOS through ios-cmake toolchain file - which solves relevant issues:https://github.com/openMVG/openMVG/issues/2024 https://github.com/openMVG/openMVG/issues/1954 https://github.com/openMVG/openMVG/issues/1864 https://github.com/openMVG/openMVG/issues/1820
In total, I ran OpenMVG on x86_64 Windows, x86_64 Ubuntu, ARM64 Android, ARM64 iOS, ARM64 Mac and x86_64 Mac - all to see how the output differs across the platforms.
Results are, that
all Apple results are consistent(scratch that, see Intel vs ARM Mac above), and all non-Apple results are consistent - which would suggest this has something to do specifically with Apple.Another path I explored is compiling OpenMVG on Mac using GCC 12 - different results than using clang, but not the same as on non-Apple devices.
Also, I tested how setting constant seed through
std::srand
will affect the test - it does not.Regards, Daniel