diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index a78343c328..70192ee44d 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -12,25 +12,26 @@ assignees: ''
### To Reproduce
-Steps to reproduce the behavior:
-
-1. Go to '...'
-1. Run '....'
-1. Scroll down to '....'
-1. See error
+Steps to reproduce the behavior...
-#### Code sample
+
+ Code sample
+
+```python
+# Ideally attach a minimal code sample to reproduce the decried issue.
+# Minimal means having the shortest code but still preserving the bug.
+```
-
+
### Expected behavior
-### Environment
+
+ Environment
- PyTorch Version (e.g., 1.0):
- OS (e.g., Linux):
@@ -41,6 +42,8 @@ Minimal means having the shortest code but still preserving the bug. -->
- GPU models and configuration:
- Any other relevant information:
+
+
### Additional context
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 0000000000..b8b40fe44e
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,8 @@
+blank_issues_enabled: false
+contact_links:
+ - name: Ask a Question
+ url: https://github.com/Lightning-Universe/lightning-bolts/discussions/new
+ about: Ask and answer TorchMetrics related questions
+ - name: 💬 Chat with us
+ url: https://discord.gg/VptPCZkGNa
+ about: Live chat with experts, engineers, and users in our Discord community.
diff --git a/.github/ISSUE_TEMPLATE/documentation.md b/.github/ISSUE_TEMPLATE/documentation.md
index c74b340800..456d49be45 100644
--- a/.github/ISSUE_TEMPLATE/documentation.md
+++ b/.github/ISSUE_TEMPLATE/documentation.md
@@ -10,8 +10,7 @@ assignees: ''
For typos and doc fixes, please go ahead and:
-1. Create an issue.
-1. Fix the typo.
-1. Submit a PR.
+- For a simple typo or fix, please send directly a PR (no need to create an issue)
+- If you are not sure about the proper solution, please describe here your finding...
Thanks!
diff --git a/.github/ISSUE_TEMPLATE/how-to-question.md b/.github/ISSUE_TEMPLATE/how-to-question.md
deleted file mode 100644
index bf9a228178..0000000000
--- a/.github/ISSUE_TEMPLATE/how-to-question.md
+++ /dev/null
@@ -1,30 +0,0 @@
----
-name: How to question
-about: Asking how-to questions
-title: ''
-labels: question
-assignees: ''
----
-
-## ❓ Questions and Help
-
-### Before asking:
-
-1. search the issues.
-1. search the docs.
-
-
-
-#### What is your question?
-
-#### Code
-
-
-
-#### What have you tried?
-
-#### What's your environment?
-
-- OS: \[e.g. iOS, Linux, Win\]
-- Packaging \[e.g. pip, conda\]
-- Version \[e.g. 0.5.2.1\]
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 54def0787c..f5b7ff2e8a 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -1,3 +1,16 @@
+
+ Before submitting
+
+- [ ] Was this **discussed/approved** via a Github issue? (no need for typos and docs improvements)
+- [ ] Did you read the [contributor guideline](https://github.com/PyTorchLightning/lightning-bolts/blob/master/.github/CONTRIBUTING.md), Pull Request section?
+- [ ] Did you make sure your PR does **only one thing**, instead of bundling different changes together?
+- [ ] Did you make sure to **update the documentation** with your changes?
+- [ ] Did you write any **new necessary tests**? \[not needed for typos/docs\]
+- [ ] Did you verify new and **existing tests** pass locally with your changes?
+- [ ] If you made a notable change (that affects users), did you update the [CHANGELOG](https://github.com/PyTorchLightning/lightning-bolts/blob/master/CHANGELOG.md)?
+
+
+
## What does this PR do?
## PR review
diff --git a/.github/actions/download-ROM/action.yml b/.github/actions/download-ROM/action.yml
new file mode 100644
index 0000000000..76f2b3602f
--- /dev/null
+++ b/.github/actions/download-ROM/action.yml
@@ -0,0 +1,33 @@
+name: Prepare env. / restore caches
+description: some more complex download-ROM - pip & hf
+
+runs:
+ using: "composite"
+ steps:
+
+ - name: Setup macOS
+ if: runner.os == 'macOS'
+ run: |
+ brew update
+ brew install rar
+ shell: bash
+ - name: Setup Ubuntu
+ if: runner.os == 'Linux'
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y unrar
+ shell: bash
+ - name: Setup Windows
+ if: runner.os == 'Windows'
+ run: |
+ choco install unrar
+ shell: bash
+
+ - name: Download ROMs
+ run: |
+ mkdir -p _datasets
+ cd _datasets
+ curl http://www.atarimania.com/roms/Roms.rar -o Roms.rar
+ unrar x -y Roms.rar
+ rm Roms.rar
+ shell: bash
diff --git a/.github/labeler.yml b/.github/labeler.yml
deleted file mode 100644
index a1b7bddb4a..0000000000
--- a/.github/labeler.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-documentation:
- - docs/**/*
-
-callback:
- - pl_bolts/callbacks/**/*
-
-datamodule:
- - pl_bolts/datamodules/**/*
-
-model:
- - pl_bolts/models/**/*
diff --git a/.github/labeling-config.yml b/.github/labeling-config.yml
new file mode 100644
index 0000000000..7085320fc6
--- /dev/null
+++ b/.github/labeling-config.yml
@@ -0,0 +1,19 @@
+documentation:
+ - changed-files:
+ - any-glob-to-any-file:
+ - docs/**/*
+
+callback:
+ - changed-files:
+ - any-glob-to-any-file:
+ - pl_bolts/callbacks/**/*
+
+datamodule:
+ - changed-files:
+ - any-glob-to-any-file:
+ - pl_bolts/datamodules/**/*
+
+model:
+ - changed-files:
+ - any-glob-to-any-file:
+ - pl_bolts/models/**/*
diff --git a/.github/workflows/ci-checks.yml b/.github/workflows/ci-checks.yml
index bf0fa4275f..f13feeba6a 100644
--- a/.github/workflows/ci-checks.yml
+++ b/.github/workflows/ci-checks.yml
@@ -26,6 +26,6 @@ jobs:
import-name: "pl_bolts"
testing-matrix: |
{
- "os": ["ubuntu-20.04", "macos-11", "windows-2022"],
+ "os": ["ubuntu-22.04", "macos-13", "windows-2022"],
"python-version": ["3.8"]
}
diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml
index dfd0b08290..aa19f928e0 100644
--- a/.github/workflows/ci-tests.yml
+++ b/.github/workflows/ci-tests.yml
@@ -21,13 +21,13 @@ jobs:
strategy:
fail-fast: false
matrix:
- os: ["ubuntu-20.04", "macOS-11"]
+ os: ["ubuntu-22.04", "macOS-13"]
python-version: ["3.8", "3.9", "3.10"]
requires: ["latest"] # + "oldest"
include:
- { os: 'windows-2022', python-version: "3.9" }
- { os: 'ubuntu-20.04', python-version: "3.8", requires: "oldest" }
- - { os: 'macOS-11', python-version: "3.8", requires: "oldest" }
+ - { os: 'macOS-13', python-version: "3.8", requires: "oldest" }
env:
FREEZE_REQUIREMENTS: 1
TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html"
@@ -42,6 +42,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
+ cache: "pip"
- name: Set min. dependencies
if: matrix.requires == 'oldest'
@@ -53,15 +54,11 @@ jobs:
open(fpath, 'w').write(req)
shell: python
- - name: Get pip cache dir
- id: pip-cache
- run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- - name: Restore pip cache
- uses: actions/cache/restore@v4
- id: restore-cache
- with:
- path: ${{ steps.pip-cache.outputs.dir }}
- key: pip-dependencies
+ - name: Setup macOS
+ if: runner.os == 'macOS'
+ run: |
+ brew update
+ brew install swig
- name: Install package
run: |
@@ -84,13 +81,6 @@ jobs:
pip install -r requirements/devel.txt -U -q -f ${TORCH_URL}
pip list
- - name: Save pip cache
- if: github.ref == 'refs/heads/master'
- uses: actions/cache/save@v4
- with:
- path: ${{ steps.pip-cache.outputs.dir }}
- key: pip-dependencies
-
- name: Cache datasets
id: cache-datasets
uses: actions/cache@v4
@@ -100,36 +90,18 @@ jobs:
# bump this date if you need update cache
key: datasets-20230630
- - name: Setup macOS
- if: runner.os == 'macOS' && steps.cache-datasets.outputs.cache-hit != 'true'
- run: |
- brew update
- brew install rar
- - name: Setup Ubuntu
- if: runner.os == 'Linux'&& steps.cache-datasets.outputs.cache-hit != 'true'
- run: |
- sudo apt-get update
- sudo apt-get install -y unrar
- - name: Setup Windows
- if: runner.os == 'Windows'&& steps.cache-datasets.outputs.cache-hit != 'true'
- run: |
- choco install unrar
-
- name: Download ROMs
if: steps.cache-datasets.outputs.cache-hit != 'true'
- run: |
- mkdir -p _datasets
- cd _datasets
- curl http://www.atarimania.com/roms/Roms.rar -o Roms.rar
- unrar x -y Roms.rar
- rm Roms.rar
+ continue-on-error: true
+ uses: ./.github/actions/download-ROM
- name: Init ROMs
+ continue-on-error: true
working-directory: _datasets/
run: python -m atari_py.import_roms ROMS
- - name: Restore HF cache
- uses: actions/cache/restore@v4
+ - name: HF cache
+ uses: actions/cache@v4
with:
path: ${{ env.TRANSFORMERS_CACHE }}
key: cache-transformers
@@ -137,15 +109,7 @@ jobs:
- name: Testing
run: python -m pytest tests -v --cov=pl_bolts --timeout=200
- - name: Save HF cache
- if: github.ref == 'refs/heads/master'
- uses: actions/cache/save@v4
- with:
- path: ${{ env.TRANSFORMERS_CACHE }}
- key: cache-transformers
-
- name: Statistics
- if: success()
run: |
coverage report
coverage xml
diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml
index dcb9b5f4f9..ae7cc9a77f 100644
--- a/.github/workflows/labeler.yml
+++ b/.github/workflows/labeler.yml
@@ -1,13 +1,18 @@
-name: Labeler
-
-on:
- pull_request_target:
- types: [opened, reopened]
+name: "Pull Request Labeler"
+on: [pull_request_target]
jobs:
- triage:
+ triage-prs:
+ permissions:
+ contents: read
+ pull-requests: write
runs-on: ubuntu-latest
steps:
- - uses: actions/labeler@main
- with:
- repo-token: "${{ secrets.GITHUB_TOKEN }}"
+ # Uploads repository content to the runner
+ - uses: actions/checkout@v4
+ - uses: actions/labeler@v5
+ with:
+ # The path to the label configuration file.
+ configuration-path: .github/labeling-config.yml
+ # Whether removing labels when matching files are reverted or no longer changed by the PR
+ sync-labels: true
diff --git a/src/pl_bolts/callbacks/data_monitor.py b/src/pl_bolts/callbacks/data_monitor.py
index 7a39a1e709..1d4e8c9c08 100644
--- a/src/pl_bolts/callbacks/data_monitor.py
+++ b/src/pl_bolts/callbacks/data_monitor.py
@@ -112,7 +112,7 @@ def _is_logger_available(self, logger: Logger) -> bool:
if not isinstance(logger, self.supported_loggers):
rank_zero_warn(
f"{self.__class__.__name__} does not support logging with {logger.__class__.__name__}."
- f" Supported loggers are: {', '.join((str(x.__name__) for x in self.supported_loggers))}"
+ f" Supported loggers are: {', '.join(str(x.__name__) for x in self.supported_loggers)}"
)
available = False
return available