Skip to content

Commit b08e465

Browse files
authored
Merge branch 'master' into feat/dynamo_export_onnx
2 parents 9e4a494 + 76d3d22 commit b08e465

File tree

9 files changed

+57
-22
lines changed

9 files changed

+57
-22
lines changed

.github/checkgroup.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,15 @@ subprojects:
176176
- "lightning-fabric (GPUs) (testing Fabric | latest)"
177177
- "lightning-fabric (GPUs) (testing Lightning | latest)"
178178

179-
- id: "lightning_fabric: TPU workflow"
180-
paths:
181-
# tpu CI availability is very limited, so we only require tpu tests
182-
# to pass when their configurations are modified
183-
- ".github/workflows/tpu-tests.yml"
184-
- "tests/tests_fabric/run_tpu_tests.sh"
185-
checks:
186-
- "test-on-tpus (pytorch, pjrt, v4-8)"
179+
# Temporarily disabled
180+
# - id: "lightning_fabric: TPU workflow"
181+
# paths:
182+
# # tpu CI availability is very limited, so we only require tpu tests
183+
# # to pass when their configurations are modified
184+
# - ".github/workflows/tpu-tests.yml"
185+
# - "tests/tests_fabric/run_tpu_tests.sh"
186+
# checks:
187+
# - "test-on-tpus (pytorch, pjrt, v4-8)"
187188

188189
# SECTION: common
189190

.github/workflows/_legacy-checkpoints.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,13 @@ jobs:
111111
retention-days: ${{ env.KEEP_DAYS }}
112112
include-hidden-files: true
113113

114+
- name: access secrets
115+
# export to env bool if secrets.AWS_REGION is not empty
116+
run: echo "WITH_SECRETS=$([ -n '${{ secrets.AWS_REGION }}' ] && echo 1 || echo 0)" >> $GITHUB_ENV
117+
114118
- run: pip install -r requirements/ci.txt
115119
- name: Upload checkpoints to S3
116-
if: ${{ secrets[AWS_REGION] != '' }}
120+
if: ${{ env.WITH_SECRETS == '1' }}
117121
working-directory: ${{ env.LEGACY_FOLDER }}
118122
env:
119123
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}

.github/workflows/ci-tests-fabric.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,24 @@ jobs:
116116
mkdir -p $PYPI_CACHE_DIR
117117
ls -lh $PYPI_CACHE_DIR
118118
119-
- name: Env. variables
119+
- name: Expand Env. variables
120120
run: |
121121
# Switch PyTorch URL between stable and test/future
122122
python -c "print('TORCH_URL=' + str('${{env.TORCH_URL_TEST}}' if '${{ matrix.pytorch-version }}' == '2.7' else '${{env.TORCH_URL_STABLE}}'))" >> $GITHUB_ENV
123123
# Switch coverage scope
124124
python -c "print('COVERAGE_SCOPE=' + str('lightning' if '${{matrix.pkg-name}}' == 'lightning' else 'lightning_fabric'))" >> $GITHUB_ENV
125125
# if you install mono-package set dependency only for this subpackage
126126
python -c "print('EXTRA_PREFIX=' + str('' if '${{matrix.pkg-name}}' != 'lightning' else 'fabric-'))" >> $GITHUB_ENV
127+
- name: Append Env. vars for MacOS
128+
if: ${{ runner.os == 'macOS' }}
129+
run: |
130+
# trying to avoid "gloo" issue with SIGABRT
131+
echo "GLOO_SOCKET_IFNAME=lo0" >> $GITHUB_ENV
132+
- name: Append Env. vars for Windows
133+
if: ${{ runner.os == 'windows' }}
134+
run: |
127135
# Avoid issue on Windows with PyTorch 2.4: "RuntimeError: use_libuv was requested but PyTorch was build without libuv support"
128-
python -c "print('USE_LIBUV=0' if '${{matrix.os}}' == 'windows-2022' and '${{matrix.pytorch-version}}' == '2.4' else '')" >> $GITHUB_ENV
136+
echo "USE_LIBUV=0" >> $GITHUB_ENV
129137
130138
- name: Install package & dependencies
131139
timeout-minutes: 20

.github/workflows/release-pkg.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,12 @@ jobs:
179179
with:
180180
pkg-folder: dist/${{ steps.folder.outputs.pkg }}
181181
pypi-token: ${{ secrets[format('PYPI_TOKEN_{0}', matrix.name)] }}
182-
# FIXME: this is not working suddenly, Unrecognized named-value: 'secrets'
183-
# legacy-checkpoints:
184-
# needs: [build-packages]
185-
# uses: ./.github/workflows/_legacy-checkpoints.yml
186-
# with:
187-
# push_to_s3: ${{ startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' }}
188-
# upload_local: ${{ startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' }}
189-
# create_pr: ${{ startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' }}
190-
# secrets: inherit
182+
183+
legacy-checkpoints:
184+
needs: [build-packages]
185+
uses: ./.github/workflows/_legacy-checkpoints.yml
186+
with:
187+
push_to_s3: ${{ startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' }}
188+
upload_local: ${{ startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' }}
189+
create_pr: ${{ startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' }}
190+
secrets: inherit
File renamed without changes.

requirements/pytorch/extra.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
matplotlib>3.1, <3.10.0
66
omegaconf >=2.2.3, <2.4.0
77
hydra-core >=1.2.0, <1.4.0
8-
jsonargparse[signatures] >=4.39.0, <4.41.0
8+
jsonargparse[signatures,jsonnet] >=4.39.0, <4.41.0
99
rich >=12.3.0, <14.1.0
1010
tensorboardX >=2.2, <2.7.0 # min version is set by torch.onnx missing attribute
1111
bitsandbytes >=0.45.2,<0.47.0; platform_system != "Darwin"

src/lightning/pytorch/cli.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,9 @@ def parse_arguments(self, parser: LightningArgumentParser, args: ArgsType) -> No
554554
def _dump_config(self) -> None:
555555
if hasattr(self, "config_dump"):
556556
return
557-
self.config_dump = yaml.safe_load(self.parser.dump(self.config, skip_link_targets=False, skip_none=False))
557+
self.config_dump = yaml.safe_load(
558+
self.parser.dump(self.config, skip_link_targets=False, skip_none=False, format="yaml")
559+
)
558560
if "subcommand" in self.config:
559561
self.config_dump = self.config_dump[self.config.subcommand]
560562

tests/tests_pytorch/test_cli.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1858,3 +1858,23 @@ def test_lightning_cli_with_args_given(args):
18581858
def test_lightning_cli_args_and_sys_argv_warning():
18591859
with mock.patch("sys.argv", ["", "--model.foo=456"]), pytest.warns(Warning, match="LightningCLI's args parameter "):
18601860
LightningCLI(TestModel, run=False, args=["--model.foo=789"])
1861+
1862+
1863+
def test_lightning_cli_jsonnet(cleandir):
1864+
class MainModule(BoringModel):
1865+
def __init__(self, main_param: int = 1):
1866+
super().__init__()
1867+
1868+
config = """{
1869+
"model":{
1870+
"main_param": 2
1871+
}
1872+
}"""
1873+
config_path = Path("config.jsonnet")
1874+
config_path.write_text(config)
1875+
1876+
cli_args = [f"--config={config_path}"]
1877+
with mock.patch("sys.argv", ["any.py"] + cli_args):
1878+
cli = LightningCLI(MainModule, run=False, parser_kwargs={"parser_mode": "jsonnet"})
1879+
1880+
assert cli.config["model"]["main_param"] == 2

0 commit comments

Comments
 (0)