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 Mixtral-related issues #570

Merged
merged 18 commits into from
Apr 10, 2024
Merged

Fix Mixtral-related issues #570

merged 18 commits into from
Apr 10, 2024

Conversation

artek0chumak
Copy link
Collaborator

@artek0chumak artek0chumak commented Apr 8, 2024

This PR fixes problems related to #569:

  • block initialization
  • throughput calculation and cache usage
  • mixtral in tests

BS is removed for Mixtral and Llama for now. Those models use DynamicCache, which requires special function to change: (see https://github.com/huggingface/transformers/blob/main/src/transformers/cache_utils.py#L161)

@artek0chumak artek0chumak changed the title Fix issue #569 related to Mixtral Fix Mixtral-related issues Apr 8, 2024
@artek0chumak artek0chumak mentioned this pull request Apr 9, 2024
2 tasks
@artek0chumak artek0chumak marked this pull request as ready for review April 10, 2024 05:38
src/petals/server/block_utils.py Outdated Show resolved Hide resolved
src/petals/server/throughput.py Outdated Show resolved Hide resolved
tests/test_full_model.py Outdated Show resolved Hide resolved
artek0chumak and others added 3 commits April 10, 2024 10:32
Co-authored-by: Max Ryabinin <mryabinin0@gmail.com>
@@ -141,6 +141,10 @@ def test_sampling(tokenizer, model, ref_model, max_new_tokens=10):
), f"Sampling is not identical to HF with {options=}, {multiple_calls=}, {inputs.shape=}"


@pytest.mark.skipif(
MODEL_NAME.lower().find("bloom") == -1,
reason="Mixtral and Llama uses DynamicCache, which can change based on beam search choices",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
reason="Mixtral and Llama uses DynamicCache, which can change based on beam search choices",
reason="Mixtral and Llama use DynamicCache, which can change based on beam search choices",

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@@ -141,6 +141,10 @@ def test_sampling(tokenizer, model, ref_model, max_new_tokens=10):
), f"Sampling is not identical to HF with {options=}, {multiple_calls=}, {inputs.shape=}"


@pytest.mark.skipif(
MODEL_NAME.lower().find("bloom") == -1,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
MODEL_NAME.lower().find("bloom") == -1,
"bloom" not in MODEL_NAME.lower(),

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@justheuristic justheuristic merged commit d6f4f80 into main Apr 10, 2024
11 checks passed
@justheuristic justheuristic deleted the fix_mixtral branch April 10, 2024 11:49
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.

3 participants