chore(cargo-toml): apply lto fat and codegen-units of one (#1651)

# What does this PR do?

I have suggested similar changes over at
https://github.com/huggingface/text-embeddings-inference/pull/201.

Here being my additional question, why `debug` is enabled during release
building? (hence I didn't add the flag to script things)

Applying the following optimizations:
- `lto` (link time optimizations) over all code (including dependencies)
- Using a single `codegen-unit` to apply optimizations within 1 code
unit at build time


## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the
other checks if that's the case).
- [ ] Did you read the [contributor
guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the
[forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes?
Here are the
[documentation
guidelines](https://github.com/huggingface/transformers/tree/main/docs),
and
[here are tips on formatting
docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?


## 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.

@OlivierDehaene OR @Narsil
This commit is contained in:
Christof Weickhardt 2024-04-12 12:34:13 +02:00 committed by GitHub
parent c2c98725f8
commit 9d8f21cace
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -17,5 +17,7 @@ homepage = "https://github.com/huggingface/text-generation-inference"
[profile.release]
debug = 1
incremental = true
lto = "off"
lto = "fat"
opt-level = 3
codegen-units = 1
panic = "abort"