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 ONNX Exporter Issue. #29858

Merged

Conversation

AdamLouly
Copy link
Contributor

This PR addresses issue #29857

by removing the list conversion of top_x and idx in the Mixtral model code, which currently obstructs the ONNX exporter's functionality.

By removing this conversion, the Mixtral model can be exported successfully using the ONNX exporter, resolving the compatibility issue.

@AdamLouly
Copy link
Contributor Author

@thiagocrepaldi FYI.

Copy link

@thiagocrepaldi thiagocrepaldi left a comment

Choose a reason for hiding this comment

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

to expedite the code review, use git blame and find previous users who actually approved prs for changes in this file and add them to the code review.

Otherwise, the PR can be waiting for triage a long time

@ArthurZucker FYI

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

Thanks a lot!
Would love to merge this, we had to go with this because indexing is faster with list.

would you mind just running some benchmarks in generation?
Really sorry we don't have them yet in transformers but coming soon! (FYI @ydshieh )

@AdamLouly
Copy link
Contributor Author

Hey @ArthurZucker any updates on this?

@ydshieh
Copy link
Collaborator

ydshieh commented Apr 2, 2024

@AdamLouly

I think what @ArthurZucker 's comment is about

would you mind just running some benchmarks in generation?

on your own side to see if the PR and main have difference in the speed of generation for this model

@ArthurZucker
Copy link
Collaborator

On point @ydshieh . This is very core, and we added this change for a reason, we need a good reason to update, and make sure we are not affecting performances

@AdamLouly
Copy link
Contributor Author

@ArthurZucker, I actually found it faster when we use the changes in the PR.

Environment specs:
V100
Mixtral-8x7B-v0.1
2 Hidden layers
Loaded using torch_dtype=torch.float16

With the PR changes:
{'train_runtime': 182.1736, 'train_samples_per_second': 8.783, 'train_steps_per_second': 0.274, 'train_loss': 1.3467385864257813, 'epoch': 5.71}

Without PR changes:
{'train_runtime': 200.6888, 'train_samples_per_second': 7.973, 'train_steps_per_second': 0.249, 'train_loss': 1.3390922546386719, 'epoch': 5.71}

Thank you

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

Alright. Let's also update the qwen models as well then! (ctrl + f for this operation)

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@AdamLouly
Copy link
Contributor Author

I could not find anything like that on qwen models, are you sure it uses the same thing?

@ArthurZucker
Copy link
Collaborator

This here! :

qwen2 sorry

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

Thanks

@ArthurZucker ArthurZucker merged commit d704c0b into huggingface:main Apr 5, 2024
18 checks passed
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.

5 participants