해야할 것 poc
chromadb file to huggingface using python dataset
chroma local to server
batch processing poc with 10 size batch?
- gpu encoding instread of cpu
faiss gpu
compile 안되서 포기
hf encoding gpu
일단 모델이 gpu 둘다 되는 건 확인함
Vessl 문제
Vessl gpu자원이랑 memory 500기가로 넉넉하게 줘서 바뀌었나 싶다니 문제가 많다
- 1달 gpu 사용 제한 있다는 점
- 데이터센터 맞나 의심될 정도로 인터넷 속도가 너무 느림
- max 72시간 돌리거나 suspend하면 home 빼고 초기화되는 문제 (cpu image도)
- 외부에서 접근시 vpn 연결이 귀찮음
- dataset upload해둬도 workspace mount 못하고 또 각자 인스턴스에 다운로드해야함
인터넷 느려서 데이터 다운받는거랑 pytorch 오류로 첫날은 하나도 못돌리다가
pip uninstall pytorch -y pip uninstall pytorch -y pip install pytorch
이렇게 해결했다 심지어 이슈에서 제안하는 해결방안
속도도 느림
어쨋든 그 뒤에 돌렸는데
Saving 295000th passage from 8175744 to data/chroma (5673.71s) Saving 300000th passage from 8180744 to data/chroma (5785.82s) Saving 305000th passage from 8185744 to data/chroma (5899.33s) Saving 310000th passage from 8190744 to data/chroma (6010.44s) Saving 315000th passage from 8195744 to data/chroma (6128.20s) Saving 320000th passage from 8200744 to data/chroma (6240.40s) Saving 325000th passage from 8205744 to data/chroma (6349.55s) Saving 330000th passage from 8210744 to data/chroma (6470.14s) Saving 335000th passage from 8215744 to data/chroma (6593.74s) Saving 340000th passage from db id 8220744 to data/chroma (13.95s) Saving 345000th passage from db id 8225744 to data/chroma (146.50s) Saving 350000th passage from db id 8230744 to data/chroma (365.76s)
index migration 시간도 오래 걸리고 메모리 올리는 데도 너무 시간 걸린다
cpu 느린거같아서 보니 1.5ghz로 돌아간다… 왜이렇게 낮춰둔거지

메모리 제한 문제
그리고터진 문제는 vpn이 시간제한있어서 끊긴다는 점 프로세스 ssh로 돌려둔거 다 강제종료되서 pm2같은 걸로 background에서 python실행해둬야할듯 pm2 python
막상 여러개 돌리니까 메모리 부족으로 process kill 되는데 찾아보니
cat /sys/fs/cgroup/memory/memory.limit_in_bytes 64424509440
vessl이 노드를 여러 유저가 공유해서 쓰는 cgroup을 쓰는걸로 보이는데 (혹은 컨태이너 내부?) 체크해보니 64기가밖에 안된다…
huggingface to chroma기능구현
index_ctx.dataset 함수 batch processing streaem으로 from huggingface to chroma로 처리하도록 구현
multilingual e5로 시작해두긴 했는데
query: 를 prefix로 넣어야 해서 찜찜하다{ "apps": [ { "name": "index_ctx1", "script": "/root/ReSRer/index_ctx.py", "args": [ "faiss", "--start_index=335000", "--end_index=340000" ], "wait_ready": false, "autorestart": false, "max_restarts": 5, "interpreter": "/root/ReSRer/.venv/bin/python" } ] }
ChromaDB 공유
이 모든 결과로 하려는 건 persist storage를 공유가능하게 바꿀수 있냐인게 가능은 하다는듯?
공식문서가 너무 대충인게 chroma는 문제
Vessl Run
기본 마운트까지 해주고 레포 클론해주는 친구 발견
experiment 로 아웃풋 내야할듯
GPU 사용 문제
RuntimeError: Expected all tensors to be on the same device, but found at least two devices
근데 문제가 wiki 데이터가 너무 크다는 것
3090에 최대배치 17개 들어가고 5~6초마다 처리해서 사실 1초마다 3개씩인데 그러면 풀로 돌려도 70만개밖에 처리못함

한달에 300시간 나용 가능하니까

그래도 최소 3달 잡아야할듯
이게 스트리밍 문제인지 cpu tokenizer때문인지 확실하지는 않으나 gpu한꺼번에 2개밖에 못쓰는 vessl최대 제한으로서는 다 처리가 힘들다
일단 streaming빼고 한번에 받아와보기

CPU instance
cpu group은 또 40기가 리미트라 dpr faiss index로드 못해서 못돌림 하..
gpu instance따로 돌리긴 부족해서 2개 돌릴 여유도 없어서 gcp로 faiss해야할듯
완료
Seonglae Cho