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

[Model] Support Cohere2ForCausalLM (Cohere R7B) #11203

Merged
merged 5 commits into from
Dec 16, 2024

Conversation

janimo
Copy link
Contributor

@janimo janimo commented Dec 14, 2024

Sliding window support as done in HuggingFace Transformers (>= 4.48.0.dev0) for the Cohere2ForCausalLM arch.

Copy link

👋 Hi! Thank you for contributing to the vLLM project.
Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can do one of these:

  • Add ready label to the PR
  • Enable auto-merge.

🚀

@mergify mergify bot added the documentation Improvements or additions to documentation label Dec 14, 2024
@janimo janimo marked this pull request as ready for review December 14, 2024 18:09
@DarkLight1337 DarkLight1337 changed the title Support for Cohere R7B model [Model] Support Cohere2ForCausalLM (Cohere R7B) Dec 15, 2024
@DarkLight1337
Copy link
Member

Could you point to the place where rotary embedding is disabled in v2? Looking at the HF implementation, I don't see why it should be disabled when sliding window is active.

Copy link
Member

@DarkLight1337 DarkLight1337 left a comment

Choose a reason for hiding this comment

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

Thanks for adding support for this!

@DarkLight1337 DarkLight1337 enabled auto-merge (squash) December 16, 2024 02:22
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Dec 16, 2024
@DarkLight1337
Copy link
Member

Please resolve the failing test.

auto-merge was automatically disabled December 16, 2024 05:47

Head branch was pushed to by a user without write access

@janimo janimo requested a review from ywang96 as a code owner December 16, 2024 05:47
@janimo
Copy link
Contributor Author

janimo commented Dec 16, 2024

I've added the model to the test list, but wonder if it's a problem if this arch is only in the unreleased version of transformers.

@DarkLight1337
Copy link
Member

Can you update tests/models/test_initialization.py::test_can_initialize to skip this model if the transformers version is too old?

@@ -11,6 +12,9 @@
@pytest.mark.parametrize("model_arch", HF_EXAMPLE_MODELS.get_supported_archs())
def test_can_initialize(model_arch):
model_info = HF_EXAMPLE_MODELS.get_hf_info(model_arch)
if (model_arch == "Cohere2ForCausalLM"
and transformers.__version__ < "4.48.0"):
Copy link
Member

Choose a reason for hiding this comment

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

The model is only available in transformers v4.48 which has not been released yet.

BKitor pushed a commit to BKitor/vllm that referenced this pull request Dec 30, 2024
@janimo janimo deleted the cohere-2 branch January 4, 2025 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation ready ONLY add when PR is ready to merge/full CI is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants