Comments (8)
Hey Filippo! Also tagging @okhat as it's something we've been discussing and that we want to fix. The issue seems to be down to us using multiprocessing/forking, which hangs forever in certain environments.
The fix, or workaround, would be to simply not fork when there is a single GPU, which would cover most of the situations where the hanging is noticeable (assuming that it's very uncommon to train on multi-GPU in colab/other non-jupyter notebooks envs). I think upstreaming it to the main ColBERT repo would be ideal: https://github.com/stanford-futuredata/ColBERT . You can check out any of the main files (Indexer.py, Trainer.py, etc...) to get an idea of how the process pool is handled at the moment.
from ragatouille.
Would you have a sample notebook I could use to test the issue? Not that I am an expert in this ... but I could have a look at it at least.
from ragatouille.
The example training notebook is a good one! If you run it on Colab, it will hang once you get to the train()
call (when the processes fork). The goal would be that unless n_gpus is explicitly >1, it we shouldn't be using multiprocessing, which will eliminate the problem.
from ragatouille.
A quick update after an initial run of the example training notebook:
- I uploaded the
02-basic_training.ipynb
to Google Colab - I selected a T4 GPU
- I installed RAGatouille with
pip install ragatouille
- I restarted the session
The notebook does NOT hang while executing the cell with train()
but it completes after 20s seconds with this output:
#> Starting...
#> Joined...
Looking inside the .ragatouille
folder, I see these files:
%ls -altrh .ragatouille/colbert/none/2024-01/07/22.57.44/checkpoints/colbert
total 419M
drwxr-xr-x 3 root root 4.0K Jan 7 22:58 ../
drwxr-xr-x 2 root root 4.0K Jan 7 22:59 ./
-rw-r--r-- 1 root root 664 Jan 7 23:20 config.json
-rw-r--r-- 1 root root 419M Jan 7 23:20 model.safetensors
-rw-r--r-- 1 root root 1.2K Jan 7 23:20 tokenizer_config.json
-rw-r--r-- 1 root root 695 Jan 7 23:20 special_tokens_map.json
-rw-r--r-- 1 root root 227K Jan 7 23:20 vocab.txt
-rw-r--r-- 1 root root 695K Jan 7 23:20 tokenizer.json
-rw-r--r-- 1 root root 1.6K Jan 7 23:20 artifact.metadata
This seems to be correct, right?
from ragatouille.
@bclavie let me know if I am missing anything ... it seems to be working fine for me with a T4 GPU on Google Colab.
from ragatouille.
Hey @filippo82, this is strange, I'm still getting hangups 🤔. I will be trying to have a deeper look at some point to figure out exactly what's causing the hangups!
#> Starting...
#> Joined...
This output is also quite strange, as I'd expect it to get the normal main process prints (i.e. the training config and the loss at each training step)
Out of curiosity, does Indexing run fine on your end too?
from ragatouille.
Hi @bclavie, if you see the #> Joined...
message, then it means it finished the execution of that cell. You can find the additional logs by clicking on Runtime -> View runtime logs:
from ragatouille.
Oh I didn't realise it was a truncated output you were sharing, I thought you meant that was the whole output!
Colab still hangs when I try it, and it still hangs on Windows (though less important a problem), so there's something fishy going on 🤔 I'll try and dig to figure it out
from ragatouille.
Related Issues (20)
- Stuck at " Loading segmented_maxsim_cpp extension (set COLBERT_LOAD_TORCH_EXTENSION_VERBOSE=True for more info)..." HOT 1
- ImportError: cannot import name 'PromptTemplate' from 'llama_index' (unknown location)
- Compatibility with LangChain 0.2.0 HOT 3
- How to extract embeddings generated by Colbert? HOT 2
- Idea: Make CorpusProcessor (and splitter_fn / preprocessing_fn) to have access to metadata
- Embedding Model with Existing Index
- How to index collection using generator function?
- Training script is not working as is
- Making deletions will alter the collection.json file, hence the search function unusable because we access the collection using list indices.
- can't access my finetuned model
- Use base model or sentence transformer
- ragatouille requires a version of numpy uncompatible with python
- ValueError: RAGatouille is not installed. Please install it with `pip install ragatouille`.
- Documentation (API Reference): missing params in description tables
- Question -- Symmetric search
- How to use highly capable Decoder only models (LLMs) with RAGatouille -- is it even advisable?
- RuntimeError when indexing with FAISS
- RAGAtouille cpu only installation
- Typescript support of RAGatouille
- Question: rerank does not use index
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ragatouille.