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

Why only 4 layers? #95

Open
VincentXWD opened this issue Sep 7, 2024 · 0 comments
Open

Why only 4 layers? #95

VincentXWD opened this issue Sep 7, 2024 · 0 comments

Comments

@VincentXWD
Copy link

Hello developers,
I'm inspecting smoothquant and use the script below to check the quantized model parameter sizes:

from smoothquant.opt import Int8OPTForCausalLM
from transformers.models.opt.modeling_opt import OPTForCausalLM
import torch

model_name = "mit-han-lab/opt-2.7b-smoothquant"

model_smoothquant = Int8OPTForCausalLM.from_pretrained(model_name, device_map='auto')

for name, param in model_smoothquant.named_parameters():
    print(f"Parameter Name: {name}, Parameter Shape: {param.shape}")

I noticed that there are only 4 layers collected by the inner-loop.

Parameter Name: model.decoder.embed_tokens.weight, Parameter Shape: torch.Size([50272, 2560])
Parameter Name: model.decoder.embed_positions.weight, Parameter Shape: torch.Size([2050, 2560])
Parameter Name: model.decoder.final_layer_norm.weight, Parameter Shape: torch.Size([2560])
Parameter Name: model.decoder.final_layer_norm.bias, Parameter Shape: torch.Size([2560])

Could some one explain this phenomenon? Thanks!

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

No branches or pull requests

1 participant