Coder Social home page Coder Social logo

Comments (23)

okhat avatar okhat commented on July 23, 2024

This command seems like the initial indexing step, not the faiss step. Is that right?

I would run -m colbert.index from outside the colbert/ subdirectory to make sure the imports work. Also, don't pass local_rank. Basically, please follow the template in the README.

Let me know if issues still persist!

from colbert.

okhat avatar okhat commented on July 23, 2024

Another orthogonal thing is: do you want to index queries.tsv? Typically you'd want to index passages.

from colbert.

JamesDeAntonis avatar JamesDeAntonis commented on July 23, 2024

yes, they're passages. The file is under a different name and i mistakenly put queries.tsv instead of passages.tsv

from colbert.

JamesDeAntonis avatar JamesDeAntonis commented on July 23, 2024

unfortunately, they still persist

what do you mean by initial indexing step?

from colbert.

okhat avatar okhat commented on July 23, 2024

I'm assuming this is the first step of indexing (before colbert.index_faiss is used).

If so, here's a sample script that's modified based on your command above:

CUDA_VISIBLE_DEVICES="0,1" OMP_NUM_THREADS=1 \
python -m torch.distributed.launch --nproc_per_node=2 -m \
colbert.index --root $PWD/experiments/ --amp --doc_maxlen 180 --mask-punctuation --bsize 256 \
--checkpoint out-of-the-box-model.pt \
--collection passages.tsv \
--index_root /faiss --index_name INDEX \
--root $PWD/experiments/ --experiment out_of_the_box \

Just to be sure: does this work for you?

from colbert.

JamesDeAntonis avatar JamesDeAntonis commented on July 23, 2024

(this the full error, btw)
Screen Shot 2021-05-07 at 8 24 18 AM

from colbert.

JamesDeAntonis avatar JamesDeAntonis commented on July 23, 2024

oh, and yes it's the first step (encoding)

from colbert.

JamesDeAntonis avatar JamesDeAntonis commented on July 23, 2024

I get this now (slightly different and may be a step in the right direction)
Uploading Screen Shot 2021-05-07 at 9.06.14 AM.png…

from colbert.

JamesDeAntonis avatar JamesDeAntonis commented on July 23, 2024

I get this now (slightly different and may be a step in the right direction)
Screen Shot 2021-05-07 at 9 06 14 AM

from colbert.

okhat avatar okhat commented on July 23, 2024

Hmm this is strange. Could you run with one GPU in distributed mode and see if that works?

CUDA_VISIBLE_DEVICES="0" OMP_NUM_THREADS=1 \
python -m torch.distributed.launch --nproc_per_node=1 -m \
colbert.index --root $PWD/experiments/ --amp --doc_maxlen 180 --mask-punctuation --bsize 256 \
--checkpoint out-of-the-box-model.pt \
--collection passages.tsv \
--index_root /faiss --index_name INDEX \
--root $PWD/experiments/ --experiment out_of_the_box \

from colbert.

JamesDeAntonis avatar JamesDeAntonis commented on July 23, 2024

it didn't :/

from colbert.

okhat avatar okhat commented on July 23, 2024

Okay. What about single-GPU mode?

CUDA_VISIBLE_DEVICES="0" python -m \
colbert.index --root $PWD/experiments/ --amp --doc_maxlen 180 --mask-punctuation --bsize 256 \
--checkpoint out-of-the-box-model.pt \
--collection passages.tsv \
--index_root /faiss --index_name INDEX \
--root $PWD/experiments/ --experiment out_of_the_box \

from colbert.

JamesDeAntonis avatar JamesDeAntonis commented on July 23, 2024

It's hanging right now, so might be working!

from colbert.

JamesDeAntonis avatar JamesDeAntonis commented on July 23, 2024

ah yes, getting another error that I have already seen, and then it continues to hang (i saw this yesterday):
Screen Shot 2021-05-07 at 9 13 55 AM

from colbert.

okhat avatar okhat commented on July 23, 2024

Right, so your passages must be in a TSV file whose first column is the passage ID.

Passage ID must be equal to the line number, starting at 0. You can start at 1 also, but then line zero needs to have a header: id \t text

from colbert.

JamesDeAntonis avatar JamesDeAntonis commented on July 23, 2024

Oh, mine start at 1. first line is 1\tsome passage

from colbert.

JamesDeAntonis avatar JamesDeAntonis commented on July 23, 2024

Great to know! I'll fix that

from colbert.

okhat avatar okhat commented on July 23, 2024

Okay, so single-GPU encoding will work.

For debugging the multi-GPU setup, could you run the following in a Python terminal?

import torch
torch.cuda.device_count()

from colbert.

JamesDeAntonis avatar JamesDeAntonis commented on July 23, 2024

1

from colbert.

okhat avatar okhat commented on July 23, 2024

Ah, so this all makes sense then. Either you only have one GPU or pytorch is not able to detect your other GPUs.

from colbert.

JamesDeAntonis avatar JamesDeAntonis commented on July 23, 2024

(I'm not sure why that is, by the way. I have two GPUs)

from colbert.

JamesDeAntonis avatar JamesDeAntonis commented on July 23, 2024

But yeah that makes sense, I'll look into that. Thank you so much for your prompt replies! Very helpful

from colbert.

okhat avatar okhat commented on July 23, 2024

Looks resolved?

Closing but feel free to reopen if I can help with other issues!

from colbert.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.