Skip to content

Commit dcac65d

Browse files
authored
Merge branch 'master' into feat/to_tensorrt
2 parents 67546dc + 39438bf commit dcac65d

File tree

97 files changed

+568
-192
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+568
-192
lines changed

.actions/assistant.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ def load_readme_description(path_dir: str, homepage: str, version: str) -> str:
154154
155155
"""
156156
path_readme = os.path.join(path_dir, "README.md")
157-
with open(path_readme, encoding="utf-8") as fo:
158-
text = fo.read()
157+
with open(path_readme, encoding="utf-8") as fopen:
158+
text = fopen.read()
159159

160160
# drop images from readme
161161
text = text.replace(
@@ -308,17 +308,17 @@ def copy_replace_imports(
308308
if ext in (".pyc",):
309309
continue
310310
# Try to parse everything else
311-
with open(fp, encoding="utf-8") as fo:
311+
with open(fp, encoding="utf-8") as fopen:
312312
try:
313-
lines = fo.readlines()
313+
lines = fopen.readlines()
314314
except UnicodeDecodeError:
315315
# a binary file, skip
316316
print(f"Skipped replacing imports for {fp}")
317317
continue
318318
lines = _replace_imports(lines, list(zip(source_imports, target_imports)), lightning_by=lightning_by)
319319
os.makedirs(os.path.dirname(fp_new), exist_ok=True)
320-
with open(fp_new, "w", encoding="utf-8") as fo:
321-
fo.writelines(lines)
320+
with open(fp_new, "w", encoding="utf-8") as fopen:
321+
fopen.writelines(lines)
322322

323323

324324
def create_mirror_package(source_dir: str, package_mapping: dict[str, str]) -> None:
@@ -370,10 +370,10 @@ def _prune_packages(req_file: str, packages: Sequence[str]) -> None:
370370

371371
@staticmethod
372372
def _replace_min(fname: str) -> None:
373-
with open(fname, encoding="utf-8") as fo:
374-
req = fo.read().replace(">=", "==")
375-
with open(fname, "w", encoding="utf-8") as fw:
376-
fw.write(req)
373+
with open(fname, encoding="utf-8") as fopen:
374+
req = fopen.read().replace(">=", "==")
375+
with open(fname, "w", encoding="utf-8") as fwrite:
376+
fwrite.write(req)
377377

378378
@staticmethod
379379
def replace_oldest_ver(requirement_fnames: Sequence[str] = REQUIREMENT_FILES_ALL) -> None:
@@ -471,15 +471,15 @@ def convert_version2nightly(ver_file: str = "src/version.info") -> None:
471471
"""Load the actual version and convert it to the nightly version."""
472472
from datetime import datetime
473473

474-
with open(ver_file) as fo:
475-
version = fo.read().strip()
474+
with open(ver_file) as fopen:
475+
version = fopen.read().strip()
476476
# parse X.Y.Z version and prune any suffix
477477
vers = re.match(r"(\d+)\.(\d+)\.(\d+).*", version)
478478
# create timestamp YYYYMMDD
479479
timestamp = datetime.now().strftime("%Y%m%d")
480480
version = f"{'.'.join(vers.groups())}.dev{timestamp}"
481-
with open(ver_file, "w") as fo:
482-
fo.write(version + os.linesep)
481+
with open(ver_file, "w") as fopen:
482+
fopen.write(version + os.linesep)
483483

484484
@staticmethod
485485
def generate_docker_tags(

.azure/gpu-tests-pytorch.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ jobs:
117117
set -e
118118
extra=$(python -c "print({'lightning': 'pytorch-'}.get('$(PACKAGE_NAME)', ''))")
119119
pip install -e ".[${extra}dev]" pytest-timeout -U --extra-index-url="${TORCH_URL}"
120-
pip install setuptools==75.6.0 jsonargparse==4.35.0
121120
displayName: "Install package & dependencies"
122121
123122
- bash: pip uninstall -y lightning

.github/CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,11 @@ In case you are adding new dependencies, make sure that they are compatible with
130130

131131
### Documentation
132132

133-
To learn about development of docs, check out the docs [README.md](https://github.com/Lightning-AI/lightning/blob/master/docs/README.md).
133+
To learn about development of docs, check out the docs [README.md](https://github.com/Lightning-AI/pytorch-lightning/blob/master/docs/README.md).
134134

135135
### Testing
136136

137-
To learn about tests, check out the tests [README.md](https://github.com/Lightning-AI/lightning/blob/master/tests/README.md).
137+
To learn about tests, check out the tests [README.md](https://github.com/Lightning-AI/pytorch-lightning/blob/master/tests/README.md).
138138

139139
### Pull Request
140140

@@ -165,8 +165,8 @@ We welcome any useful contribution! For your convenience here's a recommended wo
165165

166166
1. If any of the existing tests fail in your PR on our CI, refer to the following READMEs to identify what's failing and try to address it.
167167

168-
- [Test README](https://github.com/Lightning-AI/lightning/blob/master/tests/README.md)
169-
- [CI/CD README](https://github.com/Lightning-AI/lightning/blob/master/.github/workflows/README.md)
168+
- [Test README](https://github.com/Lightning-AI/pytorch-lightning/blob/master/tests/README.md)
169+
- [CI/CD README](https://github.com/Lightning-AI/pytorch-lightning/tree/master/.github/workflows#readme)
170170

171171
1. When you feel ready for integrating your work, mark your PR "Ready for review".
172172

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Fixes #\<issue_number>
1818
<summary><b>Before submitting</b></summary>
1919

2020
- Was this **discussed/agreed** via a GitHub issue? (not for typos and docs)
21-
- [ ] Did you read the [contributor guideline](https://github.com/Lightning-AI/lightning/blob/master/.github/CONTRIBUTING.md), **Pull Request** section?
21+
- [ ] Did you read the [contributor guideline](https://github.com/Lightning-AI/pytorch-lightning/blob/master/.github/CONTRIBUTING.md), **Pull Request** section?
2222
- [ ] Did you make sure your **PR does only one thing**, instead of bundling different changes together?
2323
- Did you make sure to **update the documentation** with your changes? (if necessary)
2424
- Did you write any **new necessary tests**? (not for typos and docs)

.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/markdown-links-config.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
"ignorePatterns": [
33
{
44
"pattern": "^https://github.com/Lightning-AI/pytorch-lightning/pull/"
5+
},
6+
{
7+
"pattern": "^https://dev.azure.com/Lightning-AI/lightning/_apis/build/status"
8+
},
9+
{
10+
"pattern": "^https://codecov.io/gh/Lightning-AI/pytorch-lightning/graph/badge.svg"
511
}
612
],
713
"httpHeaders": [

.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-check-md-links.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ on:
99
types: [opened, reopened, ready_for_review, synchronize]
1010
paths:
1111
- ".github/workflows/ci-check-md-links.yml"
12-
- ".github/workflows/markdown.links.config.json"
12+
- ".github/markdown-links-config.json"
1313
- "**/*.md"
1414

1515
jobs:
1616
check-md-links:
17-
uses: Lightning-AI/utilities/.github/workflows/check-md-links.yml@v0.14.3
17+
uses: Lightning-AI/utilities/.github/workflows/check-md-links.yml@main # can be pin with >=0.14.4
1818
with:
1919
config-file: ".github/markdown-links-config.json"
2020
base-branch: "master"
21+
force-check-all: "yes"

.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

0 commit comments

Comments
 (0)