Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bugs of Outofmemory error #1269

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion FlagEmbedding/inference/embedder/decoder_only/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def encode_single_device(
flag = True
except RuntimeError as e:
batch_size = batch_size * 3 // 4
except torch.OutofMemoryError as e:
except torch.cuda.OutOfMemoryError as e:
batch_size = batch_size * 3 // 4

# encode
Expand Down
4 changes: 2 additions & 2 deletions FlagEmbedding/inference/embedder/decoder_only/icl.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def encode_queries_single_device(
flag = True
except RuntimeError as e:
batch_size = batch_size * 3 // 4
except torch.OutofMemoryError as e:
except torch.cuda.OutOfMemoryError as e:
batch_size = batch_size * 3 // 4

# encode
Expand Down Expand Up @@ -519,7 +519,7 @@ def encode_single_device(
flag = True
except RuntimeError as e:
batch_size = batch_size * 3 // 4
except torch.OutofMemoryError as e:
except torch.cuda.OutOfMemoryError as e:
batch_size = batch_size * 3 // 4

# encode
Expand Down
2 changes: 1 addition & 1 deletion FlagEmbedding/inference/embedder/encoder_only/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def encode_single_device(
flag = True
except RuntimeError as e:
batch_size = batch_size * 3 // 4
except torch.OutofMemoryError as e:
except torch.cuda.OutOfMemoryError as e:
batch_size = batch_size * 3 // 4

# encode
Expand Down
2 changes: 1 addition & 1 deletion FlagEmbedding/inference/embedder/encoder_only/m3.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ def _process_colbert_vecs(colbert_vecs: np.ndarray, attention_mask: list):
flag = True
except RuntimeError as e:
batch_size = batch_size * 3 // 4
except torch.OutofMemoryError as e:
except torch.cuda.OutOfMemoryError as e:
batch_size = batch_size * 3 // 4

# encode
Expand Down
2 changes: 1 addition & 1 deletion FlagEmbedding/inference/reranker/decoder_only/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def compute_score_single_gpu(
flag = True
except RuntimeError as e:
batch_size = batch_size * 3 // 4
except torch.OutofMemoryError as e:
except torch.cuda.OutOfMemoryError as e:
batch_size = batch_size * 3 // 4

dataset, dataloader = None, None
Expand Down
2 changes: 1 addition & 1 deletion FlagEmbedding/inference/reranker/decoder_only/layerwise.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def compute_score_single_gpu(
flag = True
except RuntimeError as e:
batch_size = batch_size * 3 // 4
except torch.OutofMemoryError as e:
except torch.cuda.OutOfMemoryError as e:
batch_size = batch_size * 3 // 4

dataset, dataloader = None, None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def compute_score_single_gpu(
flag = True
except RuntimeError as e:
batch_size = batch_size * 3 // 4
except torch.OutofMemoryError as e:
except torch.cuda.OutOfMemoryError as e:
batch_size = batch_size * 3 // 4

all_scores = []
Expand Down
2 changes: 1 addition & 1 deletion FlagEmbedding/inference/reranker/encoder_only/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def compute_score_single_gpu(
flag = True
except RuntimeError as e:
batch_size = batch_size * 3 // 4
except torch.OutofMemoryError as e:
except torch.cuda.OutOfMemoryError as e:
batch_size = batch_size * 3 // 4

all_scores = []
Expand Down
Loading