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 dummy cache allocation #574

Merged
merged 3 commits into from
Apr 16, 2024
Merged

Fix dummy cache allocation #574

merged 3 commits into from
Apr 16, 2024

Conversation

artek0chumak
Copy link
Collaborator

Fix allocation of the dummy key_value cache. It's not used in actual computations, but torch checkers require them to be on the correct device.

@@ -206,7 +206,7 @@ def measure_compute_rps(
block = block.to(dtype)
block = convert_block(block, 0, config, tensor_parallel_devices, device, quant_type=quant_type, freeze=True)

cache = (DUMMY_KEY_PAST.to(dtype), DUMMY_KEY_PAST.to(dtype))
cache = (DUMMY_KEY_PAST.to(dtype).to(device), DUMMY_KEY_PAST.to(dtype).to(device))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's replace chained calls by a single call to .to

Copy link
Collaborator

@justheuristic justheuristic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, sorry i took so long

@artek0chumak artek0chumak merged commit 30f522d into main Apr 16, 2024
11 checks passed
@artek0chumak artek0chumak deleted the fix_cache_alloc branch April 16, 2024 17:25
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.

None yet

3 participants