Skip to content

Delete hidden_size and num_attention_heads modification in a config #198

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

titaiwangms
Copy link
Collaborator

Previous to this PR, the config is modified to smaller (not significant smaller) to speed up the model run/export on the benchmark. However, there is a hard requirements on LLMs that "embed_dim must be divisible by num_heads" (e.g.: https://github.com/huggingface/transformers/blob/main/src/transformers/models/gpt2/modeling_gpt2.py#L175-L178).

This PR deletes the lines of code that modifies those attributes, because (1) reduce num_layers should be enough for speedy model run/export, (2) conditionally adjust these attributes might affect model performance (deviate from its design)

@titaiwangms titaiwangms requested a review from xadupre August 8, 2025 22:03
@titaiwangms titaiwangms requested a review from sdpython August 8, 2025 22:14
Copy link

@gramalingam gramalingam left a comment

Choose a reason for hiding this comment

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

LGTM

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