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

Compile guide for Fabric #19330

Merged
merged 26 commits into from
Jan 31, 2024
Merged

Compile guide for Fabric #19330

merged 26 commits into from
Jan 31, 2024

Conversation

awaelchli
Copy link
Contributor

@awaelchli awaelchli commented Jan 23, 2024

What does this PR do?

Part of #18852

Adds a guide for speeding up models with torch.compile and advice in combination with Fabric.


📚 Documentation preview 📚: https://pytorch-lightning--19330.org.readthedocs.build/en/19330/

cc @Borda @carmocca @justusschock @awaelchli

Copy link

gitguardian bot commented Jan 23, 2024

⚠️ GitGuardian has uncovered 4 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
5685611 Triggered Generic High Entropy Secret a0f4144 tests/tests_data/streaming/test_resolver.py View secret
5685611 Triggered Generic High Entropy Secret a0f4144 tests/tests_data/streaming/test_resolver.py View secret
5685611 Triggered Generic High Entropy Secret a0f4144 tests/tests_data/streaming/test_resolver.py View secret
5685611 Triggered Generic High Entropy Secret a0f4144 tests/tests_data/streaming/test_resolver.py View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

@github-actions github-actions bot added docs Documentation related fabric lightning.fabric.Fabric labels Jan 23, 2024
@awaelchli awaelchli changed the title [WIP] Compile guide for Fabric Compile guide for Fabric Jan 31, 2024
@awaelchli awaelchli added this to the 2.2 milestone Jan 31, 2024
@awaelchli awaelchli marked this pull request as ready for review January 31, 2024 02:19
Copy link
Contributor

github-actions bot commented Jan 31, 2024

⚡ Required checks status: All passing 🟢

Groups summary

🟢 fabric: Docs
Check ID Status
docs-make (fabric, doctest) success
docs-make (fabric, html) success

These checks are required after the changes to docs/source-fabric/advanced/compile.rst, docs/source-fabric/glossary/index.rst, docs/source-fabric/guide/index.rst, docs/source-fabric/index.rst, docs/source-fabric/levels/advanced.rst.


Thank you for your contribution! 💜

Note
This comment is automatically generated and updates for 60 minutes every 180 seconds. If you have any other questions, contact carmocca for help.

docs/source-fabric/levels/advanced.rst Outdated Show resolved Hide resolved
docs/source-fabric/advanced/compile.rst Outdated Show resolved Hide resolved
docs/source-fabric/advanced/compile.rst Outdated Show resolved Hide resolved
docs/source-fabric/advanced/compile.rst Show resolved Hide resolved
docs/source-fabric/advanced/compile.rst Outdated Show resolved Hide resolved
# Compile the model
model = torch.compile(model)

# Default: `fabric.setup()` will not reapply the compilation over DDP/FSDP
Copy link
Contributor

Choose a reason for hiding this comment

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

TIL. I thought we were doing this by default already. What's blocking us?

Copy link
Contributor Author

@awaelchli awaelchli Jan 31, 2024

Choose a reason for hiding this comment

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

Since we are usually quite sensitive with breaking changes, I wanted to make this experimental first for one release. I still need to do the work and run a batch of lit-gpt models with this settings to be sure this is not counter productive as a default. But happy to discuss this further.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't expect any significant number of users to find and enable this private flag. If you are afraid because the release is close, that's fine. But I would enable it as soon as we can after so that at least nightly users try it out

@mergify mergify bot added the ready PRs ready to be merged label Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation related fabric lightning.fabric.Fabric ready PRs ready to be merged torch.compile
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants