microsoft / microsoft/BitNet

pthread_attr_setaffinity_np: symbol not found

Open
#187 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
40.3k
Forks
3.7k
PR merge metrics
No merged PRs in 30d

Description

Image
Traceback (most recent call last):
When I tried python setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s, Got the above problem. Could you please give some advice.
File "/home/workspace/BitNet/utils/convert-hf-to-gguf-bitnet.py", line 20, in
import torch
File "/usr/local/lib/python3.12/site-packages/torch/init.py", line 236, in
_load_global_deps()
File "/usr/local/lib/python3.12/site-packages/torch/init.py", line 195, in _load_global_deps
raise err
File "/usr/local/lib/python3.12/site-packages/torch/init.py", line 176, in _load_global_deps
ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
File "/usr/local/lib/python3.12/ctypes/init.py", line 379, in init
self._handle = _dlopen(self._name, mode)
^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: Error relocating /usr/local/lib/python3.12/site-packages/torch/lib/libgomp-a34b3233.so.1: pthread_attr_setaffinity_np: symbol not found

My envs packages are as follows:
Package Version


certifi 2025.1.31
charset-normalizer 3.4.1
filelock 3.18.0
fsspec 2025.3.2
gguf 0.10.0
huggingface-hub 0.30.2
idna 3.10
Jinja2 3.1.6
MarkupSafe 3.0.2
mpmath 1.3.0
networkx 3.4.2
numpy 1.26.4
packaging 24.2
pip 25.0.1
protobuf 4.25.6
PyYAML 6.0.2
regex 2024.11.6
requests 2.32.3
safetensors 0.5.3
sentencepiece 0.2.0
sympy 1.13.3
tokenizers 0.21.1
torch 2.2.2+cpu
tqdm 4.67.1
transformers 4.51.3
typing_extensions 4.13.2
urllib3 2.4.0

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with setup_env.py and the traceback at utils/convert-hf-to-gguf-bitnet.py, then reproduce the torch import in the reported Python 3.12 environment. Compare the runtime and dependency assumptions around libgomp and pthread; done means the setup command completes without the relocation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.