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

HPTT: Compilation with -march=native -mtune=native may cause problems on non-uniform clusters #1

Open
QuantumLiquids opened this issue Jan 14, 2025 · 0 comments

Comments

@QuantumLiquids
Copy link
Owner

Problem Summary

When compiling HPTT (or similar software), the compiler options -march=native and -mtune=native are often enabled by default to optimize the code for the specific CPU architecture of the machine performing the compilation. However, this can lead to compatibility issues when the compiled binary is executed on a non-uniform cluster where nodes may have different CPU architectures or configurations.

These options can cause problems in a cluster environment if:

  1. The nodes have different CPU architectures or instruction set support (e.g., AVX512 vs. AVX2).
  2. The binary compiled on one node cannot run on another node with a less advanced CPU architecture.

Impact

  • Running the compiled program on nodes with incompatible architectures can result in illegal instruction errors or suboptimal performance.

Suggested Fix or Workaround

To avoid such issues:

  1. Disable -march=native and -mtune=native during compilation:

    • Modify the file in external/hptt/CMakeLists.txt
    • Alternatively, provide a clear option when compiling HPTT to disable them (e.g., -DNO_NATIVE_OPTIMIZATION=ON).
  2. Manually specify a compatible architecture:

    • Use options like -march=core-avx2 or -march=x86-64 to ensure compatibility across all nodes in the cluster.
  3. Document the behavior:

    • Add a note to the build/compilation instructions warning users about the potential compatibility issues when using these flags in non-uniform clusters.
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