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

Force use_cache=True #496

Merged
merged 2 commits into from
Sep 2, 2023
Merged

Force use_cache=True #496

merged 2 commits into from
Sep 2, 2023

Conversation

borzunov
Copy link
Collaborator

@borzunov borzunov commented Sep 2, 2023

Petals supports only use_cache=True for inference.

However, we should not reject use_cache=False since it returns identical results (just forces the slower O(n^3) inference algorithm instead of the O(n^2) one).

I allow use_cache=False since some models use this setting for reasons unclear to me (see https://huggingface.co/garage-bAInd/Platypus2-70B-instruct/discussions/8), and this led to AssertionError before this PR.

@@ -40,7 +40,7 @@ install_requires =
transformers>=4.32.0,<5.0.0 # if you change this, please also change version assert in petals/__init__.py
speedtest-cli==2.1.3
pydantic>=1.10,<2.0 # 2.0 is incompatible with hivemind yet
hivemind @ git+https://github.com/learning-at-home/hivemind
hivemind==1.1.10.post2
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

They are currently identical.

@borzunov borzunov merged commit abd5477 into main Sep 2, 2023
9 checks passed
@borzunov borzunov deleted the force-use-cache-true branch September 2, 2023 18:57
borzunov added a commit that referenced this pull request Sep 2, 2023
This reverts a part of #496 and instead overrides `use_cache` in `LlamaConfig`s only (so the correct value is visible by HF `.generate()` as well).
d-popov pushed a commit to d-popov/petals-ai that referenced this pull request Sep 6, 2023
d-popov pushed a commit to d-popov/petals-ai that referenced this pull request Sep 6, 2023
This reverts a part of bigscience-workshop#496 and instead overrides `use_cache` in `LlamaConfig`s only (so the correct value is visible by HF `.generate()` as well).
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