From d8b6ae8d1a20caa6cf6074e6dbc720daf69e18ac Mon Sep 17 00:00:00 2001 From: Andy Lee Date: Mon, 28 Jul 2025 16:31:41 -0700 Subject: [PATCH] fix: disable OpenMP parallelism in CI to avoid libomp crashes - Set OMP_NUM_THREADS=1 to avoid OpenMP thread synchronization issues - Set MKL_NUM_THREADS=1 for single-threaded MKL operations - This prevents segfaults in LayerNorm on macOS CI runners - Addresses the libomp compatibility issues with PyTorch on Apple Silicon --- .github/workflows/build-reusable.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-reusable.yml b/.github/workflows/build-reusable.yml index 6e92982..d6b9c97 100644 --- a/.github/workflows/build-reusable.yml +++ b/.github/workflows/build-reusable.yml @@ -224,10 +224,12 @@ jobs: HF_HUB_DISABLE_SYMLINKS: 1 TOKENIZERS_PARALLELISM: false PYTORCH_ENABLE_MPS_FALLBACK: 0 # Disable MPS on macOS CI to avoid memory issues + OMP_NUM_THREADS: 1 # Disable OpenMP parallelism to avoid libomp crashes + MKL_NUM_THREADS: 1 # Single thread for MKL operations run: | # Activate virtual environment source .venv/bin/activate || source .venv/Scripts/activate - + # Run all tests pytest tests/