-
Notifications
You must be signed in to change notification settings - Fork 3.6k
fabric: unify CLI with jsonargparse
[wip]
#21150
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: master
Are you sure you want to change the base?
Conversation
⛈️ Required checks status: Has failure 🔴
Groups summary🟢 pytorch_lightning: Tests workflow
These checks are required after the changes to 🟢 pytorch_lightning: Azure GPU
These checks are required after the changes to 🔴 pytorch_lightning: Benchmarks
These checks are required after the changes to 🟢 fabric: Docs
These checks are required after the changes to 🟢 pytorch_lightning: Docker
These checks are required after the changes to 🔴 lightning_fabric: CPU workflow
These checks are required after the changes to 🔴 lightning_fabric: Azure GPU
These checks are required after the changes to 🟢 mypy
These checks are required after the changes to 🟢 install
These checks are required after the changes to Thank you for your contribution! 💜
|
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.
Pull Request Overview
This PR replaces the Click-based CLI implementation with jsonargparse, aligning with PyTorch's CLI approach while reducing dependencies. The change introduces a class-based CLI structure that provides the same functionality through jsonargparse's ArgumentParser.
Key changes:
- Replace Click dependency with jsonargparse[signatures] for CLI argument parsing
- Restructure CLI from function-based to class-based architecture using
FabricCLI
- Update test requirements to use jsonargparse instead of Click
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
src/lightning/fabric/cli.py | Complete rewrite from Click to jsonargparse with new FabricCLI class structure |
requirements/fabric/test.txt | Replace Click dependency with jsonargparse[signatures] requirement |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/lightning/fabric/cli.py
Outdated
"--output_file", | ||
type=str, |
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 original Click validation type=click.Path(exists=True)
for output_file has been removed, but output files should typically NOT exist (they're being created). The original validation logic appears incorrect and this change fixes it, but the help text still mentions 'The file should not already exist' without enforcement.
Copilot uses AI. Check for mistakes.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #21150 +/- ##
=========================================
- Coverage 87% 81% -6%
=========================================
Files 269 269
Lines 23595 23627 +32
=========================================
- Hits 20581 19127 -1454
- Misses 3014 4500 +1486 |
jsonargparse
jsonargparse
[wip]
for more information, see https://pre-commit.ci
…into fabric/cli
for more information, see https://pre-commit.ci
What does this PR do?
reduce dependencies and since
pytorch
is already based onjsonargparse
, there is no need for clickBefore submitting
PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:
Reviewer checklist
📚 Documentation preview 📚: https://pytorch-lightning--21150.org.readthedocs.build/en/21150/