Skip to content

Commit

Permalink
Reinstate exl2 with tp (huggingface#1490)
Browse files Browse the repository at this point in the history
# What does this PR do?

<!--
Congratulations! You've made it this far! You're not quite done yet
though.

Once merged, your PR is going to appear in the release notes with the
title you set, so make sure it's a great title that fully reflects the
extent of your awesome contribution.

Then, please replace this with a description of the change and which
issue is fixed (if applicable). Please also include relevant motivation
and context. List any dependencies (if any) that are required for this
change.

Once you're done, someone will review your PR shortly (see the section
"Who can review?" below to tag some potential reviewers). They may
suggest changes to make the code even better. If no one reviewed your PR
after a week has passed, don't hesitate to post a new comment
@-mentioning the same persons---sometimes notifications get lost.
-->

<!-- Remove if not applicable -->

Fixes # (issue)


## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the
other checks if that's the case).
- [ ] Did you read the [contributor
guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the
[forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes?
Here are the
[documentation
guidelines](https://github.com/huggingface/transformers/tree/main/docs),
and
[here are tips on formatting
docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?


## Who can review?

Anyone in the community is free to review the PR once the tests have
passed. Feel free to tag
members/contributors who may be interested in your PR.

<!-- Your PR will be replied to more quickly if you can figure out the
right person to tag with @


@OlivierDehaene OR @Narsil

 -->
  • Loading branch information
Narsil authored and helena-intel committed Feb 1, 2024
1 parent 244723e commit f21e15e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,60 +16,60 @@
},
{
"id": 21017,
"logprob": -9.09375,
"logprob": -9.0859375,
"text": "ometric"
},
{
"id": 81,
"logprob": -0.25976562,
"logprob": -0.25830078,
"text": "_"
},
{
"id": 6009,
"logprob": -2.2148438,
"logprob": -2.1875,
"text": "mean"
},
{
"id": 26,
"logprob": -0.3010254,
"logprob": -0.30004883,
"text": "("
},
{
"id": 62,
"logprob": -5.6757812,
"logprob": -5.6171875,
"text": "L"
},
{
"id": 44,
"logprob": -3.0898438,
"logprob": -3.078125,
"text": ":"
},
{
"id": 1682,
"logprob": -0.6791992,
"logprob": -0.68066406,
"text": " List"
},
{
"id": 77,
"logprob": -0.38891602,
"logprob": -0.38745117,
"text": "["
},
{
"id": 1808,
"logprob": -0.92041016,
"logprob": -0.9453125,
"text": "float"
},
{
"id": 10794,
"logprob": -2.5390625,
"logprob": -2.5371094,
"text": "]):"
}
],
"seed": 0,
"tokens": [
{
"id": 284,
"logprob": 0.0,
"logprob": -0.051635742,
"special": false,
"text": "\n "
},
Expand All @@ -81,7 +81,7 @@
},
{
"id": 11665,
"logprob": -1.6005859,
"logprob": -1.2236328,
"special": false,
"text": " reduce"
},
Expand Down Expand Up @@ -159,7 +159,7 @@
},
{
"id": 203,
"logprob": -0.11968994,
"logprob": -0.12695312,
"special": false,
"text": "\n"
},
Expand Down
4 changes: 4 additions & 0 deletions server/text_generation_server/utils/gptq/exllamav2.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ def post_init(self, temp_dq):
"g_idx": self.g_idx,
}
temp_dq = temp_dq.get_scratch_slice(self.temp_dq_size())

# We NEED to keep a pointer on Python side, otherwise the garbage collector will mess with us,
# and `Memory access fault by GPU node-2` will EAT you.
self.temp_dq = temp_dq
self.q_handle = ext_make_q_matrix(self.q_tensors, temp_dq)

def forward(self, x, force_cuda=False):
Expand Down
12 changes: 6 additions & 6 deletions server/text_generation_server/utils/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
HAS_EXLLAMA = False
CAN_EXLLAMA = major >= 8
V2 = os.getenv("EXLLAMA_VERSION", "2") == "2"
if V2 and int(os.getenv("WORLD_SIZE", "1")) > 1:
V2 = False
log_once(
logger.warning,
"Disabling exllama v2 and using v1 instead because there are issues when sharding",
)
# if V2 and int(os.getenv("WORLD_SIZE", "1")) > 1:
# V2 = False
# log_once(
# logger.warning,
# "Disabling exllama v2 and using v1 instead because there are issues when sharding",
# )

if os.getenv("DISABLE_EXLLAMA") == "True":
HAS_EXLLAMA = False
Expand Down

0 comments on commit f21e15e

Please sign in to comment.