Transformers: config.attention_head_size for structured pruning out-of-box

Created on 11 Nov 2020  路  2Comments  路  Source: huggingface/transformers

馃殌 Feature request

Motivation

for structured pruning like fastformers, https://github.com/microsoft/fastformers#pruning-models ,

we should modify the source code of transformers for `attention_head_size.

for example,

  1. configuration_bert.py
    https://github.com/microsoft/fastformers/blob/main/src/transformers/configuration_bert.py#L128

  2. modeling_bert.py
    https://github.com/microsoft/fastformers/blob/main/src/transformers/modeling_bert.py#L192
    https://github.com/microsoft/fastformers/blob/main/src/transformers/modeling_bert.py#L263

is it possible to set attention_head_size from outside(config.json) ?

Your contribution

Most helpful comment

@dsindex FYI, I am working on creating a PR including this feature for the effort of #8083 .

All 2 comments

@dsindex FYI, I am working on creating a PR including this feature for the effort of #8083 .

@ykim362 great! closing issue here.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

siddsach picture siddsach  路  3Comments

hsajjad picture hsajjad  路  3Comments

iedmrc picture iedmrc  路  3Comments

yspaik picture yspaik  路  3Comments

HansBambel picture HansBambel  路  3Comments