Open bohrium opened 1 month ago
cc @abuelnasr0 @gante - this line comes from #34037.
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
cc @bohrium no reply from the original author - would you be willing to make this PR? I think your reasoning is valid, and the performance improvement would be nice!
https://github.com/huggingface/transformers/blob/c2820c94916e34baf4486accae74760972183a2f/src/transformers/modeling_utils.py#L2473
covariance matrices are always symmetric. so use
torch.linalg.eigvalsh
. This caused major speedup (>100x in preprocessing and >2x in overall finetuning) in project I'm working on today.