onnxruntime: [Build] compilation error: invalid instruction mnemonic 'vcvtneeph2ps'

Describe the issue

I am attempting to compile ONNX Runtime on the LUMI supercomputer, a Cray system.

The configuration step is completed without any issues. However, during the compile phase, I encountered problems when using the default CC and cc Cray compiler wrappers, which apply Cray-specific optimizations. To bypass this, I manually specified the AMD compilers (amdclang and amdclang++) instead of the wrappers.

System Details:

  • GPU: AMD MI250X (gfx90a)
  • CPU: AMD EPYC 7A53 “Trento”

Now, I’m encountering a compile-time error possibly related to the AVX512 instruction set: error: invalid instruction mnemonic 'vcvtneeph2ps', but I’m not familiar enough with all this to diagnose the issue. I would appreciate any guidance on how to address this.

Urgency

Not urgent, but would be nice to have since I have a big inference job on a project.

Target platform

AMD MI250X

Build script

The build script relies on some specific modules being loaded to target the correct architecture, as well as loading the correct programming environment. Full reproducibility might be limited because of the exotic nature of the system, but I am more than happy to try myself any suggestions.

module purge

module load PrgEnv-amd
module load rocm/6.0.3
module load craype-accel-amd-gfx90a craype-x86-trento

cd /tmp || exit
git clone --single-branch --branch main --recursive https://github.com/Microsoft/onnxruntime onnxruntime
cd onnxruntime || exit

mamba install rust -y
pip install cmake

./build.sh --config Release \
    --build_wheel \
    --update \
    --build \
    --parallel \
    --use_rocm \
    --rocm_home "$ROCM_PATH" \
    --cmake_extra_defines CMAKE_HIP_ARCHITECTURES=gfx90a \
    --cmake_extra_defines CMAKE_C_COMPILER=amdclang \
    --cmake_extra_defines CMAKE_CXX_COMPILER=amdclang++

pip install build/Linux/Release/dist/*

Error / output

log.txt

Visual Studio Version

No response

GCC / Compiler Version

AMD clang version 17.0.0 (https://github.com/RadeonOpenCompute/llvm-project roc-6.0.3 24012 af27734ed982b52a9f1be0f035ac91726fc697e4)

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

remove the if(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 13.1 AND NOT(APPLE)) and I see below error 2407.1 [ 67%] Linking CXX executable onnxruntime_mlas_q4dq 2407.4 /usr/bin/ld: libonnxruntime_mlas.a(platform.cpp.o): in function MLAS_PLATFORM::MLAS_PLATFORM()': 2407.4 platform.cpp:(.text._ZN13MLAS_PLATFORMC2Ev+0x4d2): undefined reference to MlasCastF16ToF32KernelAvx’ 2407.4 collect2: error: ld returned 1 exit status 2407.4 gmake[2]: *** [CMakeFiles/onnxruntime_mlas_q4dq.dir/build.make:164: onnxruntime_mlas_q4dq] Error 1 2407.4 gmake[1]: *** [CMakeFiles/Makefile2:1938: CMakeFiles/onnxruntime_mlas_q4dq.dir/all] Error 2 2407.4 gmake[1]: *** Waiting for unfinished jobs…

Please add “–compile_no_warning_as_error” to your build command.