CTranslate2 icon indicating copy to clipboard operation
CTranslate2 copied to clipboard

CPU Dispatch incompatible with higher CPU baselines

Open jhance opened this issue 6 months ago • 1 comments

Our CC toolchain supports (in at least 1 production deployment) AVX by default but not AVX2. Using CPU dispatch in this case seemingly requires patching the CPU dispatch mechanism. In this case we don't need to compile lower architectures at all, and then the CPU dispatch mechanism should ellide architectures that are lower than the baseline. Otherwise we get undefined symbols, because the way kernel.cc decides which header to include is based on the capabilities of the compiler. An alternative solution would be to pass defines ourselves indicating which dispatch we are building when building for cpu dispatch, instead of relying on __AVX__ and friends.

We will likely fix this issue internally, but would like to know if it is likely that a patch addressing this could be accepted.

jhance avatar Jun 07 '25 01:06 jhance

Is export CT2_FORCE_CPU_ISA=AVX not sufficient?

winstxnhdw avatar Jun 19 '25 15:06 winstxnhdw