huggingface / transformers

🤗 Transformers: State-of-the-art Machine Learning for Pytorch, TensorFlow, and JAX.
https://huggingface.co/transformers
Apache License 2.0
133.7k stars 26.71k forks source link

rfc: new benchmark tool #9893

Open stas00 opened 3 years ago

stas00 commented 3 years ago

This issue is to collect notes and ideas on creating a new benchmarking tool.

This is not about the other speed/memory regression project we have been discussing elsewhere.

This is about integration and various comparisons that we need to run in order to give users the best advice on how to deploy transformers in the most efficient way.

Please share the comments ideas/suggestions/concerns/needs, and I will compile them here.

bhadreshpsavani commented 3 years ago

I was thinking about one feature if possible,

How about when we run an example script a benchmarking script is automatically run and store the results in one file if the user passes an optional argument.

When the user uploads the model on the model hub we can directly sort the model based on benchmarking results file.

stas00 commented 3 years ago

All data files on the model hub for the same model arch will give the same speed performance results, since they are just data points.

Therefore it's the model code that needs to be benchmarked (and the trainer if there is more than one).

And given that currently we have only one model implementation of each there is nothing to compare it to.

The main idea of this issue is to do regression testing, to ensure that we don't accidentally make models slower while changing the code. For an example of this happening, please see: https://github.com/huggingface/transformers/pull/11218