-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a lightning jsonargparse epi-patch for edge cases where the curre…
…ntly released patch causes conflicts
- Loading branch information
1 parent
690d9f0
commit f698388
Showing
6 changed files
with
39 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/fts_examples/patching/patched_lightning_jsonargparse.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from fts_examples.patching._patch_utils import _prepare_module_ctx | ||
from lightning.pytorch.cli import LightningCLI # noqa: F401 | ||
|
||
|
||
globals().update(_prepare_module_ctx('lightning.pytorch.cli', globals())) | ||
|
||
# we ignore these for the entire file since we're using our global namespace trickeration to patch | ||
# ruff: noqa: F821 | ||
# pyright: reportUndefinedVariable=false | ||
|
||
def _updated_parse_known_args_patch(self: ArgumentParser, args: Any = None, namespace: Any = None, | ||
intermixed: bool = False) -> tuple[Any, Any]: | ||
namespace, args = super(ArgumentParser, self)._parse_known_args(args, namespace, | ||
intermixed=intermixed) # type: ignore | ||
return namespace, args |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
ENABLE_FTS_EINSUM_STRATEGY_PATCH | ||
ENABLE_FTS_NUMPY_EXTRACTOR_PATCH | ||
ENABLE_FTS_TRITON_CODEGEN_PATCH | ||
ENABLE_FTS_LIGHTNING_JSONARGPARSE_PATCH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters