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 bugs in _choose_num_blocks() added in #346 #354

Merged
merged 3 commits into from
Jul 14, 2023
Merged

Conversation

borzunov
Copy link
Collaborator

@borzunov borzunov commented Jul 14, 2023

Fix bugs from #346.

@@ -249,12 +250,17 @@ def _choose_num_blocks(self) -> int:
# Estimate of GPU memory used in rpc_backward (2 GiB for BLOOM, proportional for other models)
autograd_memory = 2 * gib * num_devices / 14336 * self.block_config.hidden_size

if adapters:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

adapters is not defined

# Delay import of petals.utils.peft to avoid unnecessary import of bitsandbytes
from petals.utils.peft import estimate_adapter_memory_per_block

adapter_memory_per_block = estimate_adapter_memory_per_block(
self.block_config, self.torch_dtype, self.adapters, self.cache_dir
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

cache_dir is a kwarg-only. Also, we need all the rest of disk cache args

@borzunov borzunov changed the title Fix _choose_num_blocks() Fix bugs in _choose_num_blocks() added in #346 Jul 14, 2023
@borzunov borzunov merged commit 9703358 into main Jul 14, 2023
7 checks passed
@borzunov borzunov deleted the fix-choose-num-blocks branch July 14, 2023 18:33
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

1 participant