diff --git a/.gitignore b/.gitignore index d51a2c31..602abe78 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ site/ debug_code/ .pytest_cache/ *.pt +**/.env # Large test data (download separately if needed for regression tests) tests/onecomp/quantizer/jointq/data/model_layers_0_self_attn_k_proj.pth .uv-sync.lock diff --git a/CHANGELOG.md b/CHANGELOG.md index 556995d1..2fc97172 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change log +## [v1.3.2] 2026-08-dd + +### Documentation + +- Add troubleshooting information for running OneComp with Llama.cpp on macOS. + ## [v1.3.1] 2026-08-06 ### Bug Fix diff --git a/docs/user-guide/cpu-inference.md b/docs/user-guide/cpu-inference.md index 860a32d9..3d3f43a7 100644 --- a/docs/user-guide/cpu-inference.md +++ b/docs/user-guide/cpu-inference.md @@ -19,6 +19,59 @@ for inference. The direct export path additionally uses llama.cpp's pure-Python `convert_hf_to_gguf.py` to build the model metadata/tokenizer; it is fetched automatically (a shallow `git clone`) or taken from `$LLAMA_CPP_DIR` if set. + +### macOS + +#### Symptom + +If you have installed gcc or clang on macOS using a tool like Homebrew, the OpenMP dynamic library with them can conflict with the OpenMP dynamic library used by OneComp's PyTorch backend. + +- OneComp's PyTorch backend is often configured to use an OpenMP library located within the .venv directory. +- Depending on your environment, Llama.cpp is configured to use an OpenMP library associated with gcc or clang. + +If the following problems is occurring , this conflict may be occurring. + +- Your Python interpreter shows the following warning message. + +```python +.../multiprocessing/resource_tracker.py:279: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown + warnings.warn('resource_tracker: There appear to be %d ' +``` + +- The following message is shown, when you import PyTorch and Llama.cpp in your script. + +```python +OMP: Error #15: Initializing libomp.dylib, but found libomp.dylib already initialized. +OMP: Hint This means that mult +``` + +#### Solution + +##### 1. Search for OpenMP associated with PyTorch. + +Search for OpenMP library associated with PyTorch backend (using find command). + +```bash +$ find $PWD/.venv -type f \( -name 'libomp.dylib' -o -name 'libgomp*.dylib' \) -print | grep torch +/to/path/.venv/lib/python3./site-packages/torch/lib/libomp.dylib +``` + +##### 2. Create an .env + +Create a .env file and add the OpenMP path as an environment variable, as shown below. + +```bash +DYLD_LIBRARY_PATH="/to/path/.venv/lib/python3./site-packages/torch/lib" +``` + +##### 3. Run uv + +Pass the following `--env-file` options when running uv run. + +```bash +uv run --env-file /path/to/.env ... python your_script.py +``` + ## One entry point: `export_to_gguf` You do not need to know which path a checkpoint requires. `export_to_gguf`