From 7a62f74d7fec667e1664c824d5ce8897fdd95ec8 Mon Sep 17 00:00:00 2001 From: Christof Weickhardt Date: Fri, 12 Apr 2024 12:34:13 +0200 Subject: [PATCH] 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 --- Cargo.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 77a30f55..a9e7f1c8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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"