Skip to content

CI job. Gpt awq 4 #2665

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

Merged
merged 10 commits into from
Oct 18, 2024
Merged

CI job. Gpt awq 4 #2665

merged 10 commits into from
Oct 18, 2024

Conversation

Narsil
Copy link
Collaborator

@Narsil Narsil commented Oct 18, 2024

What does this PR do?

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,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? 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, and
    here are tips on formatting docstrings.
  • 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.

@@ -321,7 +325,7 @@ def get_weights_row(self, weights: Weights, prefix: str):
if g_idx is not None:
if (
not torch.equal(
g_idx.cpu(),
(g_idx - g_idx[0]).cpu(),
Copy link
Member

Choose a reason for hiding this comment

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

This block needs a comment what is computed here. The old code was already difficult to read, but I the way I read it is that it is checking whether g_idx incrementing indices by group (so there is a g_idx, but no activation sorting).

But what is this subtraction doing?

Copy link
Member

Choose a reason for hiding this comment

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

I think it's subtracting the first index, because say we have g_idx with groupsize = 2

[0 0 1 1 2 2 3 3]

If we have two shards, then it gets broken up into

[0 0 1 1] [2 2 3 3]

And then the check fails for the second shard. Subtracting g_idx[0] then changes this into

[0 0 1 1] [0 0 1 1]

Making the check valid. But there should be a comment to make it easier to understand without knowing all the context.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

YEs this is the core idea of the fix. The logic was only working on TP=1, it's now working on TP>1 (to detect that g_idx is redundant and can be safely ignored)

Copy link
Member

Choose a reason for hiding this comment

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

Yeah makes sense, would be a good to have a short comment here though so that future-us don't have to re-parse what is going on here.

@Narsil Narsil merged commit 153ff37 into main Oct 18, 2024
8 checks passed
@Narsil Narsil deleted the gpt_awq_4 branch October 18, 2024 15:55
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