Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NNsearch returns neighbors in different order on MacOS - M1 #153

Open
2 tasks
BrunoLevy opened this issue Jun 9, 2024 · 7 comments
Open
2 tasks

NNsearch returns neighbors in different order on MacOS - M1 #153

BrunoLevy opened this issue Jun 9, 2024 · 7 comments

Comments

@BrunoLevy
Copy link
Owner

On MacOS-M1 (macos-14 runner on github), some nearest neighbor search test fail (ANN and geogram return different results).
Debugging strategy:

  • verify that ANN results are the same as with Intel architecture
  • check that there is no Intel-specific code in ANN
@BrunoLevy
Copy link
Owner Author

May come to float to int conversions, handled differently on M1 silicon, more information here

@BrunoLevy
Copy link
Owner Author

BrunoLevy commented Jun 12, 2024

Another hypothesis: ANN has its own boolean type, it may be the culprit (M1 has different int<->bool conversion rules).
-> Nope, still fails when redefiningh ANNbool as bool, ANNfalse as false and ANNtrue as true...

@BrunoLevy
Copy link
Owner Author

Tryed to define ANN_DLB_MAX as 1e300 (instead of using value from limits.h), did not work either.

@BrunoLevy
Copy link
Owner Author

Tryed to compile ANN with all warnings activated -> did not see anything.

@BrunoLevy
Copy link
Owner Author

So next thing to do is to determine which one of ANN or Geogram is right (and there is also the option that both are wrong !!). Let us output the IDs of the NNs when they differ, and compare with a "ground truth" obtained on an Intel...

@BrunoLevy
Copy link
Owner Author

BrunoLevy commented Jun 12, 2024

  • Distances are nearly correct, except a tiny difference, may come from compiler's optimizations
  • It seems that I get garbage instead of the indices ! To be investigated... -> fixed: was 64-bits index_t <-> 32 bit indices in ANN
  • Tryed to recompute distance using same function, but it seems I still get small differences
  • For now, non-regression test uses distances, with tiny tolerance.

@BrunoLevy
Copy link
Owner Author

The problem (nearly) systematically happens when a pair of points is swapped in the two lists.
Re-activated tolerance for now.

@BrunoLevy BrunoLevy changed the title NNsearch tests fail on MacOS - M1 NNsearch returns neighbors in different order on MacOS - M1 Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant