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

feat: add benchmarks_entrypoint.py #34495

Merged
merged 14 commits into from
Dec 18, 2024
Merged

feat: add benchmarks_entrypoint.py #34495

merged 14 commits into from
Dec 18, 2024

Conversation

McPatate
Copy link
Member

Adding benchmarks_entrypoint.py file, which will be run from the benchmarks CI.

This python script will list all python files from the benchmark/ folder and run the included run_benchmark function, allowing people to add new benchmarks scripts.

@McPatate McPatate requested a review from ArthurZucker October 29, 2024 17:04
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@McPatate McPatate force-pushed the feat/allow_new_benchmarks branch 2 times, most recently from 41487ff to 49dcf70 Compare October 29, 2024 17:45
Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

Very nice!

benchmark/benchmarks_entrypoint.py Show resolved Hide resolved
@@ -82,7 +40,7 @@ def collect_metrics(benchmark_id, continue_metric_collection):
conn.close()


def run_benchmark(branch: str, commit_id: str, commit_msg: str, num_tokens_to_generate=100):
def run_benchmark(logger: Logger, branch: str, commit_id: str, commit_msg: str, num_tokens_to_generate=100):
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there a way to only pass the logger and a class that wrapps around your continue_metric_collection .
This way the only thing people need when adding a new file with run_benchmark is:

  1. Call start() on the class
  2. compute some stuff
  3. call .record() (for example) which take the dict of inputs, and adds them to the data, commit and close!

completely up to debate, try to find the simplest way to do it! 🤗

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes that's probably the best path forward! Will iterate and let you know when I have something nicer

Copy link
Collaborator

Choose a reason for hiding this comment

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

perfect thanks

Copy link
Member Author

Choose a reason for hiding this comment

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

lmk if the changes look good to you

@McPatate McPatate force-pushed the feat/allow_new_benchmarks branch from f7d0286 to 796affb Compare October 31, 2024 16:50
Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

Changes looks great, good to go when you have the pannel thing sorted out! or written in the doc how to handle when you only have say 3 metrics!

benchmark/benchmarks_entrypoint.py Show resolved Hide resolved
@McPatate
Copy link
Member Author

McPatate commented Nov 5, 2024

I'll update the README and then we can merge!

@McPatate McPatate force-pushed the feat/allow_new_benchmarks branch from 3190b19 to 9c493ff Compare December 17, 2024 17:49
@McPatate McPatate force-pushed the feat/allow_new_benchmarks branch from afa207f to c2d4b82 Compare December 18, 2024 17:54
@McPatate McPatate merged commit 9a94dfe into main Dec 18, 2024
11 of 12 checks passed
@McPatate McPatate deleted the feat/allow_new_benchmarks branch December 18, 2024 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants