-
Notifications
You must be signed in to change notification settings - Fork 30.3k
Benchmarking v2 GH workflows #40716
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
base: main
Are you sure you want to change the base?
Benchmarking v2 GH workflows #40716
Conversation
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. |
594ce6d
to
93d2a90
Compare
0b88e75
to
1deb38e
Compare
4857630
to
a985884
Compare
a985884
to
fdc4301
Compare
The workflow has been tested, and has a complete run here: |
cc @McPatate |
description: 'Model ID to benchmark (e.g., meta-llama/Llama-2-7b-hf)' | ||
required: false | ||
type: string | ||
default: '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we put a default for the model_id
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's no input provided here, it runs all the registered model, so an empty input is fine here. It's just for filtering purposes in case we need it for development.
description: 'HuggingFace Dataset to upload results to (e.g., "org/benchmark-results")' | ||
required: false | ||
type: string | ||
default: '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No default here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently all the vendors will have their own repos, so we can't really provide a sensible default here. (also wouldn't make sense to make it required in case push is disabled)
required: false | ||
type: string | ||
default: '' | ||
benchmark_repo_id: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this redundant with upload_to_hub
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the other has the wrong description, it's a boolean to toggle the upload on/off. Fixing it.
if [ -n "${{ inputs.model_id }}" ]; then | ||
args="$args --model-id '${{ inputs.model_id }}'" | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would this default to if not specified?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'll run all the registered benchmarks.
push: | ||
branches: | ||
- run-benchmarking-gh-actions* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't using labels be easier?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just mirrored here what the test pipelines offer on this front.
python run_benchmarks.py --upload-to-hf username/benchmark-results | ||
|
||
# Upload with a custom run ID for easy identification | ||
python run_benchmarks.py --upload-to-hf username/benchmark-results --run-id experiment_v1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we generate and print the run_id
if not provided by the user?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run_id
in that case becomes the benchmark_id generated earlier.
github_run_number = os.getenv("GITHUB_RUN_NUMBER") | ||
github_run_id = os.getenv("GITHUB_RUN_ID") | ||
if github_run_number and github_run_id: | ||
run_id = f"{github_run_number}-{github_run_id}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
github_run_number = os.getenv("GITHUB_RUN_NUMBER") | |
github_run_id = os.getenv("GITHUB_RUN_ID") | |
if github_run_number and github_run_id: | |
run_id = f"{github_run_number}-{github_run_id}" | |
github_run_number = os.getenv("GITHUB_RUN_NUMBER") | |
github_run_id = os.getenv("GITHUB_RUN_ID") | |
if github_run_number and github_run_id: | |
run_id = f"{github_run_number}-{github_run_id}" | |
else: | |
run_id = uuid.uuid4() |
wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or str(uuid.uuid4())[:8]
as you used below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The else case is handled here with the benchmark ID:
https://github.com/huggingface/transformers/pull/40716/files#diff-94fe5532c68b73efc8544ea11c0fa4d90a1d3e9266a8f8ccee2389752cea3d7cR475-R482
What does this PR do?
This PR is a follow-up to #40486 that adds the workflows and HF Datasets upload to start collecting data.
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.