Skip to content

Add Falcon-7B HuggingFace model#1758

Open
petermcaughan wants to merge 10 commits intopytorch:mainfrom
petermcaughan:falcon-7b
Open

Add Falcon-7B HuggingFace model#1758
petermcaughan wants to merge 10 commits intopytorch:mainfrom
petermcaughan:falcon-7b

Conversation

@petermcaughan
Copy link
Copy Markdown

This PR adds two features to torchbenchmark:

  1. Include tiiuae/falcon-7b model from HuggingFace in torchbenchmark suite.
  2. Include code path to pass arguments from model's __init__.py into model constructor during benchmarking. Running Falcon-7B in HuggingFace requires the parameter trust_remote_code to be passed.
    • There are two files that are executed when Falcon is loaded: configuration_RW and modelling_RW that both contain what seem to be safe code related to modeling specifics.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

Hi @petermcaughan!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!


class Model(HuggingFaceModel):
task = NLP.LANGUAGE_MODELING
DEFAULT_TRAIN_BSIZE = 4
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we have a link to upstream code that reference the train batch size?

Copy link
Copy Markdown
Author

@petermcaughan petermcaughan Jul 10, 2023

Choose a reason for hiding this comment

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

The Falcon README shows the training batch size to be 2304 [link] - updated comment to reference this. This seems prohibitive to run in testing suite though, so I kept the default size to 4.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for making the reference! We should use the per-device batch size here. In the link it mentioned 2304 batch size on 384 A100 GPUs, so per-GPU batch size should be 6. Can you please update it to 6 and add the link ( https://huggingface.co/tiiuae/falcon-7b/blob/main/README.md#:~:text=Batch%20size,tokens%20ramp%2Dup) as the reference?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks for the clarification! Updated the size and the reference link.

cclauss pushed a commit to cclauss/benchmark that referenced this pull request Jan 22, 2025
* Rewrite complexity_test to use (hardcoded) manual time

This test is fundamentally flaky, because it tried to read tea leafs,
and is inherently misbehaving in CI environments,
since there are unmitigated sources of noise.

That being said, the computed Big-O also depends on the `--benchmark_min_time=`

Fixes google/benchmark#272

* Correctly compute Big-O for manual timings. Fixes pytorch#1758.

* complexity_test: do more stuff in empty loop

* Make all empty loops be a bit longer empty

Looks like on windows, some of these tests still fail,
i guess clock precision is too small.
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