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

Move status check in the memory pool to CPU #1557

Merged
merged 4 commits into from
Oct 3, 2024
Merged

Move status check in the memory pool to CPU #1557

merged 4 commits into from
Oct 3, 2024

Conversation

merrymercy
Copy link
Contributor

@merrymercy merrymercy commented Oct 3, 2024

We use self.mem_state = torch.ones((self.size + 1,), dtype=torch.bool, device="cuda") on GPU to indicate the availability of token slots in the memory pool. We call torch.nonzero to find the available slots.

However, this can be simplified by maintaining a simple 1d array of available slots.

@merrymercy merrymercy merged commit 4ae0969 into main Oct 3, 2024
4 of 10 checks passed
@merrymercy merrymercy deleted the cpu-mem branch October 3, 2024 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant