faiss icon indicating copy to clipboard operation
faiss copied to clipboard

There appear to be 1 leaked semaphore objects to clean up at shutdown

Open jakubLangr opened this issue 1 year ago • 2 comments

Summary

Platform

OS: MacOS 10.15 8 GB

Faiss version:

Installed from:

Faiss compilation options:

Running on:

  • [ x] CPU
  • [ ] GPU

Interface:

  • [ ] C++
  • [x ] Python

Reproduction instructions

model = SentenceTransformer('all-MiniLM-L6-v2', device='cpu')  # Force CPU usage
print(f"Encoding query: {query}")
print(f"Size of RAG data: {len(rag_data)}")
import sys
print(f"Memory usage: {sys.getsizeof(rag_data)} bytes")
query_embedding = model.encode(query, show_progress_bar=False)
Size of RAG data: 272
Memory usage: 2520 bytes
/opt/miniconda3/envs/wapi/lib/python3.9/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown

FYI Memory usage: 83.7%

Any help would be appreciated!

jakubLangr avatar Oct 23 '24 16:10 jakubLangr

Hi @jakubLangr, can you clarify where faiss comes into play here?

bshethmeta avatar Oct 23 '24 17:10 bshethmeta

This issue is stale because it has been open for 7 days with no activity.

github-actions[bot] avatar Oct 31 '24 02:10 github-actions[bot]

Apologies, upon investigation it doesn't.

jakubLangr avatar Nov 05 '24 15:11 jakubLangr

@jakubLangr I had a similar problem, I just imported faiss and didn't do anything. How did you solve it

import faiss
import torch

from colpali_engine.models import ColQwen2

model_name = "vidore/colqwen2-v0.1"

model = ColQwen2.from_pretrained(
    model_name,
    torch_dtype=torch.bfloat16,
    device_map="mps",  # or "mps" if on Apple Silicon
).eval()
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 '

Process finished with exit code 139 (interrupted by signal 11:SIGSEGV)

whisper-bye avatar Nov 28 '24 07:11 whisper-bye