Skip to content

Commit

Permalink
Dorado Correct now uses a smaller auto-calculated batch size for GPU …
Browse files Browse the repository at this point in the history
…inference to avoid Torch issues related to not-enough-memory.
  • Loading branch information
John Stone committed Jul 31, 2024
1 parent 2a61e34 commit 01c39db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dorado/read_pipeline/CorrectionNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,10 +453,11 @@ CorrectionNode::CorrectionNode(const std::string& fastq,
#endif
for (size_t d = 0; d < devices.size(); d++) {
const auto& dev = devices[d];
const float batch_factor = (utils::starts_with(device, "cuda")) ? 0.4f : 0.8f;
for (int i = 0; i < infer_threads; i++) {
int device_batch_size = batch_size;
if (batch_size == 0) {
device_batch_size = calculate_batch_size(dev, 0.8f);
device_batch_size = calculate_batch_size(dev, batch_factor);
if (device_batch_size == 0) {
throw std::runtime_error("Insufficient memory to run inference on " + dev);
}
Expand Down

0 comments on commit 01c39db

Please sign in to comment.