-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[Core][Optimization] change python dict to pytorch tensor for blocks to swap #4659
Conversation
assert (num_lookahead_slots == 0 | ||
), "BlockSpaceManagerV1 does not support lookahead allocation" | ||
|
||
# CPU block -> GPU block. | ||
# dict is efficient in lookup `if cpu_block in mapping` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it a better approach if we do list(mapping.items())
in the worker layer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO the mapping semantics are better represented by dict[int, int], which is why I ask
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cadedaniel This is basically for performance. List append/extend is faster than Dict insert/update.
Continue after #4607 .