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

Add mixtral support #12

Merged
merged 6 commits into from
Feb 21, 2024
Merged

Add mixtral support #12

merged 6 commits into from
Feb 21, 2024

Conversation

Vahe1994
Copy link
Owner

@Vahe1994 Vahe1994 commented Feb 8, 2024

Added Mixtral support

main.py Outdated
for sublayer_name in aq_handlers.keys():
print(f"Quantizing module {sublayer_name} of layer {layer_index}")
if "mixtral" in model.config.model_type.lower() and args.mix_compression:
print("mix_compression")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
print("mix_compression")

main.py Outdated
for sublayer_name in aq_handlers.keys():
print(f"Quantizing module {sublayer_name} of layer {layer_index}")
if "mixtral" in model.config.model_type.lower() and args.mix_compression:
print("mix_compression")
assert args.nbits_per_codebook == 16
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nitpicking: this looks like a very specific configuration for a general option (--mix_compression)

if you have time, can you please

  • assert that model type is mixtral
  • double the number of codebooks for self-attn layers
  • use standard number of codebooks for non self-attn layers

If you don't have time, please

  1. merge this PR
  2. create an issue, saying
PR https://github.com/Vahe1994/AQLM/pull/12/ adds a very specific configuration for--mix_compression.
It would be great to generalize it to something more generic.

For instance, we can
- assert that model type is mixtral
- double the number of codebooks for self-attn layers
- use standard number of codebooks for non self-attn layers

Copy link
Owner Author

Choose a reason for hiding this comment

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

will do, thanks!

Copy link
Collaborator

@justheuristic justheuristic left a comment

Choose a reason for hiding this comment

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

LGTM (with optional requsts in the comments)

@Vahe1994 Vahe1994 merged commit 8f75dcd into main Feb 21, 2024
2 checks passed
@Vahe1994 Vahe1994 deleted the mixtral_support branch February 21, 2024 17:50
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.

2 participants