transformers-php icon indicating copy to clipboard operation
transformers-php copied to clipboard

OpenMP error on PHP 8.2

Open timwhitlock opened this issue 6 months ago • 7 comments

System Info

Running on my Mac Mini (M2 chip) macOS Sonoma (14.6.1).

This occurs in PHP 8.2, but PHP 8.3 seems unaffected.

PHP Version

8.2.19

Environment/Platform

  • [X] Command-line application
  • [ ] Web application
  • [ ] Serverless
  • [ ] Other (please specify)

Description

OMP: Error #15: Initializing libomp.dylib, but found libomp.dylib already initialized.

OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://openmp.llvm.org/

Abort trap: 6

Reproduction

$e = Codewithkyrian\Transformers\Pipelines\pipeline (
    task: Codewithkyrian\Transformers\Pipelines\Task::Embeddings,
    modelName: 'Xenova/all-MiniLM-L6-v2',
);
$e( 'Hello World', normalize: true, pooling: 'mean');

timwhitlock avatar Aug 28 '24 12:08 timwhitlock