Skip to content

Commit

Permalink
fix erase
Browse files Browse the repository at this point in the history
  • Loading branch information
irexyc committed Dec 18, 2023
1 parent 20d8f47 commit 9f491a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/turbomind/models/llama/SequenceManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ bool SequenceManager::Contains(uint64_t id)
return sequences_.find(id) != sequences_.end();
}

void SequenceManager::Erase(std::map<uint64_t, Sequence>::iterator it)
void SequenceManager::Erase(std::map<uint64_t, Sequence>::iterator& it)
{
auto& seq = it->second;
if (seq.status == Sequence::kCached) {
Expand All @@ -72,7 +72,7 @@ void SequenceManager::Erase(std::map<uint64_t, Sequence>::iterator it)
UpdateAndSetUnlock(seq);
}
freed_.insert(freed_.end(), seq.blocks.begin(), seq.blocks.end());
sequences_.erase(it);
it = sequences_.erase(it);
}

bool SequenceManager::Erase(uint64_t id)
Expand Down
2 changes: 1 addition & 1 deletion src/turbomind/models/llama/SequenceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class SequenceManager {
}

private:
void Erase(std::map<uint64_t, Sequence>::iterator it);
void Erase(std::map<uint64_t, Sequence>::iterator& it);

void CommitUnlockAndFree();

Expand Down

0 comments on commit 9f491a8

Please sign in to comment.