instance_id
stringlengths
21
53
repo
stringclasses
188 values
language
stringclasses
1 value
pull_number
int64
20
148k
title
stringlengths
6
144
body
stringlengths
0
83.4k
created_at
stringdate
2015-09-25 03:17:17
2025-07-10 16:50:35
problem_statement
stringlengths
188
240k
hints_text
stringlengths
0
145k
resolved_issues
listlengths
1
6
base_commit
stringlengths
40
40
commit_to_review
dict
reference_review_comments
listlengths
1
62
merged_commit
stringlengths
40
40
merged_patch
stringlengths
297
9.87M
metadata
dict
Lightning-AI__pytorch-lightning-8472@fd7aa0c
Lightning-AI/pytorch-lightning
Python
8,472
[bugfix] Prevent deepcopy of dataloaders / Trainer in SWA Callback
## What does this PR do? <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. If we didn't discuss your PR in Github issues there's a high chance it will not be merged. The follow...
2021-07-19T12:33:56Z
Using SWA callback triggers useless deepcopy of data loaders ## 🐛 Bug Using SWA callback triggers a deepcopy of the whole PyTorch Lightning module ("pl_module") at the on_before_accelerator_backend_setup hook (lines 140-142 of pytorch_lightning/callbacks/swa.py file). The PyTorch Lightning has the dataloaders as at...
Dear @alexandrebone, The `dataloaders` are wrapped into functions and it shouldn't cause an increase of memory during the deepcopy. However, I am not sure about dataset. I will check. Best, T.c @tchaton ping :) I also ran in OOM with SWA which does not run OOM when SWA is turned off. I guess in my case ...
[ { "body": "## 🐛 Bug\r\n\r\nUsing SWA callback triggers a deepcopy of the whole PyTorch Lightning module (\"pl_module\") at the on_before_accelerator_backend_setup hook (lines 140-142 of pytorch_lightning/callbacks/swa.py file). The PyTorch Lightning has the dataloaders as attributes, hence using deepcopy leads...
8a9ee403be9f52a336bebf4d40f4f36d87224ebc
{ "head_commit": "fd7aa0c0b07095de3a5ce31b3a770b94a1634516", "head_commit_message": "Simplify test", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex 842c41f179073..7a9b2a2b7a73c 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -316,6 +316,9 @@ The format is based on [Keep a Changelog](http:/...
[ { "diff_hunk": "@@ -1998,3 +1998,10 @@ def get_from_queue(self, queue: torch.multiprocessing.SimpleQueue) -> None:\n self.trainer.callback_metrics.update(\n apply_to_collection(callback_metrics, np.ndarray, lambda x: torch.tensor(x))\n )\n+\n+ def __getstate__(self) -> Dict[str, A...
294307c0e6bd7488055e24acd708f844c1e498e0
diff --git a/CHANGELOG.md b/CHANGELOG.md index 71d428b119430..8b260e3401d44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -323,6 +323,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Use XLA utility API to move data to CPU (Single TPU core) ([#8078](https://github.com/PyTorchLig...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-8464@3acbbdc
Lightning-AI/pytorch-lightning
Python
8,464
Quant as optional step
## What does this PR do? <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. If we didn't discuss your PR in Github issues there's a high chance it will not be merged. The follow...
2021-07-19T09:56:00Z
Allow calling fit multiple times with Quantization (QAT) ## 🐛 Bug When using the QuantizationAwareTraining() callback, one cannot call Trainer.fit twice. ### To Reproduce Call Trainer.fit twice on any model gives an exception (which is pretty qpaque, I might add) ### Expected behavior Resumes training ...
To avoid the confusion, calling fit twice means something like ```python dm = BoringDataModule() model = BoringModel() t = pl.Trainer() trainer = pl.Trainer(gpus=1, max_epochs=1, check_val_every_n_epoch=1, callbacks=[QuantizationAwareTraining()]) trainer.fit(model, datamodule=dm) trainer.fit(model, datamodule=dm...
[ { "body": "## 🐛 Bug\r\n\r\nWhen using the QuantizationAwareTraining() callback, one cannot call Trainer.fit twice.\r\n\r\n### To Reproduce\r\n\r\nCall Trainer.fit twice on any model gives an exception (which is pretty qpaque, I might add)\r\n\r\n### Expected behavior\r\n\r\nResumes training\r\n\r\n### Addition...
0ac9e2ae608c173b45bed8ab947c2be3f4cd9b53
{ "head_commit": "3acbbdca35dcd65f992e5b1d13749901f1aa0cf7", "head_commit_message": "Apply suggestions from code review\n\nCo-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>\nCo-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex 2be73...
[ { "diff_hunk": "@@ -82,60 +82,65 @@ def _recursive_hasattr(obj: Any, attribs: str, state: bool = True) -> bool:\n \n \n class QuantizationAwareTraining(Callback):\n- OBSERVER_TYPES = ('histogram', 'average')\n+ \"\"\"\n+ Quantization allows speeding up inference and decreasing memory requirements\n+ ...
da57f460e33a31d085f62dea0005e9afba853085
diff --git a/CHANGELOG.md b/CHANGELOG.md index 2be735ba3f855..3c4bc7c0dc798 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -177,12 +177,16 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Enabled traditional/manual launching of DDP processes through `LOCAL_RANK` and `NODE_RANK` env...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-8167@63591be
Lightning-AI/pytorch-lightning
Python
8,167
[bugfix] Add mechanism to prevent deadlock for DDP on Exception Trigger
## What does this PR do? <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. If we didn't discuss your PR in Github issues there's a high chance it will not be merged. The follow...
2021-06-28T09:20:33Z
DDP script hangs forever if one child process dies. ## 🐛 Bug When using multiple gpus with `accelerator=ddp`, if one child processes throws an error, the main script hangs indefinitely and never terminates. The error does appear in the stdout but does not cause the main script to terminate as it should. Note, th...
Hi @melanibe, thanks for the issue. I'll look into it, but depending on how the child process fails, there may not be much we can do. Let me quickly explain why and also why it works with spawn: When using spawn, we actually use python's multiprocessing to spawn the new processes, that means they are connecte...
[ { "body": "## 🐛 Bug\r\n\r\nWhen using multiple gpus with `accelerator=ddp`, if one child processes throws an error, the main script hangs indefinitely and never terminates. The error does appear in the stdout but does not cause the main script to terminate as it should.\r\n\r\nNote, that this bug does not appe...
c3065c5ce93ea4baa9062d7eb08f63961b261fac
{ "head_commit": "63591be09888134e239bd7259863fb48921d2695", "head_commit_message": "update on comments", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex 980d2a450f786..867ad7cfa3c70 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -220,6 +220,9 @@ The format is based on [Keep a Changelog](h...
[ { "diff_hunk": "@@ -381,3 +390,45 @@ def register_plugins(cls, plugin_registry: Dict) -> None:\n description=\"DDP Plugin with `find_unused_parameters` as False\",\n find_unused_parameters=False\n )\n+\n+ def _share_information_to_prevent_deadlock(self):\n+ self._share_...
650a4fe735e84b3873eb40fef2868f50dcb339eb
diff --git a/CHANGELOG.md b/CHANGELOG.md index 980d2a450f786..ccdaa7fde8f51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -220,6 +220,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - `Trainer(resume_from_checkpoint=...)` now restores the model directly after `LightningModule.set...
{ "difficulty": "high", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-7960@fef7b92
Lightning-AI/pytorch-lightning
Python
7,960
Add logger flag to save_hyperparameters
## What does this PR do? <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. If we didn't discuss your PR in Github issues there's a high chance it will not be merged. The follow...
2021-06-13T05:03:20Z
Support save_hyperparameters() to checkpoints without sending to logger ## 🚀 Feature `self.save_hyperparameters()` is an awesome simple way to save input arguments with checkpoints such that when loading a checkpoint the module will be constructed with the same parameters. The method also seems to log the hyperparame...
This issue has been automatically marked as stale because it hasn't had any recent activity. This issue will be closed in 7 days if no further activity occurs. Thank you for your contributions, Pytorch Lightning Team! I still believe this should be fixed. Logging hyperparameters and saving them to a checkpoint serve d...
[ { "body": "## 🚀 Feature\r\n`self.save_hyperparameters()` is an awesome simple way to save input arguments with checkpoints such that when loading a checkpoint the module will be constructed with the same parameters. The method also seems to log the hyperparameters to the experiment logger, which is not always ...
09ff2951774c445ad9404e644cf0dec69bebef84
{ "head_commit": "fef7b922aef66a3ca3c5a6903dbaf936d852e131", "head_commit_message": "Update CHANGELOG.md\n\nCo-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex a91f7fc3189ff..6568614497eeb 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@...
[ { "diff_hunk": "@@ -40,6 +41,7 @@ def save_hyperparameters(\n ignore: an argument name or a list of argument names from\n class ``__init__`` to be ignored\n frame: a frame object. Default is None\n+ logger: Whether to save hyperparameters by logger. Default: Tr...
3b0a84ab420a272364fe8c469ab37d185b7975a3
diff --git a/CHANGELOG.md b/CHANGELOG.md index a91f7fc3189ff..6568614497eeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -116,7 +116,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added support `LightningModule.save_hyperparameters` when `LightningModule` is a dataclass ([#7...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
Lightning-AI__pytorch-lightning-7835@485120e
Lightning-AI/pytorch-lightning
Python
7,835
[bugfix] Resolve LearningRateMonitor + BackboneFinetuning
## What does this PR do? <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. If we didn't discuss your PR in Github issues there's a high chance it will not be merged. The follow...
2021-06-04T18:29:44Z
Error with `BackboneFinetuning` and `LearningRateMonitor` with `logging_interval="epoch"` ## 🐛 Bug When using the backbone finetuning callback + learning rate moniter with logging interval = epoch an error is thrown after the backbone is unfrozen. ## Please reproduce using the BoringModel ``` import os im...
[ { "body": "## 🐛 Bug\r\n\r\nWhen using the backbone finetuning callback + learning rate moniter with logging interval = epoch an error is thrown after the backbone is unfrozen.\r\n\r\n## Please reproduce using the BoringModel\r\n\r\n```\r\nimport os\r\n\r\nimport torch\r\nfrom torch.utils.data import DataLoader...
10839376e253c157ce2da2741d597c1f7aee23c3
{ "head_commit": "485120e2e0c672e26e15e943ec876b7b8a89efb4", "head_commit_message": "update changelog", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex 2f6d4692ec076..5fc69fb34a46e 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -191,6 +191,9 @@ The format is based on [Keep a Changelog](htt...
[ { "diff_hunk": "@@ -278,3 +281,54 @@ def configure_optimizers(self):\n )\n trainer.fit(TestModel())\n assert lr_monitor.lr_sch_names == list(lr_monitor.lrs.keys()) == ['my_logging_name']\n+\n+\n+def test_multiple_optimizers_basefinetuning(tmpdir):\n+\n+ class TestModel(BoringModel):\n+\n+ ...
472ba3b1862070076c023077134697ccfbb28d70
diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f6d4692ec076..5fc69fb34a46e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -191,6 +191,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed a bug where checking `trainer.precision` changed to `'mixed'` when specifying 16 in traine...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-7980@c9afc3d
Lightning-AI/pytorch-lightning
Python
7,980
[feat] Allow overriding optimizer_zero_grad and/or optimizer_step when using accumulate_grad_batches
## What does this PR do? Adds the ability to override optimizer_zero_grad when using accumulate_grad_batches as discussed in #6910 Fixes #6910 ## Before submitting - [x] Was this discussed/approved via a GitHub issue? (not for typos and docs) - [x] Did you read the [contributor guideline](https://github.com...
2021-06-14T22:19:26Z
Allow overriding optimizer_zero_grad and/or optimizer_step when using accumulate_grad_batches ## 🚀 Feature Currently, PyTorch Lightning refuses to allow custom optimizer_step and optimizer_zero_grad functions when using accumulated gradients, saying: ``` When overriding `LightningModule` optimizer_step or optimiz...
This issue has been automatically marked as stale because it hasn't had any recent activity. This issue will be closed in 7 days if no further activity occurs. Thank you for your contributions, Pytorch Lightning Team! @PyTorchLightning/core-contributors @tchaton Are you aware of the motivation for this? Is it a ha...
[ { "body": "## 🚀 Feature\r\n\r\nCurrently, PyTorch Lightning refuses to allow custom optimizer_step and optimizer_zero_grad functions when using accumulated gradients, saying:\r\n```\r\nWhen overriding `LightningModule` optimizer_step or optimizer_zero_grad, `accumulate_grad_batches` in `Trainer` should be 1. I...
bc2c2db2bfc4922691ed8d523fc655b9c0fa237c
{ "head_commit": "c9afc3d7a4dd27ea4a6f193475fdb00fd3e02783", "head_commit_message": "Allow for overriding optimizer_step and optimizer_zero_grad when using accumulate_grad_batches", "patch_to_review": "diff --git a/pytorch_lightning/core/lightning.py b/pytorch_lightning/core/lightning.py\nindex 02633d3df16fa..9f6...
[ { "diff_hunk": "@@ -253,18 +253,18 @@ def backward(self, *args, **kwargs) -> None:\n \n return out\n \n- # def optimizer_step(self, *args, **kwargs):\n- # pre_opt_step_state_dict = self.state_dict()\n- # assert self.check(self.start_state_dict, pre_opt_step_state_dict)\n...
2a76b31a49e1f18663f1c239803a898765d6abde
diff --git a/CHANGELOG.md b/CHANGELOG.md index 75da2d41716fa..214d224a81ed0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -95,6 +95,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added support `LightningModule.save_hyperparameters` when `LightningModule` is a dataclass ([#7992...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
Lightning-AI__pytorch-lightning-8093@9dfaa67
Lightning-AI/pytorch-lightning
Python
8,093
Add support for optimizers and learning rate schedulers to LightningCLI
## What does this PR do? New feature for LightningCLI to make optimizers and learning rate schedulers easily configurable. It implements the proposal mentioned in https://github.com/PyTorchLightning/pytorch-lightning/issues/7576#issuecomment-852387071 except for minor differences required during development. How it ...
2021-06-23T05:38:40Z
Easier way to configure optimizers and schedulers in the CLI ## 🚀 Feature Right now if you want to work with multiple optimizers and/or learning rate schedulers you need to write a whole bunch of ugly boilerplate. I suggest that the LightningCLI in one way or another to enable that sort of optimizer configuration co...
cc @carmocca @mauvilsa > but I can imagine the CLI having a baseline configure_optimizers on its own so that the user doesn't need to write it for simple patterns. The CLI should not modify or override any code inside the `LightningModule`. To accomplish what you want, there are several ways you could go about it. ...
[ { "body": "## 🚀 Feature\r\nRight now if you want to work with multiple optimizers and/or learning rate schedulers you need to write a whole bunch of ugly boilerplate. I suggest that the LightningCLI in one way or another to enable that sort of optimizer configuration code in a clean way, which would take care...
57dce7244c1eadded22e8ff0deb715cdd7662d3e
{ "head_commit": "9dfaa67a3efff6bad43ac81e20969c9696c8428d", "head_commit_message": "- Consider the case of ReduceLROnPlateau.\n- Change manual configure_optimizers example to return dict.", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex 666438b872b9c..d78142d24e3c1 100644\n--- a/CHANGELOG.md...
[ { "diff_hunk": "@@ -511,31 +511,41 @@ There is also the possibility of selecting among multiple classes by giving them\n In this case in the config the :code:`optimizer` group instead of having directly init settings, it should specify\n :code:`class_path` and optionally :code:`init_args`. Sub-classes of the cl...
f971dbbee68524203fa07788317cc9084d134597
diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ecc4a81a307b..d15ba0c363d2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -117,6 +117,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Add support for calling scripts using the module syntax (`python -m package.script`) ([#8073](ht...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
Lightning-AI__pytorch-lightning-7788@2a5f720
Lightning-AI/pytorch-lightning
Python
7,788
validate manual optimization and supported features before running training
## What does this PR do? Provides a better error message for unsupported features with manual optimization. - gradient clipping (cryptic error message) - gradient accumulation (would silently not work) Fixes #7698 ## Before submitting - [x] Was this discussed/approved via a GitHub issue? (not for typos ...
2021-06-01T10:34:03Z
AttributeError: 'NoneType' object has no attribute 'param_groups' ```python class myModel(pl.LightningModule): def __init__(self): super(myModel, self).__init__() self.automatic_optimization = False self.model=nn.Linear(1,1) def training_step(self,batch,batch_idx): opt = s...
you are missing an optimizer.step() if I see correctly. Is it intentional? looks like in manual optimization, grad clipping is not been taken care of. Should it be done my lightning in such a case or user should do it?? @awaelchli yeah, gradient clipping has to be done manually too, but it may differ based on the prec...
[ { "body": "```python\r\nclass myModel(pl.LightningModule):\r\n def __init__(self):\r\n super(myModel, self).__init__()\r\n self.automatic_optimization = False\r\n self.model=nn.Linear(1,1)\r\n def training_step(self,batch,batch_idx):\r\n opt = self.optimizers()\r\n opt.z...
9a001fea2218811ec1ce7eb9e8648beca20ede22
{ "head_commit": "2a5f720565c0911868837b9d467d2e107053767e", "head_commit_message": "update changelog", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex 5302b2199d46a..e5ff8f8689bb8 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -110,6 +110,9 @@ The format is based on [Keep a Changelog](htt...
[ { "diff_hunk": "@@ -147,3 +147,17 @@ def predict_dataloader(self):\n \n with pytest.raises(MisconfigurationException, match=\"Dataloader not found for `Trainer.predict`\"):\n trainer.predict(model)\n+\n+\n+def test_trainer_manual_optimization_config(tmpdir):\n+ \"\"\" Test error message when requ...
36402207dc14fbbf08a5f82778c04d2121614998
diff --git a/CHANGELOG.md b/CHANGELOG.md index 5302b2199d46a..e5ff8f8689bb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -110,6 +110,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Changed `teardown()` in `Accelerator` to allow `training_type_plugin` to customize `teardown` lo...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-7946@426179b
Lightning-AI/pytorch-lightning
Python
7,946
Add tests for GCS filesystem
## What does this PR do? <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. If we didn't discuss your PR in Github issues there's a high chance it will not be merged. The follow...
2021-06-11T16:47:01Z
Add tests for working with Remote file system (s3, gs buckets) ## 🚀 Tests Add tests for working with Remote file system (s3, gs buckets) This would require `gcsfs` as an additional install. ```python Trainer(default_root_dir='gs://…') ``` This would require `s3fs` as an additional install. ```python Trai...
[ { "body": "## 🚀 Tests\r\n\r\nAdd tests for working with Remote file system (s3, gs buckets)\r\n\r\nThis would require `gcsfs` as an additional install.\r\n```python\r\nTrainer(default_root_dir='gs://…')\r\n```\r\n\r\nThis would require `s3fs` as an additional install.\r\n```python\r\nTrainer(default_root_dir='...
3a8322deda3dcb753838214115c88451660efb32
{ "head_commit": "426179b8ce9646dc185854895942357784e58ec7", "head_commit_message": "fix test", "patch_to_review": "diff --git a/dockers/tpu-tests/tpu_test_cases.jsonnet b/dockers/tpu-tests/tpu_test_cases.jsonnet\nindex 13f70deed43ca..f1a94eeac783e 100644\n--- a/dockers/tpu-tests/tpu_test_cases.jsonnet\n+++ b/doc...
[ { "diff_hunk": "@@ -8,3 +8,4 @@ torchtext>=0.5\n onnxruntime>=1.3.0\n hydra-core>=1.0\n jsonargparse[signatures]>=3.15.0\n+gcsfs", "line": null, "original_line": 11, "original_start_line": null, "path": "requirements/extra.txt", "start_line": null, "text": "@user1:\nAdd a version?" } ]
0343b2b10794f38029d7d96dcd52fa56e27437ac
diff --git a/requirements/extra.txt b/requirements/extra.txt index 291813e05edcd..47d3a66e0d4a6 100644 --- a/requirements/extra.txt +++ b/requirements/extra.txt @@ -4,7 +4,8 @@ matplotlib>3.1 horovod>=0.21.2 # no need to install with [pytorch] as pytorch is already installed omegaconf>=2.0.1 torchtext>=0.5 -# onnx>...
{ "difficulty": "low", "estimated_review_effort": 3, "problem_domain": "Test Suite / CI Enhancements" }
Lightning-AI__pytorch-lightning-8397@203fd49
Lightning-AI/pytorch-lightning
Python
8,397
Fix save/load/resume from checkpoint for DeepSpeed Plugin
## What does this PR do? Closes #7282 https://github.com/PyTorchLightning/pytorch-lightning/issues/8344 https://github.com/PyTorchLightning/pytorch-lightning/issues/8092 Re-write of #7297 This PR will fix DeepSpeed saving/loading and resuming. TLDR: DeepSpeed ZeRO Stage 3 was broken when saving/loading. Thi...
2021-07-13T11:51:02Z
Model restore fails from stored checkpoint when using Deepspeed ## 🐛 Bug Trying to restore a checkpoint to resume training but it fails with the below exceptions ``` RuntimeError: Error(s) in loading state_dict for BoringModel: size mismatch for layer.weight: copying a param with shape torch.Size([2, 32]...
Hi @gurvindersingh I have a fix at: https://github.com/PyTorchLightning/pytorch-lightning/pull/7297 but the tests are failing (but the above reprod now works on multiple GPUs). Could you test this out and let me know? @SeanNaren model does get loaded fine now without error, but it seems the state is somehow corrupted a...
[ { "body": "## 🐛 Bug\r\nTrying to restore a checkpoint to resume training but it fails with the below exceptions\r\n\r\n```\r\nRuntimeError: Error(s) in loading state_dict for BoringModel:\r\n size mismatch for layer.weight: copying a param with shape torch.Size([2, 32]) from checkpoint, the shape in cur...
d01d8334b5274b7a71eaa8979772c1382222fd3e
{ "head_commit": "203fd4935a467be0c83c05f98e39256565b41bed", "head_commit_message": "[pre-commit.ci] auto fixes from pre-commit.com hooks\n\nfor more information, see https://pre-commit.ci", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex 0b35c08bdb198..9139e40312a85 100644\n--- a/CHANGELOG.md...
[ { "diff_hunk": "@@ -876,9 +866,25 @@ def _run(self, model: 'pl.LightningModule') -> Optional[Union[_EVALUATE_OUTPUT,\n # plugin will setup fitting (e.g. ddp will launch child processes)\n self._pre_dispatch()\n \n+ # restore modules after setup\n+ self.checkpoint_connector.resume_s...
c47abf2d21c2fb6c110282d0a24e36ab71ada8e8
diff --git a/CHANGELOG.md b/CHANGELOG.md index 2004c21bdc042..e0d5ac7caf287 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -93,7 +93,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed an issue with `training_step` outputs not getting collected correctly for `training_epoch_e...
{ "difficulty": "high", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-7684@ecaa92c
Lightning-AI/pytorch-lightning
Python
7,684
Add `should_rank_save_checkpoint` property to Training Plugins
## What does this PR do? Fixes #7678 Related to [link ](https://github.com/PyTorchLightning/pytorch-lightning/pull/7296#discussion_r633377680) ## Before submitting - [x] Was this discussed/approved via a GitHub issue? (not for typos and docs) - [x] Did you read the [contributor guideline](https://github.com/Py...
2021-05-24T17:45:53Z
Remove TPU training related logic from `ModelCheckpointCallback` ## 🐛 Enhancement Remove TPU training related logic from `ModelCheckpointCallback` ### Expected behavior Design-wise, it should be decoupled from any specific training plugins-related logic. Had it initially for writing checkpoints on every host ...
[ { "body": "## 🐛 Enhancement\r\n\r\nRemove TPU training related logic from `ModelCheckpointCallback`\r\n\r\n### Expected behavior\r\n\r\nDesign-wise, it should be decoupled from any specific training plugins-related logic. Had it initially for writing checkpoints on every host machine for TPU Pod training\r\n",...
8b01497e4235139edb83cd0b8efd87380a1af726
{ "head_commit": "ecaa92c5a91389988873ff50fac2d86ace965489", "head_commit_message": "Add docstring", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex a564d5b8094e6..e4579d561640e 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -41,6 +41,9 @@ The format is based on [Keep a Changelog](http://k...
[ { "diff_hunk": "@@ -493,7 +492,7 @@ def _do_save(self, trainer: 'pl.Trainer', filepath: str) -> None:\n trainer.dev_debugger.track_checkpointing_history(filepath)\n \n # make paths\n- if trainer.is_global_zero or tpu_training_and_local_rank_zero(trainer):\n+ if trainer.should_save_...
54f331bbebf5cbc310d032c350c9a7ca5b392204
diff --git a/CHANGELOG.md b/CHANGELOG.md index a564d5b8094e6..bb37f5542a7bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added `ddp_fully_sharded` support ([#7487](https://github.com/PyTorchLightning/pytorch-lightning/p...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Code Refactoring / Architectural Improvement" }
Lightning-AI__pytorch-lightning-7351@7b3f48d
Lightning-AI/pytorch-lightning
Python
7,351
Improve val step logging
## What does this PR do? <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. If we didn't discuss your PR in Github issues there's a high chance it will not be merged. The follow...
2021-05-04T16:46:20Z
[Bug] Logging Separately Per Epoch ## 🐛 Bug Logs separate plots for each epoch ### To Reproduce ```python import os import torch from torch.utils.data import Dataset, DataLoader from pytorch_lightning import LightningModule, Trainer from torch.nn import functional as F from torchmetrics.classification i...
[ { "body": "## 🐛 Bug\r\n\r\nLogs separate plots for each epoch\r\n\r\n### To Reproduce\r\n\r\n```python\r\nimport os\r\nimport torch\r\nfrom torch.utils.data import Dataset, DataLoader\r\nfrom pytorch_lightning import LightningModule, Trainer\r\nfrom torch.nn import functional as F\r\nfrom torchmetrics.classifi...
b64aea637cce2df4ed0275d6c5709ecf1dc26011
{ "head_commit": "7b3f48d0314a79641390877ab13487efee5f3d41", "head_commit_message": "Update CHANGELOG.md", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex b61aa5939dbef..753ddda0d60ea 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -199,6 +199,9 @@ The format is based on [Keep a Changelog](...
[ { "diff_hunk": "@@ -371,3 +374,31 @@ def log_train_step_metrics(self, batch_output):\n if len(batch_log_metrics) > 0 or len(grad_norm_dic) > 0:\n self.log_metrics(batch_log_metrics, grad_norm_dic)\n self._callback_metrics.update(batch_log_metrics)\n+\n+ @property\n...
076cda840b51774f8d6d37171f6b8456c0b37cec
diff --git a/CHANGELOG.md b/CHANGELOG.md index b61aa5939dbef..753ddda0d60ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -199,6 +199,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Changed `resume_from_checkpoint` warning to an error when the checkpoint file does not exist ([#...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-7457@0265ed3
Lightning-AI/pytorch-lightning
Python
7,457
MLFlow now uses env variable as default tracking uri
## What does this PR do? It changes the initialization of MLFlowLogger so that it uses the environment variable MLFLOW_TRACKING_URI by default Fixes #6894
2021-05-09T17:19:13Z
MLFlowLogger should defaults to enironment variable MLFLOW_TRACKING_URI ## 🚀 Feature The default value of `tracking_uri` in the initializer of `MLFlowLogger` should be `MLFLOW_TRACKING_URI` environment variable if set. ### Motivation 1. `mlflow` works in this way 2. it allows to have one tracking server with mul...
This issue has been automatically marked as stale because it hasn't had any recent activity. This issue will be closed in 7 days if no further activity occurs. Thank you for your contributions, Pytorch Lightning Team! Thanks for the issue @00sapo! feel free to send a PR.
[ { "body": "## 🚀 Feature\r\nThe default value of `tracking_uri` in the initializer of `MLFlowLogger` should be `MLFLOW_TRACKING_URI` environment variable if set.\r\n\r\n### Motivation\r\n1. `mlflow` works in this way\r\n2. it allows to have one tracking server with multiple processes using it (otherwise process...
b9a52fa2ef31f12f6992ece18a033318ec551907
{ "head_commit": "0265ed33a598a2d1001e6be45cfc7e9465146741", "head_commit_message": "MLFlow now uses env variable as default tracking uri\n\nSolves https://github.com/PyTorchLightning/pytorch-lightning/issues/6894", "patch_to_review": "diff --git a/pytorch_lightning/loggers/mlflow.py b/pytorch_lightning/loggers/m...
[ { "diff_hunk": "@@ -104,7 +106,7 @@ def any_lightning_module_function_or_hook(self):\n def __init__(\n self,\n experiment_name: str = 'default',\n- tracking_uri: Optional[str] = None,\n+ tracking_uri: Optional[str] = os.environ.get('MLFLOW_TRACKING_URI'),,", "line": null, ...
8742091b9b0c4325b799e652d4fa0478eba7ada7
diff --git a/CHANGELOG.md b/CHANGELOG.md index 84db9b385009e..adf5113e9eba6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Changed `model.state_dict()` in `CheckpointConnector` to allow `training_type_plugin` to customize...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "New Feature Additions" }
Lightning-AI__pytorch-lightning-7480@49493b9
Lightning-AI/pytorch-lightning
Python
7,480
support launching Lightning ddp with traditional command
## What does this PR do? Fixes #7003 The Lightning environment provides a convenient way to launch DDP multi-gpu experiments. It launches the required number of processes automatically under the hood as explained in the docs. However, there is currently only a hacky way for the user to prevent this if they wish t...
2021-05-11T11:09:12Z
PyTorch Lightning ignores traditional WORLD_SIZE/RANK specifications in environment and doesn't document replacement ## 🐛 Bug Standard torch.distributed environment variables seem to be handled differently. ### To Reproduce ``` $ MASTER_ADDR=192.168.1.3 MASTER_PORT=1234 WORLD_SIZE=2 RANK=0 python3 boring_mod...
Hi, did you follow these steps here? https://pytorch-lightning.readthedocs.io/en/latest/advanced/cluster.html I think you can also force the behavior you want like so: ```python from pytorch_lightning.plugins.environments import LightningEnvironment class MyCluster(LightningEnvironment): def creat...
[ { "body": "## 🐛 Bug\r\n\r\nStandard torch.distributed environment variables seem to be handled differently.\r\n\r\n### To Reproduce\r\n\r\n```\r\n$ MASTER_ADDR=192.168.1.3 MASTER_PORT=1234 WORLD_SIZE=2 RANK=0 python3 boring_model.py\r\n```\r\n\r\n### Expected behavior\r\n\r\nShould wait for second job to conne...
6ce77a102b5f53ca41be1ee9bf0275b1fa6b1dea
{ "head_commit": "49493b9e05d118d4e69ce69448746376c310a4b7", "head_commit_message": "add tab to report print", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex f344f490de6c1..7a29e0661fc2a 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -140,6 +140,9 @@ The format is based on [Keep a Changel...
[ { "diff_hunk": "@@ -78,6 +78,12 @@ if [ $? -eq 0 ]; then\n report+=\"Ran\\ttests/utilities/test_warnings.py\\n\"\n fi\n \n+# test that a user can manually launch individual processes\n+args=\"--trainer.gpus 2 --trainer.accelerator ddp --trainer.max_epochs=1 --data.batch_size=32 --trainer.limit_train_batches...
bb5964f263448cd00c9eac8967815bb61d147f07
diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ea6435b11605..d569b031e3841 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -166,6 +166,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added support for `accelerator='cpu'|'gpu'|'tpu'|'ipu'|'auto'` ([#7808](https://github.com/PyTor...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-7253@efedcdc
Lightning-AI/pytorch-lightning
Python
7,253
[bugfix] Add reloading support using BaseFinetuning
## What does this PR do? <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. If we didn't discuss your PR in Github issues there's a high chance it will not be merged. The follow...
2021-04-28T13:24:20Z
[BUG] `BaseFinetuning` not working with `resume_from_checkpoint` ## 🐛 Bug Using `BaseFinetuning` will add parameter groups during training, as a result when trying to load from checkpoint you will get the following `ValueError: loaded state dict has a different number of parameter groups`. Because when loading thes...
[ { "body": "## 🐛 Bug\r\n\r\nUsing `BaseFinetuning` will add parameter groups during training, as a result when trying to load from checkpoint you will get the following `ValueError: loaded state dict has a different number of parameter groups`. Because when loading these groups won't exist yet !\r\n\r\n\r\n### ...
969e857690407ce768224af1acdb62434b2b3242
{ "head_commit": "efedcdc730a66b75ac564ea791fc0efbc67754f4", "head_commit_message": "Update pytorch_lightning/callbacks/base.py\n\nCo-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex c944ce3e64c32..8efefe922c302 100644\n--- a/CHANGELOG.md\...
[ { "diff_hunk": "@@ -273,11 +273,20 @@ def on_save_checkpoint(\n \"\"\"\n pass\n \n- def on_load_checkpoint(self, callback_state: Dict[str, Any]) -> None:\n+ def on_load_checkpoint(\n+ self, trainer: 'pl.Trainer', pl_module: 'pl.LightningModule', callback_state: Dict[str, Any]\n+ ...
bb9eb2905b200ccd82f13374bf200a8c00584ff9
diff --git a/CHANGELOG.md b/CHANGELOG.md index e7b4480c59623..7563af5a06d3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -211,6 +211,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Deprecated `@auto_move_data` in favor of `trainer.predict` ([#6993](https://github.com/PyTorchLi...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-7043@f05aca3
Lightning-AI/pytorch-lightning
Python
7,043
Fix attribute error for _gpus_arg_default loading checkpoint prior to 1.2.8
## What does this PR do? Fixes #7031 I removed a function in #6898 that I should not have removed. Old checkpoints (<1.2.8) have this pickled, so in order to load the checkpoint back we need to have access to the source code. ## Before submitting - [ ] Was this discussed/approved via a GitHub issue? (not ...
2021-04-15T15:49:28Z
Can't get attribute '_gpus_arg_default' ## 🐛 Bug when I use the code ```model = model.load_from_checkpoint(ckpt_path)``` It pops out a problem: ```Can't get attribute '_gpus_arg_default' on <module 'pytorch_lightning.utilities.argparse' from '/opt/conda/envs/lasaft/lib/python3.8/site-packages/pytorch_lightning/util...
I met the same problem when I upgrade from 1.2.2 to 1.2.8 and from 1.2.6 to 1.2.8 And when I debugged it, I found that the “pytorch_lightning.utilities.argparse” in 1.2.8 does not have "_gpus_arg_default", but “pytorch_lightning.utilities.argparse” in 1.2.6 does have "_gpus_arg_default". I haven't been able to reproduc...
[ { "body": "## 🐛 Bug\r\nwhen I use the code\r\n```model = model.load_from_checkpoint(ckpt_path)```\r\nIt pops out a problem: ```Can't get attribute '_gpus_arg_default' on <module 'pytorch_lightning.utilities.argparse' from '/opt/conda/envs/lasaft/lib/python3.8/site-packages/pytorch_lightning/utilities/argparse....
f852a4f5925211d6bb9dac231b9185e3e6814b13
{ "head_commit": "f05aca364fe905082395b08e3ad1aa295e99a14a", "head_commit_message": "no-cover", "patch_to_review": "diff --git a/pytorch_lightning/utilities/argparse.py b/pytorch_lightning/utilities/argparse.py\nindex 5f7c280db80e9..3b2ebfbdf01da 100644\n--- a/pytorch_lightning/utilities/argparse.py\n+++ b/pytorc...
[ { "diff_hunk": "@@ -286,6 +286,13 @@ def _gpus_allowed_type(x) -> Union[int, str]:\n return int(x)\n \n \n+def _gpus_arg_default(x) -> Union[int, str]: # pragma: no-cover\n+ # unused, but here for backward compatibility with old checkpoints that need to be able to\n+ # unpickle the function from ...
5a498d3b975460ca1658b658a0a74e18f48bea79
diff --git a/pytorch_lightning/utilities/argparse.py b/pytorch_lightning/utilities/argparse.py index 5f7c280db80e9..6dbc4636b9481 100644 --- a/pytorch_lightning/utilities/argparse.py +++ b/pytorch_lightning/utilities/argparse.py @@ -286,6 +286,13 @@ def _gpus_allowed_type(x) -> Union[int, str]: return int(x) ...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-7120@915d413
Lightning-AI/pytorch-lightning
Python
7,120
Update `ClusterEnvironment` docs
## What does this PR do? Updates to cluster docs: - Merged docs for general purpose cluster and SLURM cluster into one doc - Added docs for Cluster Environment - Updated Grid docs Fixes #7073 ## Before submitting - [ ] Was this discussed/approved via a GitHub issue? (not for typos and docs) - [x] Did you ...
2021-04-20T12:42:56Z
DDP for multi-node jobs in non-slurm environments ## 🐛 Bug When running DDP with num_nodes > 1 without a SLURM environment, the global rank is not computed correctly: global rank ends up being always equal to local rank, disregarding number of nodes. My hunch for why this is happening is that num_processes is not c...
How did you set the `NODE_RANK` environment variable when launching the processes? With the following debug script: ```python import os import torch from torch.utils.data import Dataset from pytorch_lightning import LightningModule, Trainer class RandomDataset(Dataset): def __init__(self, size, len...
[ { "body": "## 🐛 Bug\r\n\r\nWhen running DDP with num_nodes > 1 without a SLURM environment, the global rank is not computed correctly: global rank ends up being always equal to local rank, disregarding number of nodes. My hunch for why this is happening is that num_processes is not computed correctly.\r\n\r\nM...
147752018d2e835b81215848fd234a3d19d0098a
{ "head_commit": "915d413eb14062394a613f0600f3e640e5ceda77", "head_commit_message": "update duplicated title", "patch_to_review": "diff --git a/docs/source/advanced/cluster.rst b/docs/source/advanced/cluster.rst\ndeleted file mode 100644\nindex 34538cb85b474..0000000000000\n--- a/docs/source/advanced/cluster.rst\...
[ { "diff_hunk": "@@ -198,11 +239,94 @@ See also the multi-node examples\n )\n \n \n-The other option is that you generate scripts on your own via a bash command or use another library.\n+The other option is that you generate scripts on your own via a bash command or use our\n+:doc:`native solution <../clouds...
13773d510bc2f4855eb00c19c3320f9a6bd2c1b2
diff --git a/docs/source/advanced/cluster.rst b/docs/source/advanced/cluster.rst deleted file mode 100644 index 34538cb85b474..0000000000000 --- a/docs/source/advanced/cluster.rst +++ /dev/null @@ -1,57 +0,0 @@ - -.. _non-slurm: - -Computing cluster -================= - -With Lightning it is easy to run your training s...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-6969@2e57f48
Lightning-AI/pytorch-lightning
Python
6,969
Fix inconsistent outputs in `on_*_end` and `*_end`
## What does this PR do? <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. If we didn't discuss your PR in Github issues there's a high chance it will not be merged. The follow...
2021-04-12T13:50:07Z
Inconsistent `outputs` format between `training_epoch_end` and `on_train_epoch_end` ## 🐛 Bug The outputs object for `on_train_epoch_end` should not include the `extra` field ### To Reproduce ```python def test_bug(tmpdir): class TestModel(BoringModel): def training_step(self, batch, batch_idx):...
Hi, I'm Marek from slack, thank you for the reproducible! I'll add extended test that shows also difference in `on_xxx_batch_end()` between train and val/test: ### Test ``` import os from typing import Any import torch from pl_examples.bug_report_model import BoringModel, RandomDataset from pytorch_lightn...
[ { "body": "## 🐛 Bug\r\n\r\nThe outputs object for `on_train_epoch_end` should not include the `extra` field\r\n\r\n### To Reproduce\r\n\r\n```python\r\ndef test_bug(tmpdir):\r\n class TestModel(BoringModel):\r\n def training_step(self, batch, batch_idx):\r\n output = self(batch)\r\n ...
e891ceb83651160ee1497455ffd63a75621bd013
{ "head_commit": "2e57f48057c56f1430e6970e595e3a32bb9cbad4", "head_commit_message": "Update CHANGELOG.md", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex 0f96664db72b0..6794286919ff9 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -240,6 +240,15 @@ The format is based on [Keep a Changelog]...
[ { "diff_hunk": "@@ -342,6 +346,43 @@ def _process_training_step_output(self, training_step_output, split_batch):\n \n return training_step_output_for_epoch_end, result\n \n+ @staticmethod\n+ def _prepare_outputs(outputs):", "line": null, "original_line": 350, "original_start_line": nul...
d3b1735310bb3be511eb966f43bba4b87dbe4e1c
diff --git a/CHANGELOG.md b/CHANGELOG.md index a28a18be47184..64d5391a3c898 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -243,6 +243,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed `AttributeError for `require_backward_grad_sync` when running manual optimization with sh...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-6915@0a477cb
Lightning-AI/pytorch-lightning
Python
6,915
Fix ShardedDataParallel has no attribute require_backward_grad_sync
## What does this PR do? Fixes #6804 ## Before submitting - [x] Was this discussed/approved via a GitHub issue? (not for typos and docs) - [x] Did you read the [contributor guideline](https://github.com/PyTorchLightning/pytorch-lightning/blob/master/.github/CONTRIBUTING.md), **Pull Request** section? - [x] Di...
2021-04-09T10:29:52Z
'LightningShardedDataParallel' object has no attribute 'require_backward_grad_sync' When trying to use sharded DDP with the latest Lightning version 1.2.6 and Fairscale 0.3.3, I get the following error. Note that I am also using manual optimization and disabling automatic, as I am training a GAN. ``` Traceback (mos...
@SeanNaren is the correct fix here to just not access `self.model.require_backward_grad_sync` in the sharded plugin?
[ { "body": "When trying to use sharded DDP with the latest Lightning version 1.2.6 and Fairscale 0.3.3, I get the following error. Note that I am also using manual optimization and disabling automatic, as I am training a GAN.\r\n\r\n```\r\nTraceback (most recent call last):\r\n File \"run_train.py\", line 41, i...
20ff50caa6aad8d5824d5ec889f2ba8f334c454a
{ "head_commit": "0a477cbf3cfcab18ee61c7827395be71bcc4dfbc", "head_commit_message": "test\n\n\ntest\n\n\ntest\n\n\nupdate test\n\n\nfix spawn\n\n\nupdate plugins\n\n\nrevert\n\n\nwip\n\n\nsharded\n\n\nfix name\n\n\nc", "patch_to_review": "diff --git a/pytorch_lightning/plugins/training_type/sharded.py b/pytorch_l...
[ { "diff_hunk": "@@ -278,3 +278,31 @@ def test_ddp_sharded_plugin_test_multigpu(tmpdir, trainer_kwargs):\n \n trainer.validate(model)\n trainer.test(model)\n+\n+\n+class ManualBoringModel(BoringModel):\n+\n+ def __init__(self):\n+ super().__init__()\n+ self.automatic_optimization = False...
d054ed0d930f635583eedb7abdd205910c3b318e
diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e4ca17b5922c..0f96664db72b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -237,6 +237,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed `--gpus` default for parser returned by `Trainer.add_argparse_args` ([#6898](https://githu...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-7614@692c233
Lightning-AI/pytorch-lightning
Python
7,614
MANIFEST.in and setup.py clean-up
## What does this PR do? - Do not include tests, pl_examples, and benchmarks in the generated wheel (`python setup.py bdist_wheel`) - Prune the MANIFEST.in definition for the source distribution (`python setup.py sdist`) - Copy the MNIST implementation from our tests into pl_examples - Removed `check-manifest` us...
2021-05-19T23:38:06Z
package "tests" in Python path? ## 🐛 Bug PyTorch Lightning install its tests into "test" in the Python path. I would venture that this is not ideal. ### To Reproduce Install PyTorch Lightning ``` import pathlib import pytorch_lightning print(list((pathlib.Path(pytorch_lightning.__file__).parent.parent / '...
[ { "body": "## 🐛 Bug\r\n\r\nPyTorch Lightning install its tests into \"test\" in the Python path. I would venture that this is not ideal.\r\n\r\n### To Reproduce\r\n\r\nInstall PyTorch Lightning\r\n```\r\nimport pathlib\r\nimport pytorch_lightning\r\nprint(list((pathlib.Path(pytorch_lightning.__file__).parent.p...
5788789f0164b984fdcb9d6390b3babbf5997fec
{ "head_commit": "692c2335ea669b3d5e625c5bc40420c5c9f8571b", "head_commit_message": "Remove check-manifest", "patch_to_review": "diff --git a/.github/workflows/ci_pkg-install.yml b/.github/workflows/ci_pkg-install.yml\nindex 12f3976d078e4..2cf64f39a28b7 100644\n--- a/.github/workflows/ci_pkg-install.yml\n+++ b/.g...
[ { "diff_hunk": "@@ -32,8 +32,6 @@\n from torchvision import transforms\n if _TORCHVISION_MNIST_AVAILABLE:\n from torchvision.datasets import MNIST\n-else:\n- from tests.helpers.datasets import MNIST", "line": null, "original_line": 36, "original_start_line": 35, "path": "pl_examples/b...
86dcf11aa17fae50addbb7f076c9c3a0e4a7366c
diff --git a/.github/workflows/ci_pkg-install.yml b/.github/workflows/ci_pkg-install.yml index 1fd7ed49d5a47..bf7de876d157e 100644 --- a/.github/workflows/ci_pkg-install.yml +++ b/.github/workflows/ci_pkg-install.yml @@ -26,12 +26,11 @@ jobs: - name: Prepare env run: | - pip install check-man...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-6730@cf1d339
Lightning-AI/pytorch-lightning
Python
6,730
Fix support for symlink save_dir in TensorBoardLogger
## What does this PR do? <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. If we didn't discuss your PR in Github issues there's a high chance it will not be merged. The follow...
2021-03-29T21:06:46Z
symlink not accepted as logger folder ## 🐛 Bug <!-- A clear and concise description of what the bug is. --> Moving `lightning_logs` to another filesystem and symlinking it so I don't need to touch my code, I notice that the logger rejects symlinked logger folders: `loggers/csv_logs.py if not os.path.i...
Hi @jowagner, thanks for the issue! I had a go at CSV logging to a symlink and it is working fine at least for me. The [`os.path.isdir` docs](https://docs.python.org/3/library/os.path.html#os.path.isdir) seem to suggest that it follows symlinks, so shouldn't be an issue. Can you maybe reproduce the bug in colab using t...
[ { "body": "## 🐛 Bug\r\n\r\n<!-- A clear and concise description of what the bug is. -->\r\n\r\nMoving `lightning_logs` to another filesystem and symlinking it so I don't need to touch my code, I notice that the logger rejects symlinked logger folders:\r\n\r\n`loggers/csv_logs.py if not os.path.isdir(roo...
f79a13e4956554eb68b103c12054bdb7cd4dbe1a
{ "head_commit": "cf1d339dc7abf725dfbe493564e0e662bf437104", "head_commit_message": "Simplify", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex 780a8790b9fdd..7a168ffacdc45 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -209,6 +209,9 @@ The format is based on [Keep a Changelog](http://keep...
[ { "diff_hunk": "@@ -12,15 +12,27 @@\n # See the License for the specific language governing permissions and\n # limitations under the License.\n \n+import os\n import io\n from distutils.version import LooseVersion\n from pathlib import Path\n from typing import IO, Union\n \n import fsspec\n+from fsspec.implem...
401c34434e8232f739649a44f7ee0350d53c7593
diff --git a/CHANGELOG.md b/CHANGELOG.md index 780a8790b9fdd..7a168ffacdc45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -209,6 +209,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed a bug where gradients were disabled after calling `Trainer.predict` ([#6657](https://githu...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-6537@afdb16c
Lightning-AI/pytorch-lightning
Python
6,537
Custom Plugin is_distributed
## What does this PR do? Adds support for custom plugins to specify if they are distributed. <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. If we didn't discuss your PR in Git...
2021-03-15T18:33:52Z
Custom Distributed Plugin Auto Add Distributed Sampler ## 🐛 Bug <!-- A clear and concise description of what the bug is. --> I have a custom distributed plugin, but it currently does not work PTL's automatic distributed sampler. Plugin looks like this: ``` class MyPlugin(ParallelPlugin): @property d...
[ { "body": "## 🐛 Bug\r\n\r\n<!-- A clear and concise description of what the bug is. -->\r\nI have a custom distributed plugin, but it currently does not work PTL's automatic distributed sampler.\r\n\r\nPlugin looks like this:\r\n```\r\nclass MyPlugin(ParallelPlugin):\r\n @property\r\n def distributed_sam...
ea36ee30b0a2eec1da693b42739aafed0389fbb9
{ "head_commit": "afdb16cd2a11c1f70bd2ded005ec695e92f26bfc", "head_commit_message": "dont return for tpu", "patch_to_review": "diff --git a/pytorch_lightning/trainer/connectors/accelerator_connector.py b/pytorch_lightning/trainer/connectors/accelerator_connector.py\nindex 99d716f6b5a8c..f3b92144bdc64 100644\n--- ...
[ { "diff_hunk": "@@ -273,6 +273,11 @@ def use_deepspeed(self) -> bool:\n \n @property\n def is_distributed(self) -> bool:\n+ # Used for custom plugins.\n+ # Custom plugins should implement is_distributed property.\n+ if hasattr(self.training_type_plugin, 'is_distributed') and not \\\...
a22a3e2a0bc6116600030f4628a07b774d24c5e9
diff --git a/pytorch_lightning/trainer/connectors/accelerator_connector.py b/pytorch_lightning/trainer/connectors/accelerator_connector.py index 99d716f6b5a8c..7ff288282259a 100644 --- a/pytorch_lightning/trainer/connectors/accelerator_connector.py +++ b/pytorch_lightning/trainer/connectors/accelerator_connector.py @@ ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-6625@95f5b48
Lightning-AI/pytorch-lightning
Python
6,625
Match the number of outputs of backward with forward for AllGatherGrad
## What does this PR do? <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. If we didn't discuss your PR in Github issues there's a high chance it will not be merged. The follow...
2021-03-22T06:44:00Z
RuntimeError: function AllGatherGradBackward returned an incorrect number of gradients (expected 2, got 1) ## 🐛 Bug <!-- A clear and concise description of what the bug is. --> When using `self.all_gather` in `training_step` to gather tensor with gradient function to compute and return loss throwing `RuntimeEr...
[ { "body": "## 🐛 Bug\r\n\r\n<!-- A clear and concise description of what the bug is. -->\r\n\r\nWhen using `self.all_gather` in `training_step` to gather tensor with gradient function to compute and return loss throwing \r\n`RuntimeError: function AllGatherGradBackward returned an incorrect number of gradients ...
870247ffe6a5ce819cf7e0a22b997a765d2f6675
{ "head_commit": "95f5b482c9ed32ee95d0a261850caf4a192b9ece", "head_commit_message": "add test_all_gather_sync_grads", "patch_to_review": "diff --git a/pytorch_lightning/utilities/distributed.py b/pytorch_lightning/utilities/distributed.py\nindex 658f349a22215..c28770a07deb7 100644\n--- a/pytorch_lightning/utiliti...
[ { "diff_hunk": "@@ -95,3 +95,39 @@ def training_epoch_end(self, outputs) -> None:\n \n trainer.fit(model)\n assert model.training_epoch_end_called\n+\n+\n+@RunIf(min_gpus=2, skip_windows=True, special=True)\n+def test_all_gather_sync_grads(tmpdir):\n+\n+ class TestModel(BoringModel):\n+\n+ tra...
bd0e22611a7c55e53c03de4ef18740c3393de7ed
diff --git a/pytorch_lightning/utilities/distributed.py b/pytorch_lightning/utilities/distributed.py index 658f349a22215..c28770a07deb7 100644 --- a/pytorch_lightning/utilities/distributed.py +++ b/pytorch_lightning/utilities/distributed.py @@ -172,7 +172,7 @@ def backward(ctx, *grad_output): torch.distribut...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-6667@e3f8502
Lightning-AI/pytorch-lightning
Python
6,667
More explicit exception message when testing with fast_dev_run=True
## What does this PR do? Fixes https://github.com/PyTorchLightning/pytorch-lightning/issues/6615. ## Before submitting - [x] Was this discussed/approved via a GitHub issue? (not for typos and docs) - [x] Did you read the [contributor guideline](https://github.com/PyTorchLightning/pytorch-lightning/blob/master/....
2021-03-24T20:14:51Z
Calling trainer.test() when using fast_dev_run throws confusing error ## 🐛 Bug Calling trainer.test() when using fast_dev_run throws confusing error: ```bash Traceback (most recent call last): ...
Dear @hobogalaxy, This happens because trainer.fit didn't generate a checkpoint and you don't provide model to trainer.test. Therefore, it doesn't find a model to load. This is expected behaviour but I agree the MisconfigurationException could be more explicit on what's wrong. Best, T.C @tchaton Thank you for ...
[ { "body": "## 🐛 Bug\r\n\r\nCalling trainer.test() when using fast_dev_run throws confusing error:\r\n```bash\r\nTraceback (most recent call last): \r\n...
dcf6e4e3105199f2137224435f803357de3c511e
{ "head_commit": "e3f8502573d92f7afce1530b45e54e62f9f54d41", "head_commit_message": "update changelog", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex 780a8790b9fdd..0dc0ef5cc3ab8 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -9,6 +9,8 @@ The format is based on [Keep a Changelog](http://...
[ { "diff_hunk": "@@ -1777,3 +1777,19 @@ def on_fit_start(self, trainer, pl_module: LightningModule) -> None:\n \n trainer = Trainer(default_root_dir=tmpdir, max_epochs=1, callbacks=[TestCallback()])\n trainer.fit(model, datamodule=dm)\n+\n+\n+@pytest.mark.parametrize(\"fast_dev_run\", [True, False])\n+de...
b15434da6174f1b763b7e1784a9279ffc5933ab0
diff --git a/CHANGELOG.md b/CHANGELOG.md index 79b253061ddb2..70d2abcd7a7af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Added + +- Added more explicit exception message when trying to execute `trainer.test()` or `...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-6802@a711a1a
Lightning-AI/pytorch-lightning
Python
6,802
[fix] Better support for rank_zero_only setting for SLURM and torchelastic
## What does this PR do? <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. If we didn't discuss your PR in Github issues there's a high chance it will not be merged. The follow...
2021-04-02T22:46:17Z
LOCAL_RANK not being set in slurm ## 🐛 Bug A lot of the PTL tooling around multiprocess depends on a specific environment variable: LOCAL_RANK being set correctly, it seems that when running in slurm this isnt set causing it to return the default of 0 for all processes which makes every process do things that shoul...
Adding the following to the `SLURMEnvironment` contrustructor does seem to work: ``` os.environ["LOCAL_RANK"] = os.environ["SLURM_PROCID"] rank_zero_only.rank = int(os.environ["SLURM_PROCID"]) ``` but I would like to get some feedback from the developers before proposing this as a solution. What's the value...
[ { "body": "## 🐛 Bug\r\n\r\nA lot of the PTL tooling around multiprocess depends on a specific environment variable: LOCAL_RANK being set correctly, it seems that when running in slurm this isnt set causing it to return the default of 0 for all processes which makes every process do things that should only be d...
b7a22ba046ba57072a71b12d16caff000e66f798
{ "head_commit": "a711a1a6a9630a3403fcc1cc4afe8ca926215b79", "head_commit_message": "Update distributed.py", "patch_to_review": "diff --git a/pytorch_lightning/utilities/distributed.py b/pytorch_lightning/utilities/distributed.py\nindex bf7a199fc08dc..b36ab3827e674 100644\n--- a/pytorch_lightning/utilities/distri...
[ { "diff_hunk": "@@ -44,8 +44,18 @@ def wrapped_fn(*args, **kwargs):\n return wrapped_fn\n \n \n+# TODO: this should be part of the cluster environment\n+def _get_local_rank() -> int:\n+ local_rank_keys = ('LOCAL_RANK', 'SLURM_LOCALID')", "line": null, "original_line": 49, "original_start_line...
c64ffffd9ff2779d31c44aed8548df078660bffb
diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d2629d3928f0..ed9b2d1586ea4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -176,6 +176,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Fixed +- Set better defaults for `rank_zero_only.rank` when training is launched with SLUR...
{ "difficulty": "medium", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-6419@80ce9d6
Lightning-AI/pytorch-lightning
Python
6,419
Add check for verbose attribute of ModelCheckpoint
## What does this PR do? Fixes #6408 ## Before submitting - [x] Was this discussed/approved via a GitHub issue? (not for typos and docs) - [x] Did you read the [contributor guideline](https://github.com/PyTorchLightning/pytorch-lightning/blob/master/.github/CONTRIBUTING.md), **Pull Request** section? - [x] Did y...
2021-03-08T20:10:53Z
Make verbose=False prevent showing "Saving latest checkpoint..." ## 🚀 Feature Currently Lightning prints: ``` [lightning][INFO] - Saving latest checkpoint... ``` when running training with `ModelCheckpoint(verbose=False)`. Not sure if it's a bug or intended... Can we make it to not log that when passing `ve...
Sure, just need to check the verbose attribute of the checkpoints here: https://github.com/PyTorchLightning/pytorch-lightning/blob/38a5fe7af1ba300aa95d7716b5bdee35d52d032b/pytorch_lightning/trainer/training_loop.py#L157-L158 Do you want to open a PR with the fix? @carmocca I made a PR https://github.com/PyTorchLi...
[ { "body": "## 🚀 Feature\r\nCurrently Lightning prints:\r\n```\r\n[lightning][INFO] - Saving latest checkpoint...\r\n```\r\nwhen running training with `ModelCheckpoint(verbose=False)`.\r\n\r\nNot sure if it's a bug or intended...\r\n\r\nCan we make it to not log that when passing `verbose=False`?\r\n", "num...
e1f5eacab98670bc1de72c88657404a15aadd527
{ "head_commit": "80ce9d6d9e5a9f4afa8a118c0270d3ecc077b0c1", "head_commit_message": "Fix test_model_checkpoint_save_last_warning", "patch_to_review": "diff --git a/pytorch_lightning/trainer/training_loop.py b/pytorch_lightning/trainer/training_loop.py\nindex 7ad035e1f56b4..88b87afcb9358 100644\n--- a/pytorch_ligh...
[ { "diff_hunk": "@@ -672,19 +672,27 @@ def test_default_checkpoint_behavior(tmpdir):\n @pytest.mark.parametrize('max_epochs', [1, 2])\n @pytest.mark.parametrize('should_validate', [True, False])\n @pytest.mark.parametrize('save_last', [True, False])\n-def test_model_checkpoint_save_last_warning(tmpdir, caplog, m...
97f77fcef9e254bab12850bcd2b55a7aba6ec64b
diff --git a/pytorch_lightning/trainer/training_loop.py b/pytorch_lightning/trainer/training_loop.py index 7ad035e1f56b4..88b87afcb9358 100644 --- a/pytorch_lightning/trainer/training_loop.py +++ b/pytorch_lightning/trainer/training_loop.py @@ -154,7 +154,7 @@ def check_checkpoint_callback(self, should_update, is_last=...
{ "difficulty": "low", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-6398@52b81d9
Lightning-AI/pytorch-lightning
Python
6,398
Improve DummyLogger
## What does this PR do? Fixes #6395 This PR makes the methods in `DummyLogger` accept arbitrary positional and keyword inputs. The new test fails on master. ## Before submitting - [x] Was this discussed/approved via a GitHub issue? (not for typos and docs) - [x] Did you read the [contributor guideline](htt...
2021-03-07T20:31:57Z
fast_dev_run fail on log_hyperparams ## 🐛 Bug Issue when running: `fast_dev_run=True` "TypeError: log_hyperparams() takes 2 positional arguments but 3 were given" ### To Reproduce When using the following: Where self.hp_metrics is a list of strings where each string is an available metric that is being logged,...
```python import torch from torch.utils.data import Dataset from pytorch_lightning import LightningModule, Trainer class RandomDataset(Dataset): def __init__(self, size, length): self.len = length self.data = torch.randn(length, size) def __getitem__(self, index): re...
[ { "body": "## 🐛 Bug\r\nIssue when running: `fast_dev_run=True`\r\n\"TypeError: log_hyperparams() takes 2 positional arguments but 3 were given\"\r\n\r\n### To Reproduce\r\n\r\nWhen using the following: Where self.hp_metrics is a list of strings where each string is an available metric that is being logged, exa...
a6c98c4e4944cfc4977d27a4ea1e0c7c621dfb4d
{ "head_commit": "52b81d9cff2523c1d248115d7b78f9ca4d5b04db", "head_commit_message": "add changelog", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex ed7eec7cff7f9..56f87493f5085 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -110,7 +110,7 @@ The format is based on [Keep a Changelog](http:/...
[ { "diff_hunk": "@@ -452,7 +453,8 @@ def name(self):\n def version(self):", "line": null, "original_line": 453, "original_start_line": null, "path": "pytorch_lightning/loggers/base.py", "start_line": null, "text": "@user1:\nthe return values for name/version don't match the base inter...
3393bc647db1fabf140a5afe66b4c8a6a0916eba
diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c28c3b64935f..59cd2de7f27dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -122,6 +122,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed `Trainer` not resetting `lightning_optimizers` when calling `Trainer.fit()` multiple times...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-5923@7062744
Lightning-AI/pytorch-lightning
Python
5,923
Fix: passing wrong strings for scheduler interval doesn't throw an error
## What does this PR do? - Raises `MisconfigurationException` if scheduler's interval parameter is not one of `epoch`, `step` - Adds a test case to verify this behavior <!-- IMPORTANT: We separated bug-fix PRs and feature PRs and they shall land in master and release/1.X-dev accordingly. By default all PR are t...
2021-02-11T15:39:40Z
Passing wrong strings for scheduler interval doesn't throw an error I noticed that when you pass an interval as scheduler parameter that is not 'step' or 'epoch' (for example 'batch') there's no error, it just trains without ever calling the scheduler. Had to look into the source code because I didn't find much info ab...
@finnBsch that is a good observation, mind sending a PR with adding assert or check/raise with exception? I am not sure where the argument gets assigned.. I just know that there is no check for it in `update_learning_rates`, however I am sure that it gets assigned somewhere earlier but I cannot find it. @finnBsch here ...
[ { "body": "I noticed that when you pass an interval as scheduler parameter that is not 'step' or 'epoch' (for example 'batch') there's no error, it just trains without ever calling the scheduler. Had to look into the source code because I didn't find much info about it in the documentation", "number": 5548,...
ae19c9723ba2007ea28dd57c4df65eeea41be3ae
{ "head_commit": "706274432b7d444bd3595a94351df9bbc3c24114", "head_commit_message": "Add test for unknown 'interval' value in scheduler", "patch_to_review": "diff --git a/pytorch_lightning/trainer/optimizers.py b/pytorch_lightning/trainer/optimizers.py\nindex 6772dcc645e3b..c94b51c2bfd95 100644\n--- a/pytorch_lig...
[ { "diff_hunk": "@@ -459,6 +459,24 @@ def test_unknown_configure_optimizers_raises(tmpdir):\n trainer.fit(model)\n \n \n+def test_lr_scheduler_with_unknown_interval_raises(tmpdir):\n+ \"\"\"\n+ Test exception when lr_scheduler dict has unknown interval param value\n+ \"\"\"\n+ model = EvalMod...
82c1da05870bfdd5b1181238586d59b57a26c33e
diff --git a/pytorch_lightning/trainer/optimizers.py b/pytorch_lightning/trainer/optimizers.py index 6772dcc645e3b..6793a370fdc35 100644 --- a/pytorch_lightning/trainer/optimizers.py +++ b/pytorch_lightning/trainer/optimizers.py @@ -117,6 +117,12 @@ def configure_schedulers(self, schedulers: list, monitor: Optional[str...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-5952@d4a6e83
Lightning-AI/pytorch-lightning
Python
5,952
Fix validation progress counter with check_val_every_n_epoch > 1
## What does this PR do? <!-- IMPORTANT: We separated bug-fix PRs and feature PRs and they shall land in master and release/1.X-dev accordingly. By default all PR are targeted to master which is correct for bug-fixes, but need to be change for features. If you miss it we can still fix it for you, just ping us...
2021-02-13T03:10:05Z
validating bar keep showing 0 when check_val_every_n_epoch is bigger than 1 ## 🐛 Bug Normally, the validating bar should update according to the procedure of validation_step, but when I set check_val_every_n_epoch bigger than 1, 2 for example, it keeps showing 0it. I encountered this issue under a terminal envir...
Hi! thanks for your contribution!, great first issue! @ZhichaoDuan can you reproduce this using the BoringModel? Same issue here. Setting check_val_every_n_epoch to 2 gives me a validation progress bar stuck at `Validating: 0it [00:00, ?it/s]`. Perhaps related; the first epoch (either correctly or not depending on w...
[ { "body": "## 🐛 Bug\r\n\r\nNormally, the validating bar should update according to the procedure of validation_step, but when I set check_val_every_n_epoch bigger than 1, 2 for example, it keeps showing 0it.\r\n\r\nI encountered this issue under a terminal environment.\r\n\r\n\r\n\r\n - PyTorch 1.6.0:\r\n - Li...
680e83adab38c2d680b138bdc39d48fc35c0cb58
{ "head_commit": "d4a6e83f3e546d0ad35a566ab59f23bd1df99fb2", "head_commit_message": "add test", "patch_to_review": "diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml\nindex 21c52539a890d..ef5fdc8101045 100644\n--- a/.pre-commit-config.yaml\n+++ b/.pre-commit-config.yaml\n@@ -17,7 +17,7 @@ default_lan...
[ { "diff_hunk": "@@ -17,7 +17,7 @@ default_language_version:\n \n repos:\n - repo: https://github.com/pre-commit/pre-commit-hooks\n- rev: v2.3.0\n+ rev: v3.4.0", "line": null, "original_line": 20, "original_start_line": null, "path": ".pre-commit-config.yaml", "start_line": null, ...
e1b09c58a49d292035bb53d1c08e0a1bf8d3d52d
diff --git a/pytorch_lightning/callbacks/progress.py b/pytorch_lightning/callbacks/progress.py index 74e57e2b5642e..489ef081bcc7c 100644 --- a/pytorch_lightning/callbacks/progress.py +++ b/pytorch_lightning/callbacks/progress.py @@ -149,9 +149,10 @@ def total_val_batches(self) -> int: validation dataloader is ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-5872@c7c7f61
Lightning-AI/pytorch-lightning
Python
5,872
Report leaking environment variables in tests
## What does this PR do? Currently Lightning "pollutes" the environment with variables. To some degree, this is necessary for example for multiprocessing etc. but unfortunately the variables don't get cleaned up properly, and it may not be so obvious where and what to clean up. We currently have this fixture whic...
2021-02-08T19:22:52Z
strange behavior with tests in PL: tests influence each other ## 🐛 Bug I observed that some tests under tests/trainer have very strange behavior. The order in which the tests are executed seems to matter and they are influencing each other! ### To Reproduce 1. Checkout` release/1.2-dev` branch 2. Remove the ...
Hey @awaelchli, Could it be linked to the new predict function. There is a bug which i badly solved there: https://github.com/PyTorchLightning/pytorch-lightning/pull/5752/files#diff-667a2513c158c2b01d73b479e4dea75587d8531f9cd286891d34570a2fd145dcR427 Best, T.C
[ { "body": "## 🐛 Bug\r\n\r\nI observed that some tests under tests/trainer have very strange behavior. The order in which the tests are executed seems to matter and they are influencing each other!\r\n\r\n### To Reproduce\r\n\r\n1. Checkout` release/1.2-dev` branch\r\n2. Remove the `predict()` method in one of ...
8dcba38e0e13c288c9af8746d8edfe3097714926
{ "head_commit": "c7c7f6100d323c7b28ac50c15c7492f9ce41940c", "head_commit_message": "Add RANK from DeepSpeed", "patch_to_review": "diff --git a/tests/conftest.py b/tests/conftest.py\nindex 9efe445ce812f..6c111f606516d 100644\n--- a/tests/conftest.py\n+++ b/tests/conftest.py\n@@ -47,9 +47,26 @@ def restore_env_var...
[ { "diff_hunk": "@@ -47,9 +47,26 @@ def restore_env_variables():\n \"\"\"Ensures that environment variables set during the test do not leak out.\"\"\"\n env_backup = os.environ.copy()\n yield\n+ leaked_vars = os.environ.keys() - env_backup.keys()\n # restore environment as it was before runnin...
9f00db2ddf572d8aaa3b0fc83d8b745d92dc8883
diff --git a/tests/conftest.py b/tests/conftest.py index 9efe445ce812f..2a365fc497b28 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -47,9 +47,30 @@ def restore_env_variables(): """Ensures that environment variables set during the test do not leak out.""" env_backup = os.environ.copy() yield +...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-5280@c919023
Lightning-AI/pytorch-lightning
Python
5,280
[Metrics] [Docs] Add section about device placement
## What does this PR do? <!-- IMPORTANT: We separated bug-fix PRs and feature PRs and they shall land in master and release/1.X-dev accordingly. By default all PR are targeted to master which is correct for bug-fixes, but need to be change for features. If you miss it we can still fix it for you, just ping us...
2020-12-27T19:57:43Z
metrics fail if inputs are on gpu The metrics precision and recall fail if inputs are on gpu. ``` >>> from pytorch_lightning.metrics import Precision >>> target = torch.tensor([0, 1, 2, 0, 1, 2]).cuda() >>> preds = torch.tensor([0, 2, 1, 0, 0, 1]).cuda() >>> precision = Precision(num_classes=3) >>> precision(pred...
@teddykoker mind have a look? We could move the metrics to GPUS if both provided arguments are on GPUs. Metrics are subclass of `nn.Module` and their states behave similar to the parameters and buffers of other modules. Therefore, calling `precision.cuda()` before evaluating the metric should solve your problem. It is...
[ { "body": "The metrics precision and recall fail if inputs are on gpu.\r\n```\r\n>>> from pytorch_lightning.metrics import Precision\r\n>>> target = torch.tensor([0, 1, 2, 0, 1, 2]).cuda()\r\n>>> preds = torch.tensor([0, 2, 1, 0, 0, 1]).cuda()\r\n>>> precision = Precision(num_classes=3)\r\n>>> precision(preds, ...
0c7c9e85404ce4be33cc65f95a029b6bc03d84e4
{ "head_commit": "c919023a51a65fc818230e4ddeb12943ce42c763", "head_commit_message": "Update docs/source/metrics.rst\n\nCo-authored-by: Shreeyak <shreeyak.sajjan@gmail.com>", "patch_to_review": "diff --git a/docs/source/metrics.rst b/docs/source/metrics.rst\nindex 387cbc3bd7482..f99ee799e28cf 100644\n--- a/docs/so...
[ { "diff_hunk": "@@ -137,6 +137,56 @@ This metrics API is independent of PyTorch Lightning. Metrics can directly be us\n To change this, after initializing the metric, the method ``.persistent(mode)`` can\n be used to enable (``mode=True``) or disable (``mode=False``) this behaviour.\n \n+***************...
c6b105319269680264ff866e1e49ad71a7084180
diff --git a/docs/source/metrics.rst b/docs/source/metrics.rst index 387cbc3bd7482..d6d9cb8fb0ae7 100644 --- a/docs/source/metrics.rst +++ b/docs/source/metrics.rst @@ -137,6 +137,56 @@ This metrics API is independent of PyTorch Lightning. Metrics can directly be us To change this, after initializing the metric, t...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-5638@035b72f
Lightning-AI/pytorch-lightning
Python
5,638
Bugfix/5487 auto lr ordering
## What does this PR do? before: auto learning rate finder fails AFTER optimization due to misconfiguration after: auto learning rate finder fails BEFORE optimization due to misconfiguration, and user can fail faster. Fixes #5487 ## Before submitting - [x] Was this discussed/approved via a GitHub issue? (not...
2021-01-24T14:47:00Z
auto learning rate finder fails AFTER optimization due to misconfiguration ## 🐛 Bug Optimizing learning rate using auto_lr_find=True fails **AFTER** a learning rate was found with error `pytorch_lightning.utilities.exceptions.MisconfigurationException: When auto_lr_find is set to True, expects that `model` or `mod...
good catch! Mind send a PR with a fix? > > > good catch! Mind send a PR with a fix? I actually never contributed to open source before :) How does this work? I get assigned and there's a deadline? is there a readme? I want to do it! We have a basic guide [here](https://github.com/PyTorchLightning/pytorch-...
[ { "body": "## 🐛 Bug\r\nOptimizing learning rate using auto_lr_find=True fails **AFTER** a learning rate was found with error\r\n\r\n`pytorch_lightning.utilities.exceptions.MisconfigurationException: When auto_lr_find is set to True, expects that `model` or `model.hparams` either has field `lr` or `learning_rat...
d71659b42a13946b854d49f5bb1bf6e2bcd5b9b2
{ "head_commit": "035b72f7739ebd35c9d0302aae2728166d270251", "head_commit_message": "Update pytorch_lightning/tuner/lr_finder.py", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex e614476071eaa..cea118de512a5 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -35,6 +35,9 @@ The format is based ...
[ { "diff_hunk": "@@ -262,3 +264,12 @@ def test_suggestion_with_non_finite_values(tmpdir):\n \n assert before_lr == after_lr, \\\n 'Learning rate was altered because of non-finite loss values'\n+\n+\n+def test_lr_finder_fails_fast_on_bad_config(tmpdir):\n+ \"\"\" Test that tune fails if the model d...
042bfda7c0bc3595c9ff033b4b62c95294e824bd
diff --git a/CHANGELOG.md b/CHANGELOG.md index e614476071eaa..cea118de512a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Remove unnecessary intermediate layers in Dockerfiles ([#5697](https://github.com/PyTorchLightning...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-4948@babb73d
Lightning-AI/pytorch-lightning
Python
4,948
Add Trainer.validate(…) method to run one validation epoch
## What does this PR do? author: @carmocca, original author: @EliaCereda * Actually adds the new `Trainer.validate(…)` method, which performs one evaluation epoch over the validation set. * Adds tests for the new feature * Lots of test cleanups Fixes #4634 Addresses #4170, although a full solution for that ...
2020-12-02T15:57:08Z
Evaluation over the validation set What is the recommended way of performing just one evaluation over the validation set? Basically, I'm looking for the equivalent of `trainer.test(...)` but for the validation set. Maybe this is possible using `trainer.fit(...)` and some combination of arguments to `Trainer.__init__...
Is there a difference between your `validation_step` and `test_step`? If not you could just feed in the validation set to `trainer.test(test_dataloaders=val_dataloaders)`. Yes, this would be acceptable, but I forgot to specify that I'm using a data module to manage the data loaders. There is no way to pass the data mod...
[ { "body": "What is the recommended way of performing just one evaluation over the validation set? Basically, I'm looking for the equivalent of `trainer.test(...)` but for the validation set.\r\n\r\nMaybe this is possible using `trainer.fit(...)` and some combination of arguments to `Trainer.__init__`? ", "n...
615b2f736303ad3cd56b33111f69952255f01c0f
{ "head_commit": "babb73da7d58dd87e11f52ff329fe2104bb7cd35", "head_commit_message": "Same threshold", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex f78569c1b7a0b..3cb5c26d6fc3a 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -21,6 +21,9 @@ The format is based on [Keep a Changelog](http://...
[ { "diff_hunk": "@@ -903,42 +969,17 @@ def __evaluate_using_weights(\n if ckpt_path == 'best':\n ckpt_path = self.checkpoint_callback.best_model_path\n \n- if len(ckpt_path) == 0:\n- rank_zero_warn(\n- f'`.test()` found no path for the best...
8fab50f035c328ead9e7f73b7e2f35ab3cfd5451
diff --git a/CHANGELOG.md b/CHANGELOG.md index 046e07cc55736..73c16dbd5e2aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added `TrainerState.{FITTING,VALIDATING,TESTING,PREDICTING,TUNING}` ([#4945](https://github.com/Py...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Test Suite / CI Enhancements" }
Lightning-AI__pytorch-lightning-4942@c0b0006
Lightning-AI/pytorch-lightning
Python
4,942
docs: default_root_path -> default_root_dir
## What does this PR do? Remove occurrences of default_root_path: the argument is default_root_dir for `Trainer`. Fixes #4926 ## Before submitting - [x] Was this discussed/approved via a Github issue? (no need for typos and docs improvements) - [x] Did you read the [contributor guideline](https://github.com...
2020-12-02T02:13:37Z
default_root_path vs default_root_dir I noticed that the argument to Trainer is `default_root_dir`, but the docs sometimes show `default_root_path`. I did a grep on the codebase for `default_root_path`, and here are the results: ``` ./notebooks/05-trainer-flags-overview.ipynb:2155: "trainer = pl.Trainer(default_...
Hi! thanks for your contribution!, great first issue! It should be fine. Can you open a PR?
[ { "body": "I noticed that the argument to Trainer is `default_root_dir`, but the docs sometimes show `default_root_path`. I did a grep on the codebase for `default_root_path`, and here are the results:\r\n\r\n```\r\n./notebooks/05-trainer-flags-overview.ipynb:2155: \"trainer = pl.Trainer(default_root_path=os...
7b7d4bb86d2c28ccc8b13953481f084d6f8accf7
{ "head_commit": "c0b00060eb625af58872669a0479e9d593b204ff", "head_commit_message": "Apply suggestions from code review", "patch_to_review": "diff --git a/docs/source/trainer.rst b/docs/source/trainer.rst\nindex c390db8d7537e..55914eb686539 100644\n--- a/docs/source/trainer.rst\n+++ b/docs/source/trainer.rst\n@@ ...
[ { "diff_hunk": "@@ -48,7 +48,7 @@ class TrainerProperties(ABC):\n limit_val_batches: int\n _default_root_dir: str\n _weights_save_path: str\n- default_root_path: str\n+ default_root_dir: str", "line": null, "original_line": 51, "original_start_line": null, "path": "pytorch_ligh...
f49cbe0ce9a64e81cf9161724301918ab4112195
diff --git a/docs/source/trainer.rst b/docs/source/trainer.rst index d49011837fe85..92b6b290176f5 100644 --- a/docs/source/trainer.rst +++ b/docs/source/trainer.rst @@ -612,10 +612,10 @@ stored. If you don't then use this argument for convenience. Paths can be local paths or remote paths such as `s3://bucket/path` or ...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Documentation Updates" }
Lightning-AI__pytorch-lightning-6195@ed5a7f0
Lightning-AI/pytorch-lightning
Python
6,195
TensorBoardLogger sub_dir parameter for grouping logs
## What does this PR do? **TLDR:** Adds a `sub_dir` parameter for the `TensorBoardLogger` useful for grouping multiple runs in one folder as per #6019. Although in #6019 I advocated for a general `sub_dir` arg for all logger instances to I eventually added it as a `TensorBoardLogger`-only parameter. Therefore, th...
2021-02-25T10:10:19Z
Support Tensorboard logs dir structure costumizaton Feature request: As a user, i would like to have control over checkpoint dir name and structure. Motivation: From @janhenriklambrechts (janhenrik.lambrechts@gmail.com): My logging version directory of a single pytorch-lighting project with tensorboard logs lo...
I propose a ```sub_dir``` argument for ```Logger``` objects. The default behaviour for multiple experiments and loggers right now looks something like this: ``` logs └── default └── version_0 ├── checkpoints │   └── epoch=85.ckpt ├── comet_log_0.out ├── comet_log_1.out ...
[ { "body": "Feature request:\r\nAs a user, i would like to have control over checkpoint dir name and structure.\r\n\r\nMotivation: \r\nFrom @janhenriklambrechts (janhenrik.lambrechts@gmail.com):\r\n\r\nMy logging version directory of a single pytorch-lighting project with tensorboard logs looks something like th...
20f63377f81f4771d3f128f979b3a0f9b8d219a7
{ "head_commit": "ed5a7f02e398b8468a3563306d809ca836dfe1a2", "head_commit_message": "Update pytorch_lightning/loggers/tensorboard.py\n\nCo-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex 06656907ef442..5a0f43de3a5d1 ...
[ { "diff_hunk": "@@ -114,13 +119,18 @@ def log_dir(self) -> str:\n \"\"\"\n # create a pseudo standard path ala test-tube\n version = self.version if isinstance(self.version, str) else f\"version_{self.version}\"\n- log_dir = os.path.join(self.root_dir, version)\n+ sub_dir =...
3fb1bec0a14874f5f6f2af712e97ca6c877443f2
diff --git a/CHANGELOG.md b/CHANGELOG.md index 82ce08594b310..09b2fbe0df195 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added `clip_grad_by_value` support for TPUs ([#7025](https://github.com/PyTorchLightning/pytorch-l...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
Lightning-AI__pytorch-lightning-5050@1c3bc82
Lightning-AI/pytorch-lightning
Python
5,050
feat(wandb): offset logging step when resuming
## What does this PR do? <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. If we didn't discuss your PR in Github issues there's a high chance it will not be merged. --> When ...
2020-12-10T03:12:25Z
WandB-Logger drops all the logged values in training step for PyTorch Lightning train-step: ``` def training_step(self, batch, batch_idx): x, y = batch logits, masks = self(x) loss = self.loss_func(logits, y) self.log(f"train-loss", loss, prog_bar=True) ...
Hi @IsCoelacanth How are you logging the other parameters (precision and recall)? I have this issue too! PyTorch Lightning resets step to 0 at the start of a new epoch, but wandb expects step to keep increasing and seems to ignore that we're on a new epoch. I don't know how to resolve this, it seems like a mismatch o...
[ { "body": "train-step:\r\n```\r\ndef training_step(self, batch, batch_idx):\r\n x, y = batch\r\n logits, masks = self(x)\r\n loss = self.loss_func(logits, y)\r\n self.log(f\"train-loss\", loss, prog_bar=True)\r\n return {\r\n \"loss\": loss,\...
4c34855c57e4af535e26fca8fc8173e7f5c0d8ad
{ "head_commit": "1c3bc82dd6ee6d1d765532f1fd9462260ccd2d59", "head_commit_message": "feat: improve warning\n\nCo-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>", "patch_to_review": "diff --git a/pytorch_lightning/loggers/wandb.py b/pytorch_lightning/loggers/wandb.py\nindex 24007c3a04307..7b3cf26403717 1006...
[ { "diff_hunk": "@@ -154,6 +161,9 @@ def log_metrics(self, metrics: Dict[str, float], step: Optional[int] = None) ->\n assert rank_zero_only.rank == 0, 'experiment tried to log from global_rank != 0'\n \n metrics = self._add_prefix(metrics)\n+ if not WandbLogger.WARNING_DISPLAYED and (step...
78e0d19e9dae485706252bb480ee041b60c5674f
diff --git a/pytorch_lightning/loggers/wandb.py b/pytorch_lightning/loggers/wandb.py index 1c02dd65be072..455635690f5c9 100644 --- a/pytorch_lightning/loggers/wandb.py +++ b/pytorch_lightning/loggers/wandb.py @@ -31,6 +31,7 @@ from pytorch_lightning.loggers.base import LightningLoggerBase, rank_zero_experiment from...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-4770@bb802e2
Lightning-AI/pytorch-lightning
Python
4,770
Cast hparams to dict when not using omegaconf
## What does this PR do? <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. If we didn't discuss your PR in Github issues there's a high chance it will not be merged. --> Fixes...
2020-11-19T08:01:12Z
Replace AttributeDict in with dict in checkpoint ## 🚀 Feature When we save hyperparameters to the checkpoint, we save them in a Lightning datastructure called AttributeDict. We should replace this with a regular dict when saving the checkpoint. ### Motivation Allows loading checkpoints with `torch.load` in ...
wasn't this resolved here: https://github.com/PyTorchLightning/pytorch-lightning/issues/2653 maybe someone changed it again. thanks for pointing to the linked pr. A week ago I inspected the checkpoint and the type was AttributeDict. I will check again Yeah this is odd, last I tested it was loading fine (without pl)...
[ { "body": "## 🚀 Feature\r\n\r\nWhen we save hyperparameters to the checkpoint, we save them in a Lightning datastructure called AttributeDict. \r\nWe should replace this with a regular dict when saving the checkpoint.\r\n\r\n### Motivation\r\n\r\nAllows loading checkpoints with `torch.load` in environments whe...
4803f681b06b54e401d249809331216107a48e0d
{ "head_commit": "bb802e2daf94c3f964503cbbdc8cbed919da6040", "head_commit_message": "Merge branch 'master' into hparams_dict", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex 8a03085024776..1a4da285179ed 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -60,6 +60,29 @@ The format is based on ...
[ { "diff_hunk": "@@ -27,6 +27,9 @@\n import cloudpickle\n import pytest\n import torch\n+from omegaconf import Container\n+from omegaconf import OmegaConf", "line": null, "original_line": 31, "original_start_line": 30, "path": "tests/checkpointing/test_model_checkpoint.py", "start_line": null...
539bb820e1bc90e2790a5c15117364c21bc8c67b
diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a03085024776..1a4da285179ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,29 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). +## [unreleased.BugFix] - YYYY-MM-DD + +### Added + + + +### Changed + + + +### Deprecated + +...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Code Refactoring / Architectural Improvement" }
Lightning-AI__pytorch-lightning-5043@2aa1fad
Lightning-AI/pytorch-lightning
Python
5,043
Enables reload of dataloaders on every n epochs from every epoch
## What does this PR do? This PR extends the logic of reloading dataloaders on every epoch allowing DLs to be reloaded every n epochs. It changes the argument from `reload_dataloaders_every_epoch ` to `reload_dataloaders_every_n_epochs `. The parameter accepts an `int`>= 0. The default value is 0 Fixes #5001 ...
2020-12-09T17:06:28Z
[Enhance] Update reload_dataloaders_every_epoch to reload_dataloaders_every_n_epoch ## 🚀 Feature `reload_dataloaders_every_epoch` reloads dataloader every epoch. We can change it to reload dataloaders after every n epochs. It will accept both bool and int values. `True` will be treated as 1 and `False` will be treate...
cc @PyTorchLightning/core-contributors is this a good feature to have?? This issue has been automatically marked as stale because it hasn't had any recent activity. This issue will be closed in 7 days if no further activity occurs. Thank you for your contributions, Pytorch Lightning Team!
[ { "body": "## 🚀 Feature\r\n`reload_dataloaders_every_epoch` reloads dataloader every epoch. We can change it to reload dataloaders after every n epochs. It will accept both bool and int values. `True` will be treated as 1 and `False` will be treated as 0 (means no reload).\r\n\r\n### Motivation\r\nRecently a r...
bca5adf6de1ae74c7103839aac54c8648464bee6
{ "head_commit": "2aa1fad285595c0d12177ece66f53c4fc7b59afe", "head_commit_message": "Fix CHANGELOG. Update deprecation versions", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex 114f1af38f82c..b951a593e49e3 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -54,6 +54,7 @@ The format is based o...
[ { "diff_hunk": "@@ -254,6 +255,12 @@ def progress_bar_dict(self) -> dict:\n all_metrics.update(**logged_metrics)\n return all_metrics\n \n+ @property\n+ def should_reload_dl_epoch(self) -> bool:", "line": null, "original_line": 259, "original_start_line": null, "path": "pyt...
e173cee32a883d4ce0534686233112b836b31079
diff --git a/CHANGELOG.md b/CHANGELOG.md index a32265dbe55f3..dfcacc2f62229 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -212,6 +212,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - MLflowLogger now uses the env variable `MLFLOW_TRACKING_URI` as default tracking uri ([#7457](...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
Lightning-AI__pytorch-lightning-4704@854e942
Lightning-AI/pytorch-lightning
Python
4,704
Reformat iou [func] and add IoU class
## What does this PR do? <!-- --> This PR makes some changes related to iou: * Change `iou` (functional) to be more flexible to input float value. The code is rewritten to use confusion matrix to get the score. * Add a `IoU` class which functions the same as (new) `iou`. I tested this class on my machine,...
2020-11-17T02:37:07Z
IOU Class Metric Module ## 🚀 Feature Is there a reason why IOU doesn't have a class metric module (currently the only classification class metrics implemented are: Accuracy, Precision, Recall, Fbeta)? Is this already on the roadmap? I implemented a version below. Does this look good? If so, should I submit a PR? ...
Hi! thanks for your contribution!, great first issue! Hi @zmurez It is definitely on the roadmap that all metrics in the functional backend should have a counterpart in the class backend. After we revamped class metric in v1.0 we are slowly adding class interfaces. We have just not reached IOU jet. That said, we wo...
[ { "body": "## 🚀 Feature\r\nIs there a reason why IOU doesn't have a class metric module (currently the only classification class metrics implemented are: Accuracy, Precision, Recall, Fbeta)? Is this already on the roadmap?\r\n\r\nI implemented a version below. Does this look good? If so, should I submit a PR?\...
06668c0ddf745a712c0acc142c0c93de6ccd3bdc
{ "head_commit": "854e942575a98e9f7772f70d5bccf91db413d738", "head_commit_message": "fix tests", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex 3db41991aaed6..bf57307a8c4a4 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -39,6 +39,9 @@ The format is based on [Keep a Changelog](http://keepa...
[ { "diff_hunk": "@@ -0,0 +1,108 @@\n+# Copyright The PyTorch Lightning team.\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+# http://www.apache.org/licenses/LICENS...
13bba6d522c35d52db8e6d66d1fd8f31f40d8f42
diff --git a/CHANGELOG.md b/CHANGELOG.md index 3db41991aaed6..7808e8d61c83f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added `.clone()` method to metrics ([#4318](https://github.com/PyTorchLightning/pytorch-lightning/...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
Lightning-AI__pytorch-lightning-4658@a769a2c
Lightning-AI/pytorch-lightning
Python
4,658
optimizer clean up
## What does this PR do? <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. If we didn't discuss your PR in Github issues there's a high chance it will not be merged. --> This ...
2020-11-13T14:26:27Z
Wrap optimizer in LightningOptimizer object for manual optimization Currently users are overriding optimizer_step in Lightning model, and therefore lose support for tpu, amp, etc... By wrapping their optimizers, we can make sure that when they call optimizer.step, everything is done properly. It allows us to remove...
@awaelchli
[ { "body": "Currently users are overriding optimizer_step in Lightning model, and therefore lose support for tpu, amp, etc...\r\nBy wrapping their optimizers, we can make sure that when they call optimizer.step, everything is done properly.\r\n\r\nIt allows us to remove the need for manual_backward / manual_opti...
2fe1eff85d6490f1ab08b88544a6205fb3cb7392
{ "head_commit": "a769a2c70adaa01fb2c1a51b53309c72fcf4c293", "head_commit_message": "Update pytorch_lightning/core/optimizer.py\n\nCo-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex c87c3811a8003..4d2c8f29b918a 100644\n--- a/CHANGELOG.md...
[ { "diff_hunk": "@@ -1316,7 +1171,7 @@ def optimizer_step(\n By default, Lightning calls ``step()`` and ``zero_grad()`` as shown in the example\n once per optimizer.\n \n- .. tip:: Consider using `manual_optimizer_step` instead of overriding this method as done previously.\n+ .. tip...
53b6921d033e85b889a4087c5748955aa60449ca
diff --git a/CHANGELOG.md b/CHANGELOG.md index c87c3811a8003..88ce3aece5fd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added printing of total num of params, trainable and non-trainable params in ModelSummary ([#452...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
Lightning-AI__pytorch-lightning-4485@5d70185
Lightning-AI/pytorch-lightning
Python
4,485
[bug-fix] DDP and automatic_optimization=False
## What does this PR do? <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. --> In `automatic_optimizaiton=False`, if the user returned a detached `tensor`, it creates a RuntimeEr...
2020-11-02T18:07:05Z
Error with DDP and automatic_optimization=False ## 🐛 Bug <!-- A clear and concise description of what the bug is. --> When running with `distributed_backend="ddp"` and `automatic_optimization=False`, there is an error when returning a detached tensor. More details below. I'm using lightning version 1.0.4; I also...
Hey @catalys1, Interesting behaviour. I was able to reproduce this bug. Let me investigate deeper :) Best, T.C
[ { "body": "## 🐛 Bug\r\n\r\n<!-- A clear and concise description of what the bug is. -->\r\n\r\nWhen running with `distributed_backend=\"ddp\"` and `automatic_optimization=False`, there is an error when returning a detached tensor. More details below. I'm using lightning version 1.0.4; I also saw the same thing...
abf1d4b992ea9c0ff4cbada136583d376d0e5848
{ "head_commit": "5d7018529e4834bc684e79abc9a6dc27adc766ef", "head_commit_message": "Removed unnecessary get model from native amp", "patch_to_review": "diff --git a/.gitignore b/.gitignore\nindex fff549a718794..946d5f0f4c2ca 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -33,6 +33,7 @@ timit_data/\n .Python\n id...
[ { "diff_hunk": "@@ -355,3 +357,272 @@ def configure_optimizers(self):\n \n num_manual_backward_calls = 3\n assert trainer.dev_debugger.count_events('backward_call') == limit_train_batches * num_manual_backward_calls\n+\n+\n+class ManualOptimizationExtendedModel(BoringModel):\n+\n+ count = 0\n+ cal...
b03b4d75a35814f714abb869525f73818fffc9cd
diff --git a/.gitignore b/.gitignore index fff549a718794..946d5f0f4c2ca 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ timit_data/ .Python ide_layouts/ build/ +_build/ develop-eggs/ dist/ downloads/ diff --git a/CHANGELOG.md b/CHANGELOG.md index bb286e82759c7..16daa24aa2ed9 100644 --- a/CHANGELOG.md +...
{ "difficulty": "high", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-4654@89b962d
Lightning-AI/pytorch-lightning
Python
4,654
Use high progress_bar_refresh_rate on Google Colab
## What does this PR do? Automatically override `progress_bar_refresh_rate` when on Google Colab. For this, I added a `IS_COLAB` constant under `utilities`. The changes in import were by `isort`. Fixes #3786 ## Before submitting - [x] Was this discussed/approved via a Github issue? (no need for typos and ...
2020-11-13T12:02:19Z
automatically override progress_bar_refresh_rate in google colab ## 🚀 Feature <!-- A clear and concise description of the feature proposal --> If running on google colab, automatically assign `progress_bar_refresh_rate=20` if the user didn't override the default of 1. ### Motivation Google colab is notorious...
Yes please, this is nice. It crashes my whole Chrome if I forget it, it's annoying. I would put it into the callback connector for the default case because in the progressbarBase it could override the settings if a user has a custom bar and that's probably undesired? This issue has been automatically marked as stale b...
[ { "body": "## 🚀 Feature\r\n<!-- A clear and concise description of the feature proposal -->\r\n\r\nIf running on google colab, automatically assign `progress_bar_refresh_rate=20` if the user didn't override the default of 1.\r\n\r\n### Motivation\r\n\r\nGoogle colab is notorious for crashing because of the tqd...
c586e5db77614519c8c99871d0250c5a5790e3a2
{ "head_commit": "89b962df49ef2ce54d1c8cb257d3fd140be69799", "head_commit_message": "Change warning to suggestion and move it\n\nMoved warning to configure_progress_bar instead of on_trainer_init", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex 236784afec84e..47205edb0ea3c 100644\n--- a/CHANG...
[ { "diff_hunk": "@@ -38,3 +39,6 @@\n class AMPType(Enum):\n APEX = 'apex'\n NATIVE = 'native'\n+\n+\n+IS_COLAB = 'google.colab' in sys.modules", "line": null, "original_line": 44, "original_start_line": 42, "path": "pytorch_lightning/utilities/__init__.py", "start_line": null, "te...
c5ad5e83452f9babd557258b03109374700ce573
diff --git a/CHANGELOG.md b/CHANGELOG.md index 494abb29d01fe..0c05f389d3a55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). [#4495](https://github.com/PyTorchLightning/pytorch-lightning/pull/4495), [#4439](https://g...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
Lightning-AI__pytorch-lightning-4383@682d943
Lightning-AI/pytorch-lightning
Python
4,383
Add "monitor" to saved ModelCheckpoints
## What does this PR do? Adds "monitor" to saved ModelCheckpoints Removes `CHECKPOINT_STATE_BEST_{SCORE,PATH}`. I think these were forgotten after a checkpoint connector refactor. They are unused now. I don't think we have to load the monitor in `on_load_checkpoint`. Fixes #4368 ## Before submitting - [x...
2020-10-27T02:55:18Z
Add best_model_monitor to ModelCheckpoint ### Motivation If I have a directory with many checkpoints, possibly belonging to runs with different monitors, I don't know which metric was tracked by each checkpoint. ### Pitch ```python ckpt = torch.load("saved_model.ckpt") assert hasattr(ckpt, "checkpoint_callba...
another alternative: you can also add that to checkpoint itself in `on_save_checkpoint`. Do you mean by overriding it in my `LightningModule`? It is an ugly solution because it does not know about any ModelCheckpoints used. Only the trainer knows about them. So I would need to instantiate my LightningModule with ...
[ { "body": "### Motivation\r\n\r\nIf I have a directory with many checkpoints, possibly belonging to runs with different monitors, I don't know which metric was tracked by each checkpoint.\r\n\r\n### Pitch\r\n\r\n```python\r\nckpt = torch.load(\"saved_model.ckpt\")\r\nassert hasattr(ckpt, \"checkpoint_callback_b...
5d10a36762776c4b6f6a9c55b4e6bf7bd258137f
{ "head_commit": "682d9438462c28ee72d5c0ff731a100f1d2a33b3", "head_commit_message": "Remove unused variables", "patch_to_review": "diff --git a/pytorch_lightning/callbacks/model_checkpoint.py b/pytorch_lightning/callbacks/model_checkpoint.py\nindex 6c6a1741c31c5..f44ce4f57d2aa 100644\n--- a/pytorch_lightning/call...
[ { "diff_hunk": "@@ -187,6 +185,7 @@ def on_validation_end(self, trainer, pl_module):\n \n def on_save_checkpoint(self, trainer, pl_module) -> Dict[str, Any]:\n return {\n+ \"best_model_monitor\": self.monitor,", "line": null, "original_line": 188, "original_start_line": null, ...
a9fd838c82ce8bdffed2e6897b4c3e81bd351219
diff --git a/CHANGELOG.md b/CHANGELOG.md index f8ed74235c859..b20d4ae3eab0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added `dirpath` and `filename` parameter in `ModelCheckpoint` ([#4213](https://github.com/PyTorchL...
{ "difficulty": "medium", "estimated_review_effort": 2, "problem_domain": "New Feature Additions" }
Lightning-AI__pytorch-lightning-4282@432ff6f
Lightning-AI/pytorch-lightning
Python
4,282
Fix info message when EarlyStopping 'mode' not provided [ci skip]
## What does this PR do? Fix info message when EarlyStopping 'mode' not provided <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. --> Fixes #4268 ## Before submitting - ...
2020-10-21T11:58:32Z
EarlyStopping mode auto is unknown, fallback to auto mode. In the process of refactoring as I upgraded lighting and it looks like there's been a slight change to the callback interface. This code: `early_stop_callback = pl.callbacks.EarlyStopping(verbose=True)` Results in the message: > EarlyStopping mode a...
Hey @david-waterworth, Thanks for using Pytorch Lightning and finding this bug ! I think it should be this way. ``` EarlyStopping mode not provided, fallback to auto mode. ... EarlyStopping mode set to min for monitoring early_stop_on. ``` Best regards, Thomas Chaton.
[ { "body": "In the process of refactoring as I upgraded lighting and it looks like there's been a slight change to the callback interface.\r\n\r\nThis code:\r\n\r\n`early_stop_callback = pl.callbacks.EarlyStopping(verbose=True)`\r\n\r\nResults in the message:\r\n\r\n> EarlyStopping mode auto is unknown, fallback...
3a38294d6db285f26f9a4f7c953f76500638c294
{ "head_commit": "432ff6ffa79c2a25c0ec61a68bbdd943b24a6145", "head_commit_message": "fixup! Fix info message when EarlyStopping 'mode' not provided", "patch_to_review": "diff --git a/pytorch_lightning/callbacks/early_stopping.py b/pytorch_lightning/callbacks/early_stopping.py\nindex 864d3d836ec43..1af1e6231d54f 1...
[ { "diff_hunk": "@@ -88,7 +88,7 @@ def __init__(self, monitor: str = 'early_stop_on', min_delta: float = 0.0, patie\n \n if mode not in self.mode_dict:\n if self.verbose > 0:\n- log.info(f'EarlyStopping mode {mode} is unknown, fallback to auto mode.')\n+ log.info...
9b94c81278fb10a0a006159d7e196709c9e43c6b
diff --git a/pytorch_lightning/callbacks/early_stopping.py b/pytorch_lightning/callbacks/early_stopping.py index 864d3d836ec43..972d16fd705a8 100644 --- a/pytorch_lightning/callbacks/early_stopping.py +++ b/pytorch_lightning/callbacks/early_stopping.py @@ -86,7 +86,7 @@ def __init__(self, monitor: str = 'early_stop_on'...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-4341@5df8cfd
Lightning-AI/pytorch-lightning
Python
4,341
Implement finalize for WandbLogger
## What does this PR do? Fixes #3002 The checkpoint artifacts will be uploaded at the end of the run: ![image](https://user-images.githubusercontent.com/5495193/97101598-303f5480-169f-11eb-9f3f-4ad454304361.png)
2020-10-25T05:20:44Z
Checkpoint files location when WandbLogger I am trying to look for checkpoint files when using WandbLogger. However checkpoint files doesn't seem to be exist in wandb folder as well. This is despite the fact that log_model=True is setup in WandbLogger. Please help me on this, I am not sure if I am missing something on...
Hi! thanks for your contribution!, great first issue! Hi, happy to help. Can you post 1. the arguments you pass into your wandblogger 2. the output messages in the terminal from wandb I just tested it running 2 epochs with the cpu_example, and for me it uploads at the end of the training. Hi, Below are the confi...
[ { "body": "I am trying to look for checkpoint files when using WandbLogger. However checkpoint files doesn't seem to be exist in wandb folder as well. This is despite the fact that log_model=True is setup in WandbLogger. Please help me on this, I am not sure if I am missing something on this.\r\n\r\n\r\nOS is m...
ce8abd62553a449630f992696a2a8eb02ca7f724
{ "head_commit": "5df8cfdb8f20b1360fb1bd85d3f58ba6613cc5e2", "head_commit_message": "changelog", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex 8d979b41893f5..6765c15c2f1e6 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -35,6 +35,8 @@ The format is based on [Keep a Changelog](http://keepa...
[ { "diff_hunk": "@@ -156,3 +156,7 @@ def name(self) -> Optional[str]:\n def version(self) -> Optional[str]:\n # don't create an experiment if we don't have one\n return self._experiment.id if self._experiment else self._id\n+\n+ def finalize(self, status: str) -> None:\n+ if self._l...
af211c6b75baeb3b5ede5a0c208a9c9543e6d5a0
diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a55438a43378..cc7ec0401d93c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed synchronization of best model path in `ddp_accelerator` ([#4323](https://github.com/PyTorc...
{ "difficulty": "medium", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-4242@91e2b81
Lightning-AI/pytorch-lightning
Python
4,242
CI: Added isort import check for the code on pull-request
## What does this PR do? <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. --> Fixes #4241 # Before submitting - [x] Was this discussed/approved via a Github issue? (no ne...
2020-10-19T20:37:24Z
add CI check for valid import formatting ## 🚀 Feature add a CI checker for valid import formatting - three section: build-in, third party, and this package note that all "unused" imports in init shall be ignored and they are meant such a way... ### Motivation We shall follow pep8 recomendation
@Borda I'm up for adding this, since I've already done this for my own project based on PL :wink:
[ { "body": "## 🚀 Feature\r\n\r\nadd a CI checker for valid import formatting - three section: build-in, third party, and this package\r\nnote that all \"unused\" imports in init shall be ignored and they are meant such a way... \r\n\r\n### Motivation\r\n\r\nWe shall follow pep8 recomendation\r\n", "number":...
baa8558cc0e6d2a3e24f2669e6a59ffdb8138737
{ "head_commit": "91e2b81344b353f71b08681ea5bbf4e265c787ff", "head_commit_message": "Applied isort to root-level, docs and benchmarks", "patch_to_review": "diff --git a/.github/workflows/code-formatting.yml b/.github/workflows/code-formatting.yml\nindex e549f5b8f1cfb..31445c7ae96a3 100644\n--- a/.github/workflows...
[ { "diff_hunk": "@@ -7,6 +7,21 @@ on: # Trigger the workflow on push or pull request, but only for the master bra\n branches: [master, \"release/*\"]\n \n jobs:\n+ isort:", "line": null, "original_line": 10, "original_start_line": null, "path": ".github/workflows/code-formatting.yml", "...
f5f9d1ce03b7cf176bcc0da9e02deb9f9066f442
diff --git a/.github/workflows/code-formatting.yml b/.github/workflows/code-formatting.yml index e549f5b8f1cfb..203c0fb846251 100644 --- a/.github/workflows/code-formatting.yml +++ b/.github/workflows/code-formatting.yml @@ -7,6 +7,21 @@ on: # Trigger the workflow on push or pull request, but only for the master bra ...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Test Suite / CI Enhancements" }
Lightning-AI__pytorch-lightning-4327@3eea492
Lightning-AI/pytorch-lightning
Python
4,327
Document behaviour when setting both on_step=True and on_epoch=True in self.log
Just a minor documentation update for self.log. Fixes #4216
2020-10-23T23:53:57Z
Checkpoint is saving the model based on the last val_metric_step value and not val_metric_epoch ## 🐛 Bug Checkpoint callback did not save some models even thought they achieved better result in the monitored metric, than the currently top k saved models ### Expected behavior Checkpoint callback saving the bes...
Can you post some code to reproduce this? Or code snippet for training_step and validation_step This is what I log on my train and validation step: ``` values = {'val_loss': loss, 'val_cer': cer_avg} self.log_dict(values, logger=True, prog_bar=True, on_step=True, on_epoch=True) ``` And this my checkpoint callback ...
[ { "body": "## 🐛 Bug\r\n\r\nCheckpoint callback did not save some models even thought they achieved better result in the monitored metric, than the currently top k saved models\r\n\r\n### Expected behavior\r\n\r\nCheckpoint callback saving the best scoring models based on a metric\r\n\r\n### Environment\r\n\r\n...
5b74effb1a1b7832017f7165f3e1173d5d1a2640
{ "head_commit": "3eea492f2940ce4770f3c9805c5a02a27305ad2c", "head_commit_message": "update logging.rst", "patch_to_review": "diff --git a/docs/source/logging.rst b/docs/source/logging.rst\nindex a1d16a4ddc771..d53421dbc6821 100644\n--- a/docs/source/logging.rst\n+++ b/docs/source/logging.rst\n@@ -85,7 +85,13 @@ ...
[ { "diff_hunk": "@@ -85,7 +85,13 @@ The :func:`~~pytorch_lightning.core.lightning.LightningModule.log` method has a\n * `logger`: Logs to the logger like Tensorboard, or any other custom logger passed to the :class:`~pytorch_lightning.trainer.trainer.Trainer`.\n \n \n-.. note:: Setting `on_epoch=True` will accum...
01300ea751c88f454730c485e337249c2dc6a075
diff --git a/docs/source/logging.rst b/docs/source/logging.rst index 30eb2c11ff207..3d6ae87d01b40 100644 --- a/docs/source/logging.rst +++ b/docs/source/logging.rst @@ -85,7 +85,14 @@ The :func:`~~pytorch_lightning.core.lightning.LightningModule.log` method has a * `logger`: Logs to the logger like Tensorboard, or any...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-4127@d40552a
Lightning-AI/pytorch-lightning
Python
4,127
Added getstate/setstate method for torch.save serialization
## What does this PR do? Fixes #4114 and Fixes #4120 Still requires test, and to see if there is a less verbose way to fix serialization in the accelerator class. Also note that this will omit any additional state variables of accelerators that inherit from this; it assumes custom accelerator will override `__...
2020-10-13T16:24:07Z
Unable to save model using torch.save in pytorch lightning version 0.10 ## 🐛 Bug `torch.save(trainer.model, "model.pth")` throwing error in pytorch lightning version 0.10 ## Please reproduce using the following code ``` import os import torch from torch import nn import torch.nn.functional as F from torc...
```python torch.save(trainer.model.state_dict(), "model.pth") ``` or ```python torch.save(trainer.get_model().state_dict(), "model.pth") ``` Yes. saving statedict works as expected in both version(0.9, 0.10). However, we are using library which dumps the entire model using `torch.save`. It was working in 0.9 and...
[ { "body": "## 🐛 Bug\r\n\r\n`torch.save(trainer.model, \"model.pth\")` throwing error in pytorch lightning version 0.10\r\n\r\n## Please reproduce using the following code\r\n\r\n```\r\nimport os\r\nimport torch\r\nfrom torch import nn\r\nimport torch.nn.functional as F\r\nfrom torchvision.datasets import MNIST...
01402e35948620e4ff77922ec30becf1f9b2d2fb
{ "head_commit": "d40552ae337e289873ceed5b728fad76ff6b9b61", "head_commit_message": "Added flags to ensure compatible ddp cpu environment", "patch_to_review": "diff --git a/pytorch_lightning/accelerators/accelerator.py b/pytorch_lightning/accelerators/accelerator.py\nindex 680388e812375..c3732823e3c4c 100644\n---...
[ { "diff_hunk": "@@ -512,3 +513,61 @@ def validation_epoch_end(self, outputs):\n \n # check that last one is also the best one\n assert trainer.dev_debugger.checkpoint_callback_history[-1]['epoch'] == len(monitor) - 1\n+\n+\n+def test_model_torch_save(tmpdir):\n+ \"\"\"Test to ensure torch save does n...
432114b32ccbc245a5693256f1f9077c82659588
diff --git a/pytorch_lightning/accelerators/accelerator.py b/pytorch_lightning/accelerators/accelerator.py index 680388e812375..c3732823e3c4c 100644 --- a/pytorch_lightning/accelerators/accelerator.py +++ b/pytorch_lightning/accelerators/accelerator.py @@ -214,6 +214,20 @@ def init_ddp_connection( torc...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-3591@760769b
Lightning-AI/pytorch-lightning
Python
3,591
add lightning colab tutorial notebooks
<!-- Please note that we have freeze state on adding new features till v1.0 release. Anyway, any new feature suggestion is welcome and you are free to draft a PR, but be aware that several refactoring will take place for this major release yielding in significant collision solving. A recommendation for feature dra...
2020-09-21T20:27:24Z
Add tutorial how to convert to PL (+ colab notebooks) ## 📚 Documentation To keep track of a suggestion made by @Borda: - Add a tutorial to docs that shows how to convert regular PyTorch to PyTorch Lightning - Colab notebooks could be directly included into the docs
Hey @Borda , can you give me more info on this? What ideas do you have in mind? I'm starting a study group and probably will do some tutorials so it's like killing two birds with one gun generate a documentation page with notebook is simple with `nbconvert` for launching in colab see e.g. [Running Jupyter Notebook on...
[ { "body": "## 📚 Documentation\r\n\r\nTo keep track of a suggestion made by @Borda: \r\n- Add a tutorial to docs that shows how to convert regular PyTorch to PyTorch Lightning\r\n- Colab notebooks could be directly included into the docs", "number": 1198, "title": "Add tutorial how to convert to PL (+ c...
674d33061f9f82212ac4c1b63cbbe4b2c3d70c24
{ "head_commit": "760769b168a02934e3c15d5d1ff62914b6bba033", "head_commit_message": ":zap: add lightning colab tutorial notebooks", "patch_to_review": "diff --git a/notebooks/01-mnist-hello-world.ipynb b/notebooks/01-mnist-hello-world.ipynb\nnew file mode 100644\nindex 0000000000000..0488a7a51ff24\n--- /dev/null\...
[ { "diff_hunk": "@@ -0,0 +1,556 @@\n+{\n+ \"nbformat\": 4,\n+ \"nbformat_minor\": 0,\n+ \"metadata\": {\n+ \"colab\": {\n+ \"name\": \"04-transformers-text-classification.ipynb\",\n+ \"provenance\": [],\n+ \"collapsed_sections\": [],\n+ \"toc_visible\": true,\n+ \"include_colab_lin...
fa021f9538576aca550d37d2bb22c4296c38e12a
diff --git a/docs/source/conf.py b/docs/source/conf.py index 7a44acd730115..58258af1fccf7 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -304,12 +304,12 @@ def setup(app): # copy all notebooks to local folder -path_nbs = os.path.join(PATH_HERE, 'notebooks') -if not os.path.isdir(path_nbs): - os.m...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Documentation Updates" }
Lightning-AI__pytorch-lightning-3320@5053619
Lightning-AI/pytorch-lightning
Python
3,320
use fsspec instead of gfile for all IO
## What does this PR do? This better supports remote (and local) file operations with a dedicated package. Fixes #3242 # Before submitting - [X] Was this discussed/approved via a Github issue? (no need for typos and docs improvements) - [X] Did you read the [contributor guideline](https://github.com/PyTorch...
2020-09-02T04:53:37Z
find alternative to gfile ## 🚀 Feature at this moment we are using GFile for saving checkpoints which are imported from tensorboard which underhood uses TF core... ### Motivation remove the hard dependency on tensorboard as it seems tidy linked to TensorFlow and for visualization user can install it independe...
It is used for saving to remote locations. pinging @f4hy who made the original PR, maybe has an idea or comments I agree it would be nice to remove a dependency on tensor-board but I felt it was ok because it already was a dependency of the project. I want to note that tensorboard can be installed without tensorf...
[ { "body": "## 🚀 Feature\r\n\r\nat this moment we are using GFile for saving checkpoints which are imported from tensorboard which underhood uses TF core...\r\n\r\n### Motivation\r\n\r\nremove the hard dependency on tensorboard as it seems tidy linked to TensorFlow and for visualization user can install it inde...
ee72271d205beb2c012e34425cb16e189cc56c7d
{ "head_commit": "50536198c46ac29c7e3164ca7fb4ce4a40aeef32", "head_commit_message": "use fsspec instead of gfile for all IO\n\nThis better supports remote (and local) file operations with a dedicated package", "patch_to_review": "diff --git a/environment.yml b/environment.yml\nindex 2c93fd594da2b..b326ed3440158 1...
[ { "diff_hunk": "@@ -13,81 +13,31 @@\n # limitations under the License.\n \n import io\n-import platform\n-import os\n from distutils.version import LooseVersion\n from typing import Union\n from pathlib import Path\n from urllib.parse import urlparse\n import torch\n+import fsspec\n \n-import tensorboard\n-from...
9ea7d6da378e2b80954901c6a879d123efe8e815
diff --git a/CHANGELOG.md b/CHANGELOG.md index d18fac2668279..9ab690429b65f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,10 +9,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Added -- Added hooks to metric module interface ([#2528](https://github.com/PyTorchLightning...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
Lightning-AI__pytorch-lightning-3048@b0b96e2
Lightning-AI/pytorch-lightning
Python
3,048
Add ModelCheckpoint.to_yaml method
## What does this PR do Add simple `to_json()` method to `ModelCheckpoint`. In the current code, it requires three lines, and it could be automated by lightning. Fixes #3047 (disclaimer: my issue with no answer yet) # Before submitting - [x] Did you read the [contributor guideline](https://github.com/PyTorc...
2020-08-19T10:19:58Z
ModelCheckpoint instance to JSON ## 🚀 Feature Have a `to_json(path)` function that writes the `best_k_models` to a json file in `path`. ### Motivation Why having a JSON is good? Then you don't need to load the checkpoints to know the metrics and things like a posteriori stochastic weight averaging gets eas...
should this file be saved with every checkpoint, or one file that gets updated/overwritten? I just thought about a single function that can be called by the user at the end of training. But actually, updating/overwritting at every checkpoint also would be cool, at least the user never has to call it. Link to the P...
[ { "body": "## 🚀 Feature\r\n\r\nHave a `to_json(path)` function that writes the `best_k_models` to a json file in `path`.\r\n\r\n### Motivation\r\n\r\nWhy having a JSON is good? \r\nThen you don't need to load the checkpoints to know the metrics and things like a posteriori stochastic weight averaging gets eas...
d79bce1dffcc2d65799987608afb4a97d3090451
{ "head_commit": "b0b96e214675264369046af40c43c2c65fe266f2", "head_commit_message": "Update pytorch_lightning/callbacks/model_checkpoint.py", "patch_to_review": "diff --git a/pytorch_lightning/callbacks/model_checkpoint.py b/pytorch_lightning/callbacks/model_checkpoint.py\nindex 1670cf0192eff..dbab9803c8276 10064...
[ { "diff_hunk": "@@ -36,6 +37,23 @@ def test_model_checkpoint_with_non_string_input(tmpdir, save_top_k):\n )\n \n \n+@pytest.mark.parametrize('save_top_k', [-1, 0, 1, 2])\n+def test_model_checkpoint_to_yaml(tmpdir, save_top_k):\n+ \"\"\" Test that None in checkpoint callback is valid and that chkp_path is...
f5d97c064934790785762a9eb4fbec770a3fa000
diff --git a/pytorch_lightning/callbacks/model_checkpoint.py b/pytorch_lightning/callbacks/model_checkpoint.py index 1670cf0192eff..dbab9803c8276 100644 --- a/pytorch_lightning/callbacks/model_checkpoint.py +++ b/pytorch_lightning/callbacks/model_checkpoint.py @@ -22,8 +22,10 @@ import os import re +import yaml fr...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "New Feature Additions" }
Lightning-AI__pytorch-lightning-3145@e7ed91e
Lightning-AI/pytorch-lightning
Python
3,145
fix ONNX model save on GPU
<!-- Please note that we have freeze state on adding new features till v1.0 release. Anyway, any new feature suggestion is welcome and you are free to draft a PR, but be aware that several refactoring will take place for this major release yielding in significant collision solving. A recommendation for feature dra...
2020-08-25T03:35:52Z
ONNX model does not save on GPU ## 🐛 Bug Attempting to export on ONNX after training model on GPU, throws an error is the `input_sample` or `example_input_array` is not a CUDA tensor. ### To Reproduce Steps to reproduce the behavior: 1. Train a model on GPU 2. Try to export to ONNX when `self.example_inp...
I would say that the problem could be the distributed way, mind check running only on a single GPU? I ran this on Kaggle notebook. When I tried to save after training, it threw the error.
[ { "body": "## 🐛 Bug\r\n\r\nAttempting to export on ONNX after training model on GPU, throws an error is the `input_sample` or `example_input_array` is not a CUDA tensor.\r\n\r\n### To Reproduce\r\n\r\nSteps to reproduce the behavior:\r\n\r\n1. Train a model on GPU\r\n2. Try to export to ONNX when `self.exampl...
bd35c869ee0b856fc30229ef36957b058fe97461
{ "head_commit": "e7ed91e1396109dcf48a4b38d3b27b2a67a31bd9", "head_commit_message": "chlog", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex 3d84bb7067f53..0323e81349aec 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -26,6 +26,8 @@ The format is based on [Keep a Changelog](http://keepachan...
[ { "diff_hunk": "@@ -1716,11 +1716,13 @@ def to_onnx(self, file_path: str, input_sample: Optional[Tensor] = None, **kwarg\n elif self.example_input_array is not None:\n input_data = self.example_input_array\n else:\n- raise ValueError('`input_sample` and `example_input_arra...
b73da1cccaf1bc605bb7dd77ddc41060de4524cf
diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d84bb7067f53..0323e81349aec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed RMSLE metric ([#3188](https://github.com/PyTorchLightning/pytorch-lightning/pull/3188)) ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-3517@235d661
Lightning-AI/pytorch-lightning
Python
3,517
Metric aggregation testing
<!-- Please note that we have freeze state on adding new features till v1.0 release. Anyway, any new feature suggestion is welcome and you are free to draft a PR, but be aware that several refactoring will take place for this major release yielding in significant collision solving. A recommendation for feature dra...
2020-09-16T08:25:53Z
Test all metrics against sklearn (with many input trials) Hand-chosen values are not enough, we need to test with a large batch of inputs where possible. Something in this style, maybe with a fixed seed: ```python def test_auroc_versus_sklearn(): for i in range(100): target = torch.randint(0, 2, size...
> maybe with a fixed seed I don't think a seed is required here. > > maybe with a fixed seed > > I don't think a seed is required here. I would agree here that all metric shall be deterministic so even using different seeds increase the coverage or cases and so far you pas the same values to the two functions ...
[ { "body": "Hand-chosen values are not enough, we need to test with a large batch of inputs where possible. \r\nSomething in this style, maybe with a fixed seed: \r\n```python\r\ndef test_auroc_versus_sklearn():\r\n for i in range(100):\r\n target = torch.randint(0, 2, size=(10, ))\r\n pred = to...
9a7d1a18760030653a296b230c69b941761cde8b
{ "head_commit": "235d661dea6eb47d2345dd09f1b9f9fc6fac2fea", "head_commit_message": "fix pickle error", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex b6f4ddf74662c..2d80e8b39bada 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -71,6 +71,8 @@ The format is based on [Keep a Changelog](http:...
[ { "diff_hunk": "@@ -35,14 +38,17 @@ def mse(\n \n \"\"\"\n mse = F.mse_loss(pred, target, reduction='none')\n+ if return_state:\n+ return {'squared_error': mse.sum(), 'n_observations': torch.tensor(mse.numel())}\n mse = reduce(mse, reduction=reduction)\n return mse\n \n \n def rmse(\n ...
04c9f456f8f7bf28a6b556c6da6f3dc454bb20ef
diff --git a/CHANGELOG.md b/CHANGELOG.md index 396bb6becaec0..c76175858f42e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -91,6 +91,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed counter-intuitive error being thrown in `Accuracy` metric for zero target tensor ([#3764](...
{ "difficulty": "high", "estimated_review_effort": 4, "problem_domain": "Test Suite / CI Enhancements" }
Lightning-AI__pytorch-lightning-3266@130b599
Lightning-AI/pytorch-lightning
Python
3,266
update batch size in LightningModule.datamodule when auto scaling batch size
## What does this PR do? Fixes #3233 the new test fails on master # Before submitting - [x] Was this discussed/approved via a Github issue? (no need for typos and docs improvements) - [x] Did you read the [contributor guideline](https://github.com/PyTorchLightning/pytorch-lightning/blob/master/.github...
2020-08-30T11:55:27Z
auto_scale_batch_size not working with datamodule ## 🐛 Bug The `Trainer` expects the `LightningModule` to have `self.batch_size` (see `scale_batch_size()` in training_tricks.py). However, if one is using the new `LightningDataModule`, that should be the class with `self.batch_size` defined. ### To Reproduce `...
I knew this bug report will eventually come :) same will happen for auto_lr_find. We need to generalize our `lightning_hasattr` and `getattr` helper functions to include the datamodule. In total, we have ``` model.attribute_name model.hparams.attribute_name model.dm.attribute_name ``` all of these should be co...
[ { "body": "## 🐛 Bug\r\n\r\nThe `Trainer` expects the `LightningModule` to have `self.batch_size` (see `scale_batch_size()` in training_tricks.py). However, if one is using the new `LightningDataModule`, that should be the class with `self.batch_size` defined.\r\n\r\n### To Reproduce\r\n\r\n```python\r\nassert ...
ee72271d205beb2c012e34425cb16e189cc56c7d
{ "head_commit": "130b599e5d433b209e8d33524378ebf334329246", "head_commit_message": "docs", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex d18fac2668279..d3a862c624709 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -30,6 +30,8 @@ The format is based on [Keep a Changelog](http://keepachang...
[ { "diff_hunk": "@@ -277,16 +279,12 @@ def _adjust_batch_size(trainer,\n \"\"\"\n model = trainer.get_model()\n batch_size = lightning_getattr(model, batch_arg_name)\n- if value:\n- lightning_setattr(model, batch_arg_name, value)\n- new_size = value\n- if desc:\n- l...
e4df06b7c096255079d8802c5f3c52ee626a9246
diff --git a/CHANGELOG.md b/CHANGELOG.md index d18fac2668279..d3a862c624709 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed `GpuUsageLogger` to work on different platforms ([#3008](https://github.com/PyTorchLightni...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-2865@105b827
Lightning-AI/pytorch-lightning
Python
2,865
allow using apex with any PT version
## What does this PR do? add extra argument which would switch between using Apex and native AMP in pt>=1.6 Fixes #2788 ## PR review Anyone in the community is free to review the PR once the tests have passed. If we didn't discuss your PR in Github issues there's a high chance it will not be merged....
2020-08-07T15:03:38Z
Enable option to use Apex when PyTorch 1.6 is installed ## 🚀 Feature <!-- A clear and concise description of the feature proposal --> Currently, if PyTorch 1.6 is installed, PyTorch Lightning will use native AMP by default. It would be useful to have an option to force PL to use Apex if needed, which is not curren...
Same here. I notice some results could no longer be replicated now that I upgraded to PT 1.6 and lightning 0.8.5 (which may be related to FP16).
[ { "body": "## 🚀 Feature\r\n<!-- A clear and concise description of the feature proposal -->\r\n\r\nCurrently, if PyTorch 1.6 is installed, PyTorch Lightning will use native AMP by default. It would be useful to have an option to force PL to use Apex if needed, which is not currently possible\r\n\r\n### Motivat...
b7d72706c3696afafb2519e3ff3715d2bf295606
{ "head_commit": "105b827d47929026445d640dc8b8d7a801e5652d", "head_commit_message": "Apply suggestions from code review\n\nCo-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>", "patch_to_review": "diff --git a/pytorch_lightning/accelerators/cpu_backend.py b/pytorch_lightning/accelerators/cpu_backend.py\ninde...
[ { "diff_hunk": "@@ -954,18 +956,18 @@ def optimizer_closure(self, split_batch, batch_idx, opt_idx, optimizer, hiddens)\n with self.profiler.profile('model_backward'):\n # scale loss for 16 bit\n if self.precision == 16 and not self.on_tpu:\n- closure_loss = model_r...
911bf5e6df4a0b7a3bc16b0c7bdda1c407a80064
diff --git a/dockers/cuda-extras/Dockerfile b/dockers/cuda-extras/Dockerfile index a1aaff0e7d1d2..f3c435ff5333a 100644 --- a/dockers/cuda-extras/Dockerfile +++ b/dockers/cuda-extras/Dockerfile @@ -39,7 +39,6 @@ RUN apt-get update && \ && \ # Install AMP - # TODO: skip this instrall for PT >= 1.6 bash in...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
Lightning-AI__pytorch-lightning-2853@c3d2fc3
Lightning-AI/pytorch-lightning
Python
2,853
Fix accumulate_grad_batches for last batch
## What does this PR do? <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. --> Fixes #1549 **EDIT:** ### Issue to reproduce – Colab https://colab.research.google.com/drive/1i...
2020-08-06T17:52:14Z
Unwanted accumulate_grad_batches behavior ## 🐛 Bug When using the flag `accumulate_grad_batches` for the trainer, if an action is to be performed at the last mini-batch it isn't done. ### To Reproduce Steps to reproduce the behavior: 1. In `on_after_backward`, define some logic if we are at the last mini-b...
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. @sebastienwood thanks for bringing this up! we're looking at it for next sprint
[ { "body": "## 🐛 Bug\r\n\r\nWhen using the flag `accumulate_grad_batches` for the trainer, if an action is to be performed at the last mini-batch it isn't done.\r\n\r\n### To Reproduce\r\n\r\nSteps to reproduce the behavior:\r\n\r\n1. In `on_after_backward`, define some logic if we are at the last mini-batch\r\...
5c35db94fa338b8720175541a3b0dc872d963bdf
{ "head_commit": "c3d2fc3e6995201151fd6a5c9d559a0becb12592", "head_commit_message": "fixed with is_last_batch suggested by @awaelchli", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex ad17f9f4ad482..793200363abab 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -68,6 +68,8 @@ The format is b...
[ { "diff_hunk": "@@ -471,13 +473,14 @@ def run_training_epoch(self):\n \n # run epoch\n for batch_idx, (batch, is_last_batch) in self.profiler.profile_iterable(\n- enumerate(_with_is_last(train_dataloader)), \"get_train_batch\"\n+ enumerate(_with_is_last(train_dataloader...
ac4f4c087f8a43930f8ccb55a4a58fc919a1960e
diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e639a5c53f6f..db84e0240a3f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -86,6 +86,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Fixed +- Fixed `accumulate_grad_batches` for last batch ([#2853](https://github.com/PyTorchL...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-2681@33955e1
Lightning-AI/pytorch-lightning
Python
2,681
Fix weights_save_path when logger is used + simplify path handling + better docs
## What does this PR do? <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. --> Fixes #2527, #882, #1812 and continues effort to document and protect Trainer attributes #1497 better. ...
2020-07-23T22:55:53Z
checkpoint save dir is not correctly set when _save_dir is given by wandb logger ## 🐛 Bug When using ModelCheckpoint with default parameter and Wandb Logger with save_dir set to some dir, The checkpoint is still dumped to os.getcwd() ### To Reproduce ........ logger = WandbLogger(save_dir='/path/to/experiment...
@pableeto I don't think we want to make this part of the code even more complicated. Wouldn't the real fix be to remove this if block here: https://github.com/PyTorchLightning/pytorch-lightning/blob/25ee51bc570503f331dceecc610d0eb355e22327/pytorch_lightning/trainer/callback_config.py#L57 I think it is a left-ove...
[ { "body": "## 🐛 Bug\r\n\r\nWhen using ModelCheckpoint with default parameter and Wandb Logger with save_dir set to some dir,\r\nThe checkpoint is still dumped to os.getcwd()\r\n\r\n### To Reproduce\r\n........\r\nlogger = WandbLogger(save_dir='/path/to/experiment')\r\ntrainer = Trainer.from_argparse_args(other...
3f2c1022ab0e7027822a2acd66debc8afa90d5d6
{ "head_commit": "33955e120985f607b3c64adb97316b8a20e906fb", "head_commit_message": "Merge branch 'master' into bugfix/ckpt_path", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex 5ed0abbcfa801..83beb5b680fb6 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -19,6 +19,7 @@ The format is based ...
[ { "diff_hunk": "@@ -894,6 +891,28 @@ def enable_validation(self) -> bool:\n val_loop_enabled = (self.is_overridden('validation_step') and self.limit_val_batches > 0)\n return val_loop_enabled or self.fast_dev_run\n \n+ @property\n+ def default_root_dir(self) -> str:\n+ \"\"\"\n+ ...
06eb18bf669fda6faf407fc44d108f243579da5e
diff --git a/CHANGELOG.md b/CHANGELOG.md index 022e3159e0cb7..5a8df1196f7ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Deprecated +- Deprecated Trainer attribute `ckpt_path`, which will now be set by `weights_sa...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-2565@531b383
Lightning-AI/pytorch-lightning
Python
2,565
.fit() returns last not best weights in ddp_spawn
Fixes #2547
2020-07-09T10:46:34Z
Can't use None (anymore) in checkpoint_callback ## 🐛 Bug using None in checkpoint_callback now errors out ``` -- Process 0 terminated with the following error: Traceback (most recent call last): File "/opt/conda/lib/python3.6/site-packages/torch/multiprocessing/spawn.py", line 20, in _wrap fn(i, *args) ...
[ { "body": "## 🐛 Bug\r\nusing None in checkpoint_callback now errors out\r\n\r\n```\r\n-- Process 0 terminated with the following error:\r\nTraceback (most recent call last):\r\n File \"/opt/conda/lib/python3.6/site-packages/torch/multiprocessing/spawn.py\", line 20, in _wrap\r\n fn(i, *args)\r\n File \"/o...
e1bc208f66891e22f0139619a1be5c06235a0f34
{ "head_commit": "531b383fdb83c5cb25eda05d0a1f99978556fc17", "head_commit_message": "added base tests for tpu", "patch_to_review": "diff --git a/pytorch_lightning/trainer/distrib_data_parallel.py b/pytorch_lightning/trainer/distrib_data_parallel.py\nindex 5b8d79e47564f..a2eaca6a7166a 100644\n--- a/pytorch_lightni...
[ { "diff_hunk": "@@ -559,9 +560,13 @@ def ddp_train(self, process_idx, q, model, is_master=False, proc_offset=0):\n torch.cuda.empty_cache()\n \n if self.global_rank == 0 and q is not None:\n+ rank_zero_warn('cleaning up ddp environment...')\n q.put(self.checkpoint_callback...
222dd03d8a0649cde8cb6245843cbf3dcfb82313
diff --git a/pytorch_lightning/trainer/distrib_data_parallel.py b/pytorch_lightning/trainer/distrib_data_parallel.py index 5b8d79e47564f..3eef40e1ab02a 100644 --- a/pytorch_lightning/trainer/distrib_data_parallel.py +++ b/pytorch_lightning/trainer/distrib_data_parallel.py @@ -189,6 +189,7 @@ class TrainerDDPMixin(ABC):...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-2244@de959c6
Lightning-AI/pytorch-lightning
Python
2,244
Fixed the load_from_checkpoint path detected as URL bug
## What does this PR do? This PR fixes #2243 by both checking if string is a local file and parsing string to see if it's an URL. # Before submitting - [X] Was this discussed/approved via a Github issue? (no need for typos and docs improvements) - [X] Did you read the [contributor guideline](https://github.co...
2020-06-18T20:04:43Z
Model.load_from_checkpoint tries to open file path as URL and fail ## 🐛 Bug load_from_checkpoint tries to classify if the input is a file path or an URL and detects the hard drive letter as a scheme and then classify wrongly the input because of this. urllib.error.URLError: \<urlopen error unknown url type: d\> ...
Hi! thanks for your contribution!, great first issue! Ah I didn’t think about Windows when I implemented this. I’ll take a look if there’s a better way. We could try to detect if the file exists with if os.path.isfile() or Path(path_of_chkpt).is_file() instead of checking for scheme
[ { "body": "## 🐛 Bug\r\n load_from_checkpoint tries to classify if the input is a file path or an URL and detects the hard drive letter as a scheme and then classify wrongly the input because of this.\r\nurllib.error.URLError: \\<urlopen error unknown url type: d\\>\r\n\r\nMy input:\r\nD:\\Prog\\Projects\\Aceri...
f8c10fbff03240bf76896bc78def2118ad4fe141
{ "head_commit": "de959c6be384d18423c2f737bface2a2a198a2d3", "head_commit_message": "Fixed the load_from_checkpoint path detected as URL bug", "patch_to_review": "diff --git a/pytorch_lightning/utilities/cloud_io.py b/pytorch_lightning/utilities/cloud_io.py\nindex b2f9ffa788541..317ceafb0da03 100644\n--- a/pytorc...
[ { "diff_hunk": "@@ -1,11 +1,12 @@\n import torch\n \n+from Pathlib import Path", "line": null, "original_line": 3, "original_start_line": null, "path": "pytorch_lightning/utilities/cloud_io.py", "start_line": null, "text": "@user1:\n`from pathlib import Path`" } ]
c4af51fd2dcfa7f304dcd3df130a07afc3e6949f
diff --git a/pytorch_lightning/utilities/cloud_io.py b/pytorch_lightning/utilities/cloud_io.py index b2f9ffa788541..de5bd1918e03b 100644 --- a/pytorch_lightning/utilities/cloud_io.py +++ b/pytorch_lightning/utilities/cloud_io.py @@ -1,11 +1,12 @@ import torch +from pathlib import Path from urllib.parse import urlpa...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-2486@003cc76
Lightning-AI/pytorch-lightning
Python
2,486
integrate with CircleCI
## What does this PR do? Add a CircleCI config to run TPU tests on incoming PRs even for PRs that come from forked repos. Fixes #1246 # Before submitting - [ ] Was this discussed/approved via a Github issue? (no need for typos and docs improvements) - [x] Did you read the [contributor guideline](https://g...
2020-07-03T16:14:08Z
add TPU tests ## 🚀 Feature we shall also cover TPU usage as we are supporting it ### Motivation now all changes are tested for GPUs and CPU but we do not have a check for TPU yet ### Pitch getting coverage back to ~99%
TPU's are available in CI testing? Or are you saying there is a way to deploy it to colab? > TPU's are available in CI testing? Or are you saying there is a way to deploy it to colab? not yet, by we will try to get one as we got also the GPUs some time ago :] @jeremyjordan mind add optional TPU tests which would als...
[ { "body": "## 🚀 Feature\r\n\r\nwe shall also cover TPU usage as we are supporting it\r\n\r\n### Motivation\r\n\r\nnow all changes are tested for GPUs and CPU but we do not have a check for TPU yet\r\n\r\n### Pitch\r\n\r\ngetting coverage back to ~99%", "number": 1246, "title": "add TPU tests" } ]
7b4db3045dcc9e6bb0b66e409b25bb2c7fa378f0
{ "head_commit": "003cc76ba028646e2aa09eacbf76c2ee45292c38", "head_commit_message": "action", "patch_to_review": "diff --git a/.circleci/config.yml b/.circleci/config.yml\nindex 1d6802dca676e..3c466045d6a1e 100755\n--- a/.circleci/config.yml\n+++ b/.circleci/config.yml\n@@ -1,43 +1,117 @@\n-# Python CircleCI 2.0 ...
[ { "diff_hunk": "@@ -1,43 +1,117 @@\n-# Python CircleCI 2.0 configuration file\n-#\n-# Check https://circleci.com/docs/2.0/language-python/ for more details\n-#\n-version: 2.0\n+# Python CircleCI 2.1 configuration file.\n+version: 2.1\n+orbs:\n+ gcp-gke: circleci/gcp-gke@1.0.4\n+ go: circleci/go@1.3.0\n+ code...
1bffa08893559aaaea5856239a772afc33f1fadc
diff --git a/.circleci/config.yml b/.circleci/config.yml index 1d6802dca676e..4da8772c5c481 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,43 +1,118 @@ -# Python CircleCI 2.0 configuration file -# -# Check https://circleci.com/docs/2.0/language-python/ for more details -# -version: 2.0 +# Python Cir...
{ "difficulty": "high", "estimated_review_effort": 4, "problem_domain": "Test Suite / CI Enhancements" }
Lightning-AI__pytorch-lightning-2273@bf5fcc1
Lightning-AI/pytorch-lightning
Python
2,273
check omegaconf gpus
## What does this PR do? Fixes #2270 # 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/pytorch-lightning/blob/master/.github/CONTRIBUTING.md), Pull Request secti...
2020-06-19T16:54:55Z
Exception when trainer.gpus are passed as a list through hydra (omegaconf) ## 🐛 Bug When we pass the `gpus` flag for `Trainer` using `hydra` (which in turn uses `Omegaconf`) it is passed as `omegaconf.listconfig.ListConfig`. However, internally `Trainer` only checks for `int`, `str`, `list`. This throws an exception....
well it is OmegaConf issue ``` trainer_params = OmegaConf.create({'max_epochs': 1, 'overfit_pct': 0.01, 'gpus': [1]}) type(trainer_params.gpus) Out[1]: omegaconf.listconfig.ListConfig isinstance(trainer_params.gpus, list) Out[2]: False ``` in fact, the solution shall be that `ListConfig` is inherited from `list`...
[ { "body": "## 🐛 Bug\r\nWhen we pass the `gpus` flag for `Trainer` using `hydra` (which in turn uses `Omegaconf`) it is passed as `omegaconf.listconfig.ListConfig`. However, internally `Trainer` only checks for `int`, `str`, `list`. This throws an exception. \r\n\r\n#### Code sample\r\n```\r\n#!/usr/bin/env pyt...
54acc79f31842d3a3eb6a6c0380f0ca4a0e3e445
{ "head_commit": "bf5fcc10d722c685c5614c6f006b9f4d2ef001c6", "head_commit_message": "test", "patch_to_review": "diff --git a/pytorch_lightning/core/saving.py b/pytorch_lightning/core/saving.py\nindex e6c7b0e222274..4ff019a20c6ae 100644\n--- a/pytorch_lightning/core/saving.py\n+++ b/pytorch_lightning/core/saving.p...
[ { "diff_hunk": "@@ -905,6 +906,15 @@ def __init__(self, **kwargs):\n TrainerSubclass(abcdefg='unknown_arg')\n \n \n+@pytest.mark.parametrize('trainer_params', [\n+ OmegaConf.create({'max_epochs': 1, 'gpus': 1}),\n+ OmegaConf.create({'max_epochs': 1, 'gpus': [0]}),\n+])\n+@pytest.mark.skipif(not to...
d1a86420759769c882a5cd0de4829e2a038bf985
diff --git a/pytorch_lightning/core/saving.py b/pytorch_lightning/core/saving.py index e6c7b0e222274..4ff019a20c6ae 100644 --- a/pytorch_lightning/core/saving.py +++ b/pytorch_lightning/core/saving.py @@ -6,20 +6,18 @@ import torch import yaml from argparse import Namespace -from typing import Union, Dict, Any, Opti...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-2094@03fe3b5
Lightning-AI/pytorch-lightning
Python
2,094
fix TPU parsing and TPU tests
# Before submitting - [x] Was this discussed/approved via a Github issue? (no need for typos and docs improvements) - [x] Did you read the [contributor guideline](https://github.com/PyTorchLightning/pytorch-lightning/blob/master/.github/CONTRIBUTING.md), Pull Request section? - [ ] Did you make sure to update the ...
2020-06-06T11:41:02Z
add TPU tests ## 🚀 Feature we shall also cover TPU usage as we are supporting it ### Motivation now all changes are tested for GPUs and CPU but we do not have a check for TPU yet ### Pitch getting coverage back to ~99%
TPU's are available in CI testing? Or are you saying there is a way to deploy it to colab? > TPU's are available in CI testing? Or are you saying there is a way to deploy it to colab? not yet, by we will try to get one as we got also the GPUs some time ago :] @jeremyjordan mind add optional TPU tests which would als...
[ { "body": "## 🚀 Feature\r\n\r\nwe shall also cover TPU usage as we are supporting it\r\n\r\n### Motivation\r\n\r\nnow all changes are tested for GPUs and CPU but we do not have a check for TPU yet\r\n\r\n### Pitch\r\n\r\ngetting coverage back to ~99%", "number": 1246, "title": "add TPU tests" } ]
e085e93dd303e80af2e9a5fe4aa392055c831114
{ "head_commit": "03fe3b51f18d71c26b040b62b880fda0c7762f66", "head_commit_message": "flake fix", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex 10d857f2a5a51..efc33106c2d71 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -18,6 +18,8 @@ The format is based on [Keep a Changelog](http://keepa...
[ { "diff_hunk": "@@ -493,6 +493,51 @@ def retry_jittered_backoff(func: Callable, num_retries: int = 5, cap_delay: floa\n sleep_delay = min(cap_delay, random.uniform(base_delay, sleep_delay * 3))\n \n \n+def _parse_tpu_cores(tpu_cores: Union[int, str, List]) -> Optional[Union[List[int], int]]:\n+ \"\"\...
da06cc43cbd97c2e69165f1ad29b429c36f91d30
diff --git a/CHANGELOG.md b/CHANGELOG.md index dab42701d9563..26dcb32ad8519 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Fixed +- Fixed parsing TPU arguments and TPU tests ([#2094](https://github.com/PyTorchLightn...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Test Suite / CI Enhancements" }
Lightning-AI__pytorch-lightning-2246@e644a29
Lightning-AI/pytorch-lightning
Python
2,246
support num_sanity_val_steps=-1
## What does this PR do? <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. --> Fixes #1715 `Trainer(num_sanity_val_steps=-1)` is now possible and will run all val dataloaders in fu...
2020-06-18T21:52:43Z
Run full validation epoch before training ## ❓ Questions and Help #### What is your question? How can I manually trigger a full validation step before training? I want to compute and log the validation metrics before I start the training (ideally also updating the progress bar dictionary). The reason why I wa...
To evaluate the performance of an existing model in your case, it is best practice to implement the test methods in the lightning module and then invoke the Trainer.test(). So I imagine your workflow will roughly be ``` model = YourLightningModule.load_from_checkpoint(...) trainer = Trainer(options for testing) ...
[ { "body": "## ❓ Questions and Help\r\n\r\n#### What is your question?\r\nHow can I manually trigger a full validation step before training?\r\n\r\nI want to compute and log the validation metrics before I start the training (ideally also updating the progress bar dictionary).\r\n\r\nThe reason why I want to do ...
62ce00f96c09de6d137c810921a6cd9e7b60aff5
{ "head_commit": "e644a295e7e77b3f7aa8657846721c0476c02c91", "head_commit_message": "Merge branch 'master' into feature/sanity-val-full-data", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex 26dcb32ad8519..3a3417fda7722 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -8,6 +8,8 @@ The format...
[ { "diff_hunk": "@@ -804,6 +805,24 @@ def test_tpu_choice(tmpdir, tpu_cores, expected_tpu_id, error_expected):\n assert trainer.tpu_id == expected_tpu_id\n \n \n+def test_num_sanity_val_steps(tmpdir):\n+ \"\"\" Test that num_sanity_val_steps=-1 runs through all validation data once. \"\"\"\n+ model...
ed62155634fb6ed53f51c08349055885cea9d673
diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b4c0f0dc1759..9fcc8e3691955 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added BLEU metrics ([#2535](https://github.com/PyTorchLightning/pytorch-lightning/pull/2535)) ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
Lightning-AI__pytorch-lightning-2501@6c3e81d
Lightning-AI/pytorch-lightning
Python
2,501
callback method for on_save_checkpoint
## What does this PR do? Provides a generic way for callbacks to persist state in checkpoints. This is still in a draft state for review. If the core team agrees with this approach, we still need to: - [x] Provide a utility for upgrading old checkpoints to this new standard - [x] Test utility for upgrading old ...
2020-07-04T16:37:43Z
Add callback method for on_save_checkpoint ## 🚀 Feature We should allow Callback objects to optionally persist state that can be reloaded from checkpoints. ### Motivation We already manually save the state for early stopping and model checkpoint callbacks. This refactor would eliminate callback-specific code ...
I think it is reasonable to assume there is only one instance of these special callbacks (and should raise error otherwise, e.g. see progress bar callback). Note that currently the logger is not a callback. Also, the documentation for callbacks should probably let the user know that the the order of the list input to...
[ { "body": "## 🚀 Feature\r\n\r\nWe should allow Callback objects to optionally persist state that can be reloaded from checkpoints.\r\n\r\n### Motivation\r\n\r\nWe already manually save the state for early stopping and model checkpoint callbacks. This refactor would eliminate callback-specific code in the Train...
85cd558a3f71a4e7559bda9a31c8e416d4297a16
{ "head_commit": "6c3e81d2a5e57a6f4fc9d62a36e7233ae68add33", "head_commit_message": "clean up and add tests", "patch_to_review": "diff --git a/docs/source/callbacks.rst b/docs/source/callbacks.rst\nindex cd816081496cb..55b9653b22534 100644\n--- a/docs/source/callbacks.rst\n+++ b/docs/source/callbacks.rst\n@@ -104...
[ { "diff_hunk": "@@ -0,0 +1,39 @@\n+import argparse\n+from shutil import copyfile\n+\n+import torch\n+\n+from pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint\n+\n+KEYS_MAPPING = {\n+ \"checkpoint_callback_best_model_score\": (ModelCheckpoint, \"best_model_score\"),\n+ \"checkpoint_callbac...
c60c4c4be04cf0c9d635ac8828cb73579808ba68
diff --git a/docs/source/callbacks.rst b/docs/source/callbacks.rst index c8bb615673b31..c3a85887b851d 100644 --- a/docs/source/callbacks.rst +++ b/docs/source/callbacks.rst @@ -144,6 +144,18 @@ Lightning has a few built-in callbacks. ---------- +Persisting State +---------------- + +Some callbacks require internal...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
Lightning-AI__pytorch-lightning-1908@6442a85
Lightning-AI/pytorch-lightning
Python
1,908
Adds the option of saving the last model on checkpoint
# Before submitting - [x] Was this discussed/approved via a Github issue? (no need for typos and docs improvements) - [x] Did you read the [contributor guideline](https://github.com/PyTorchLightning/pytorch-lightning/blob/master/.github/CONTRIBUTING.md), Pull Request section? - [x] Did you make sure to update the ...
2020-05-20T21:32:14Z
Save checkpoint for the last epoch How to save the checkpoint only for the last epoch? In the docs: ``` if save_top_k == k, the best k models according to the quantity monitored will be saved. if save_top_k == 0, no models are saved. if save_top_k == -1, all models are saved. Please note that the monitors are chec...
[ { "body": "How to save the checkpoint only for the last epoch?\r\nIn the docs:\r\n\r\n```\r\nif save_top_k == k, the best k models according to the quantity monitored will be saved. if save_top_k == 0, no models are saved. if save_top_k == -1, all models are saved. Please note that the monitors are checked ever...
98f7842970fd593c21bebfdba5da8aa311d50730
{ "head_commit": "6442a85240609b08590ea752e08cf24bb78f482c", "head_commit_message": "Update CHANGELOG.md", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex ff2c124eafd63..2b24478ae8854 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -12,6 +12,8 @@ The format is based on [Keep a Changelog](ht...
[ { "diff_hunk": "@@ -255,19 +255,21 @@ def test_dp_output_reduce():\n assert reduced['b']['c'] == out['b']['c']\n \n \n-@pytest.mark.parametrize([\"save_top_k\", \"file_prefix\", \"expected_files\"], [\n- pytest.param(-1, '', {'epoch=4.ckpt', 'epoch=3.ckpt', 'epoch=2.ckpt', 'epoch=1.ckpt', 'epoch=0.ckpt'}...
6803c2eef19aa816d127facb3dcb180edd57a79d
diff --git a/CHANGELOG.md b/CHANGELOG.md index ff2c124eafd63..2b24478ae8854 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added type hints in `Trainer.fit()` and `Trainer.test()` to reflect that also a list of dataload...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
Lightning-AI__pytorch-lightning-2047@7f38ca0
Lightning-AI/pytorch-lightning
Python
2,047
update hparams, allow OmegaConf
## What does this PR do? Fixes #2027 Fixes #2040 Fixes #2087 ## PR review Anyone in the community is free to review the PR once the tests have passed. If we didn't discuss your PR in Github issues there's a high chance it will not be merged. ## Did you have fun? Make sure you had fun coding 🙃
2020-06-01T23:04:07Z
Support DictConfig We need to add DictConfig support for Omegaconf @Borda to the auto hparam save Support omegaconf in hparams We need to get hydra dict config to work. Proposed solution: 1. save all primitives to the state of the checkpoint. 2. create function save_arguments() 1. if no args pass...
Yes, I agree. Users should have other options besides argument parser to set up their configuration. Personally speaking, I don't like typing too much on the command line b/c that is error-prone. A dictionary-like configuration system would be great. One example would be Ross's [yacs](https://github.com/rbgirshick/yacs...
[ { "body": "We need to add DictConfig support for Omegaconf @Borda to the auto hparam save", "number": 2027, "title": "Support DictConfig" }, { "body": "We need to get hydra dict config to work.\r\n\r\nProposed solution:\r\n 1. save all primitives to the state of the checkpoint.\r\n 2. crea...
c09317e68f7b108ba4efac44726090812005e9f2
{ "head_commit": "7f38ca0a73b3957b8bb99267c1e665734537c8b9", "head_commit_message": "wip", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex 3f8487cc742ac..6bac0ad2d4ba9 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -78,7 +78,7 @@ The format is based on [Keep a Changelog](http://keepachange...
[ { "diff_hunk": "@@ -51,7 +51,7 @@ def __init__(self,\n **kwargs) -> object:\n # init superclass\n super().__init__()\n- self.auto_collect_arguments()\n+ self._auto_collect_arguments()", "line": null, "original_line": 54, "original_start_line": null, ...
e5327969c9cdf1069d8f27b0306a5dcd9de1dff6
diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f8487cc742ac..321319d6a216c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,9 +76,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Allow use of same `WandbLogger` instance for multiple training loops ([#2055](https://github.com...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
Lightning-AI__pytorch-lightning-1638@522a206
Lightning-AI/pytorch-lightning
Python
1,638
Feature: auto scale batch size
# Before submitting - [x] Was this discussed/approved via a Github issue? (no need for typos and docs improvements) - [x] Did you read the [contributor guideline](https://github.com/PyTorchLightning/pytorch-lightning/blob/master/.github/CONTRIBUTING.md), Pull Request section? - [x] Did you make sure to update the ...
2020-04-27T15:21:44Z
Feature to automatically choose batch size Let's add a flag: ```python # default False Trainer(auto_scale_batch_size=True) ``` This should do binary search on batch size: 1. Run a few train steps using the current batch size. 2. if OOM batch_size / 2. 3. If no OOM, batch_size = batch_size * 1.5. And s...
I'd recommend a proper binsearch instead, so more like: 1) start with `batch_size = 1` 2) double `batch_size` until OOM 3) binsearch between `batch_size//2` and `batch_size` Alternative mode: just use the highest power of 2 batch size that fits. I am doing this right now ```python def max_gpu_batch_size( ...
[ { "body": "Let's add a flag:\r\n\r\n```python\r\n# default False\r\nTrainer(auto_scale_batch_size=True)\r\n```\r\n\r\nThis should do binary search on batch size:\r\n\r\n1. Run a few train steps using the current batch size.\r\n2. if OOM batch_size / 2.\r\n3. If no OOM, batch_size = batch_size * 1.5.\r\n\r\nAnd...
25bbd059df68abc1b0ffa77ad2480af183d61b05
{ "head_commit": "522a206c83bb62ca7966ef99027395731d594f0d", "head_commit_message": "styling fix", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex f3190f9d7353d..9d648939724eb 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -14,6 +14,8 @@ The format is based on [Keep a Changelog](http://kee...
[ { "diff_hunk": "@@ -80,3 +100,223 @@ def configure_accumulated_gradients(self, accumulate_grad_batches):\n self.accumulation_scheduler = GradientAccumulationScheduler(schedule)\n else:\n raise TypeError(\"Gradient accumulation supports only int and dict types\")\n+\n+ def scal...
3122cb470ce9625308113bafd60fb198eebe5630
diff --git a/CHANGELOG.md b/CHANGELOG.md index 46c2ec88fe52b..f28e258e4fabd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added type hints in `Trainer.fit()` and `Trainer.test()` to reflect that also a list of dataload...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
Lightning-AI__pytorch-lightning-1378@066437e
Lightning-AI/pytorch-lightning
Python
1,378
Add warning for few workers
# Before submitting - [x] Was this discussed/approved via a Github issue? (no need for typos and docs improvements) - [x] Did you read the [contributor guideline](https://github.com/PyTorchLightning/pytorch-lightning/blob/master/.github/CONTRIBUTING.md), Pull Request section? - [x] Did you make sure to update the ...
2020-04-04T17:55:51Z
Training loop temporarily hangs after every 4 steps I am porting some of my code to pytorch lightning, and everything seems to work fine. However, for some reason after every 4 training steps I see some temporary hanging (~1 second), which is severely slowing down my overall training time. Am I missing some obvious con...
Hi! thanks for your contribution!, great first issue! @PyTorchLightning/core-contributors Thanks for the issue! Would it be possible to post the code that reproduces this error? I've only seen this sort of behaviour before when the number of data loading workers is low - are you working with large data here (e.g. big ...
[ { "body": "I am porting some of my code to pytorch lightning, and everything seems to work fine. However, for some reason after every 4 training steps I see some temporary hanging (~1 second), which is severely slowing down my overall training time. Am I missing some obvious configuration? This is my Trainer c...
22bedf9b57f4fd8e2b457d86a7d166bb6a642579
{ "head_commit": "066437ee1f3983844e89a2336ff3d3b52b58a362", "head_commit_message": "Update test", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex c329a33e91407..5151c43121580 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -26,6 +26,7 @@ The format is based on [Keep a Changelog](http://kee...
[ { "diff_hunk": "@@ -73,6 +74,14 @@ def _percent_range_check(self, name: str) -> None:\n if not 0. <= value <= 1.:\n raise ValueError(msg)\n \n+ def _worker_check(self, dataloader: DataLoader, name: str) -> None:\n+ msg = f'The dataloader, {name}, does not have many workers which ma...
9f7cc9b7972a4ad75888cb79b9cccf98bf88945c
diff --git a/CHANGELOG.md b/CHANGELOG.md index c329a33e91407..5151c43121580 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added model configuration checking ([#1199](https://github.com/PyTorchLightning/pytorch-lightning/...
{ "difficulty": "low", "estimated_review_effort": 3, "problem_domain": "Performance Optimizations" }
Lightning-AI__pytorch-lightning-1280@15600f6
Lightning-AI/pytorch-lightning
Python
1,280
Error on zero length dataloaders
# Before submitting - [x] Was this discussed/approved via a Github issue? (no need for typos and docs improvements) - [x] Did you read the [contributor guideline](https://github.com/PyTorchLightning/pytorch-lightning/blob/master/.github/CONTRIBUTING.md), Pull Request section? - [x] Did you make sure to update the ...
2020-03-29T12:28:31Z
Better message when DataLoader is wrong On the verge between bug and improvement. There was a bug in my Validation DataLoader and was returning irrelevant staff. Accidentally the length was 0. Probably an edge case combination. The error I was getting during the validation sanity check was quite cryptic: ``` Tr...
Hi! thanks for your contribution!, great first issue! yeah, better error messing always helps, thx and PR is welcome! :]
[ { "body": "On the verge between bug and improvement.\r\n\r\nThere was a bug in my Validation DataLoader and was returning irrelevant staff. Accidentally the length was 0. Probably an edge case combination. The error I was getting during the validation sanity check was quite cryptic:\r\n\r\n```\r\nTraceback (mo...
31b71483c47fa4aa688912b432726cdac0025a9b
{ "head_commit": "15600f60e40516862591af9b06ab15d1d532267a", "head_commit_message": "rebase", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex 90c9f49566bae..3dfc810b8b911 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](http://keepacha...
[ { "diff_hunk": "@@ -26,9 +26,14 @@\n \n \n def _has_len(dataloader: DataLoader) -> bool:\n+ \"\"\" Checks if a given Dataloader has __len__ method implemented i.e. if\n+ it is a finite dataloader or infinite dataloader \"\"\"\n try:\n # try getting the length\n- _ = len(dataloader)\n+ ...
bbe2a048623c8043c07ec9fb1b81a3ed847ebd4b
diff --git a/CHANGELOG.md b/CHANGELOG.md index 90c9f49566bae..3dfc810b8b911 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added a check that stops the training when loss or weights contain `NaN` or `inf` values. ([#1097]...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-1177@8f9eeb4
Lightning-AI/pytorch-lightning
Python
1,177
Fix Configuring Learning Rate Schedulers
# Before submitting - [x] Was this **discussed**/~~approved~~ via a Github issue? (no need for typos and docs improvements) - [x] Did you read the [contributor guideline](https://github.com/PyTorchLightning/pytorch-lightning/blob/master/.github/CONTRIBUTING.md), Pull Request section? - [x] Did you make sure to upd...
2020-03-18T00:29:42Z
Learning Rate Schedulers' default dictionary parameters should be set via the Trainer ## 🚀 Feature The default Learning Rate Schedulers (LRS) dictionary parameters should be settable from the Trainer constructor. ### Motivation The documentation doesn't seem to be clear that the LRS have the following additional...
I disagree mainly due to: * The trainer constructor already have many arguments, and this would potentially add 3 extra (the `'reduce_on_plateau'` is automatically determined from the LRS) arguments * The user can already set these in `configure_optimizers` method by passing a LRS as a dict with these keywords. * If...
[ { "body": "## 🚀 Feature\r\nThe default Learning Rate Schedulers (LRS) dictionary parameters should be settable from the Trainer constructor. \r\n\r\n### Motivation\r\nThe documentation doesn't seem to be clear that the LRS have the following additional parameters available to be set when you configure the opti...
73a911890b2e62242d5ad7bfa46bb3909b422081
{ "head_commit": "8f9eeb46b65bf0587c45a8a35b20afd5cde0000b", "head_commit_message": "Update docs so users know the desired manner of configuring learning rate schedulers.", "patch_to_review": "diff --git a/docs/source/optimizers.rst b/docs/source/optimizers.rst\nindex 1d9e77a7de036..9020d5009198f 100644\n--- a/do...
[ { "diff_hunk": "@@ -942,28 +942,36 @@ def configure_optimizers(self):\n dis_sched = CosineAnnealing(discriminator_opt, T_max=10) # called every epoch\n return [gen_opt, dis_opt], [gen_sched, dis_sched]\n \n- Some things to know\n+ Some things to note:\n \n- ...
7b1a4d7eca922733619612a3570a5b982e4489f0
diff --git a/docs/source/optimizers.rst b/docs/source/optimizers.rst index 1d9e77a7de036..9020d5009198f 100644 --- a/docs/source/optimizers.rst +++ b/docs/source/optimizers.rst @@ -19,6 +19,20 @@ Every optimizer you use can be paired with any `LearningRateScheduler <https://p def configure_optimizers(self): ...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "New Feature Additions" }
Lightning-AI__pytorch-lightning-866@5a0ccf4
Lightning-AI/pytorch-lightning
Python
866
Fixes resuming checkpoints rerunning last epoch
Fixes #850
2020-02-16T14:20:55Z
Epoch end checkpoint restarts previous epoch ## 🐛 Bug If restarting the training and reloading the model, the epoch that the checkpoint had just completed is restarted rather than beginning the next. ### Expected behavior When a checkpoint upon epoch end is saved, restarting it should resume its state and sta...
https://github.com/PyTorchLightning/pytorch-lightning/blob/edd4a87fb0e976e004a82c7a3491598ab65cafbd/pytorch_lightning/trainer/training_io.py#L389 This seems as simple as replacing the line above with ```self.current_epoch = checkpoint['epoch'] + 1``` since the checkpointers save at the end of validation and the main...
[ { "body": "## 🐛 Bug\r\n\r\nIf restarting the training and reloading the model, the epoch that the checkpoint had just completed is restarted rather than beginning the next.\r\n\r\n### Expected behavior\r\n\r\nWhen a checkpoint upon epoch end is saved, restarting it should resume its state and start the next ep...
6029fad989bcf6e9e630385e77ae7d0dbf112bac
{ "head_commit": "5a0ccf4cdf57cc92b2fd91fea6f1f9b280430cdd", "head_commit_message": "Formatting", "patch_to_review": "diff --git a/pytorch_lightning/trainer/training_io.py b/pytorch_lightning/trainer/training_io.py\nindex 2ee77ada4c5c4..7ae2d53609758 100644\n--- a/pytorch_lightning/trainer/training_io.py\n+++ b/p...
[ { "diff_hunk": "@@ -388,6 +388,14 @@ def restore_training_state(self, checkpoint):\n self.global_step = checkpoint['global_step']\n self.current_epoch = checkpoint['epoch']\n \n+ # Deals with peculiarity of different global step for odd vs even num_training_batches\n+ if abs((self....
8fa4cdd2180a93daaf8f553a7dafcad8dfd78fdb
diff --git a/pytorch_lightning/trainer/training_io.py b/pytorch_lightning/trainer/training_io.py index 2ee77ada4c5c4..4d439a3512913 100644 --- a/pytorch_lightning/trainer/training_io.py +++ b/pytorch_lightning/trainer/training_io.py @@ -125,6 +125,8 @@ def __init__(self): self.early_stop_callback = None ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-903@b1a88c5
Lightning-AI/pytorch-lightning
Python
903
Add support for multiple loggers
# Before submitting - [x] Was this discussed/approved via a Github issue? (no need for typos, doc improvements) - [ ] Did you read the [contributor guideline](https://github.com/PyTorchLightning/pytorch-lightning/blob/master/.github/CONTRIBUTING.md)? - [x] Did you make sure to update the docs? - [x] Did you wr...
2020-02-20T08:10:58Z
Using multiple loggers **Describe the solution you'd like** Trainer could receive a list of loggers instead of only one, all loggers would be called at the appropriate times. **Describe alternatives you've considered** Alternatively could create a customLogger that logged the information to all relevant destinatio...
What about using the existing base logger to create a composite logger that takes a list of loggers and calls them all? Would it be helpful to add an example of this to the docs?
[ { "body": "**Describe the solution you'd like**\r\nTrainer could receive a list of loggers instead of only one, all loggers would be called at the appropriate times.\r\n\r\n**Describe alternatives you've considered**\r\nAlternatively could create a customLogger that logged the information to all relevant destin...
20d15c8023602067eba1605c745448592b709477
{ "head_commit": "b1a88c52ff2ec70ce00a70854956e98a263cb85e", "head_commit_message": "Update CHANGELOG.md", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex b96da2d8d891f..2ae3ebd0ced66 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](ht...
[ { "diff_hunk": "@@ -23,52 +26,104 @@ def __init__(self):\n self._rank = 0\n \n @property\n- def experiment(self):\n+ def experiment(self) -> Any:", "line": 30, "original_line": 29, "original_start_line": null, "path": "pytorch_lightning/loggers/base.py", "start_line": null,...
63b62679e6d3c7933dc7863b724432476089445a
diff --git a/CHANGELOG.md b/CHANGELOG.md index 18f10757768c2..ee1349806af6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added Tensor Processing Unit (TPU) support ([#868](https://github.com/PyTorchLightning/pytorch-lig...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
Lightning-AI__pytorch-lightning-833@2c4931f
Lightning-AI/pytorch-lightning
Python
833
resolving documentation warnings
# Before submitting - [X] Was this discussed/approved via a Github issue? (no need for typos, doc improvements) - [X] Did you read the [contributor guideline](https://github.com/PyTorchLightning/pytorch-lightning/blob/master/.github/CONTRIBUTING.md)? - [X] Did you make sure to update the docs? - [ ] Did you wr...
2020-02-13T14:22:36Z
fix docs formatting ## 📚 Documentation At this moment the docs raise about 140 warnings which may cause some issues in documentation. To build the docs locally follow these steps: ```bash cd docs pip install -r requirements.txt make html ``` Thanks!
Nice to meet you! I'm Hanbyul Kim, a ML engineer working in South Korea. I'd like to contribute to ML open source for the first time, so I've been looking around several projects lately. And I found your repo and felt it's cool. Since I'm a newcomer, I guess it can be a good idea to start doing some "good first is...
[ { "body": "## 📚 Documentation\r\n\r\nAt this moment the docs raise about 140 warnings which may cause some issues in documentation.\r\nTo build the docs locally follow these steps:\r\n```bash\r\ncd docs\r\npip install -r requirements.txt\r\nmake html\r\n```\r\n\r\nThanks!\r\n", "number": 717, "title": ...
be244560b24b68b0236a4694707fb9bb63c2e6d0
{ "head_commit": "2c4931f8451c30c1885472294ccad97b35b0b104", "head_commit_message": "Apply suggestions from code review\r\n\r\njust to trigger CI", "patch_to_review": "diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml\nindex 8c6d4546bc00a..284d0ba3b4c85 100644\n--- a/.github/workflows...
[ { "diff_hunk": "@@ -10,5 +10,5 @@ jobs:\n - uses: actions/first-interaction@v1\n with:\n repo-token: ${{ secrets.GITHUB_TOKEN }}\n- issue-message: 'Hey, thanks for your contribution! Great first issue!'\n- pr-message: 'Hey, thanks for the input! Please give us a bit of time to re...
dabf843878697b5db3eaa2bf5d2c84b23138b951
diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index 8c6d4546bc00a..e932768947fde 100644 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -10,5 +10,5 @@ jobs: - uses: actions/first-interaction@v1 with: repo-token: ${{ secrets.GITHUB_TOKE...
{ "difficulty": "low", "estimated_review_effort": 3, "problem_domain": "Documentation Updates" }
Lightning-AI__pytorch-lightning-837@eedea96
Lightning-AI/pytorch-lightning
Python
837
advanced profiler describe + cleaned up tests
# Before submitting - [x] Was this discussed/approved via a Github issue? (no need for typos, doc improvements) - [x] Did you read the [contributor guideline](https://github.com/PyTorchLightning/pytorch-lightning/blob/master/.github/CONTRIBUTING.md)? - [x] Did you make sure to update the docs? - [x] Did you wr...
2020-02-14T04:06:12Z
advanced profiler description fails for python 3.6 ## 🐛 Bug Python 3.6 doesn't have the `pstats.SortKey.CUMULATIVE` enum so the profiler description breaks. ### To Reproduce Steps to reproduce the behavior: Use Python 3.6, pass in the AdvancedProfiler, get report at end of a training run. ``` profiler...
[ { "body": "## 🐛 Bug\r\n\r\nPython 3.6 doesn't have the `pstats.SortKey.CUMULATIVE` enum so the profiler description breaks.\r\n\r\n### To Reproduce\r\n\r\nSteps to reproduce the behavior:\r\n\r\nUse Python 3.6, pass in the AdvancedProfiler, get report at end of a training run. \r\n\r\n```\r\nprofiler = Advance...
539d1291789e2960960a9bfe85096eaed13d8a22
{ "head_commit": "eedea962b6d3e0407f2c096e54a45b1fd6c13e69", "head_commit_message": "add test case to capture previous bug", "patch_to_review": "diff --git a/pytorch_lightning/profiler/profiler.py b/pytorch_lightning/profiler/profiler.py\nindex 32f220897a9dc..ffecba5dff34b 100644\n--- a/pytorch_lightning/profiler...
[ { "diff_hunk": "@@ -26,6 +26,9 @@ def test_simple_profiler():\n np.testing.assert_allclose(p.recorded_durations[\"b\"], [2], rtol=0.2)\n np.testing.assert_allclose(p.recorded_durations[\"c\"], [1], rtol=0.2)\n \n+ # ensure this doesn't throw any errors\n+ description = p.describe()", "line": n...
232ea497eca0d2944a1c8575ca7459f13b3276b8
diff --git a/pytorch_lightning/profiler/profiler.py b/pytorch_lightning/profiler/profiler.py index 32f220897a9dc..ffecba5dff34b 100644 --- a/pytorch_lightning/profiler/profiler.py +++ b/pytorch_lightning/profiler/profiler.py @@ -163,8 +163,7 @@ def describe(self): self.recorded_stats = {} for action_n...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-1147@0ec101f
Lightning-AI/pytorch-lightning
Python
1,147
Custom argparser extension with Trainer arguments (argument types added)
# Before submitting - [x] Was this discussed/approved via a Github issue? (no need for typos and docs improvements) - [x] Did you read the [contributor guideline](https://github.com/PyTorchLightning/pytorch-lightning/blob/master/.github/CONTRIBUTING.md), Pull Request section? - [ ] Did you make sure to update the ...
2020-03-14T15:33:28Z
Can't cast Trainer automatically generated args to their required types ## ❓ Questions and Help #### What is your question? I'm not sure, that this is a bug, so I put it like a question. The problem is: if I want to add the Trainer arguments to my custom `ArgumentParser` object, I call the `add_argparse_args` Trai...
@alexeykarnachev could you pls give a complete example, I am missing which is the `ArgumentParser`... here it seems like you want to update the `trainer_args` by itself ``` trainer_args.update({'accumulate_grad_batches': int(trainer_args['accumulate_grad_batches']), ...) ``` if you need the default values, pls use ...
[ { "body": "## ❓ Questions and Help\r\n\r\n#### What is your question?\r\nI'm not sure, that this is a bug, so I put it like a question.\r\nThe problem is: if I want to add the Trainer arguments to my custom `ArgumentParser` object, I call the `add_argparse_args` Trainer classmethod. But this method doesn't cast...
f6dabc2fe9209876fd16d64a929ffc5edfa23cd6
{ "head_commit": "0ec101fc60c20ffe97d46531d5bddb19ebab9001", "head_commit_message": "typo fixed", "patch_to_review": "diff --git a/CHANGELOG.md b/CHANGELOG.md\nindex 4e17728f9424d..b0563977f14d6 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -25,7 +25,7 @@ The format is based on [Keep a Changelog](http://keep...
[ { "diff_hunk": "@@ -449,17 +449,52 @@ def default_attributes(cls):\n return args\n \n @classmethod\n- def add_argparse_args(cls, parent_parser: ArgumentParser) -> ArgumentParser:\n- \"\"\"Extend existing argparse by default `Trainer` attributes.\"\"\"\n- parser = ArgumentParser(pare...
63d30fdbf3a48c55c5a86cfffa80a2937500746b
diff --git a/CHANGELOG.md b/CHANGELOG.md index bbdf186208b10..c948e22e7b553 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,7 +29,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Fixed -- Fixed bug related to type checking of `ReduceLROnPlateau` lr schedulers([#1114](htt...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-782@343ab83
Lightning-AI/pytorch-lightning
Python
782
new feature for profiling training runs
# Before submitting - [x] Was this discussed/approved via a Github issue? (no need for typos, doc improvements) - [x] Did you read the [contributor guideline](https://github.com/PyTorchLightning/pytorch-lightning/blob/master/.github/CONTRIBUTING.md)? - [x] Did you make sure to update the docs? - [x] Did you wr...
2020-02-02T20:19:00Z
Feature: Profiling for a training run ## 🚀 Feature It'd be nice if the PyTorch Lightning Trainer had a way for profiling a training run so that I could easily identify where bottlenecks are occurring. ### Motivation I have been developing a model and had been using a small toy dataset to verify that everything...
Thanks to Github's suggestion, I found this similar issue #251 Great suggestion. I still prefer the logger approach instead of decorator. ### API I imagine it like: ``` Trainer(profile=True|False|Profiler) ``` - If True, we use default Profiler ``` self.profiler = Profiler(...) ``` - If False, no profi...
[ { "body": "## 🚀 Feature\r\nIt'd be nice if the PyTorch Lightning Trainer had a way for profiling a training run so that I could easily identify where bottlenecks are occurring. \r\n\r\n### Motivation\r\n\r\nI have been developing a model and had been using a small toy dataset to verify that everything is worki...
6d32595e2bf892428e65dbe7e32a57d3dcf4a448
{ "head_commit": "343ab83fe93c8ef62ec823e92ab34695924a9847", "head_commit_message": "option to dump cProfiler results to text file", "patch_to_review": "diff --git a/pytorch_lightning/trainer/trainer.py b/pytorch_lightning/trainer/trainer.py\nindex 0b15100606f6c..7026dd2aeefcf 100644\n--- a/pytorch_lightning/trai...
[ { "diff_hunk": "@@ -0,0 +1,178 @@\n+\"\"\"\n+Profiling your training run can help you understand if there are any bottlenecks in your code.\n+\n+PyTorch Lightning supports profiling standard actions in the training loop out of the box, including:\n+- on_epoch_start\n+- on_epoch_end\n+- on_batch_start\n+- tbptt_...
5ad693f20a256f03d664c891ceae7c69da70bbca
diff --git a/docs/source/common-cases.rst b/docs/source/common-cases.rst index 7b96a93d84660..cc4ca362fc551 100644 --- a/docs/source/common-cases.rst +++ b/docs/source/common-cases.rst @@ -13,9 +13,15 @@ gradient clipping modifying training via hooks ============================= - - .. toctree:: :maxdepth: 3 ...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
Lightning-AI__pytorch-lightning-575@b4e44fe
Lightning-AI/pytorch-lightning
Python
575
fix logging error
# Before submitting - [ ] Was this discussed/approved via a Github issue? (no need for typos, doc improvements) - [x] Did you read the [contributor guideline](https://github.com/williamFalcon/pytorch-lightning/blob/master/.github/CONTRIBUTING.md)? - [ ] Did you make sure to update the docs? - [ ] Did you write...
2019-12-03T09:19:11Z
Error in `logging` call `pt_callbacks.py` Stack trace: ``` .... [00:04<00:00, 1.83s/batch, batch_nb=1, loss=0.478, v_nb=13--- Logging error --- Traceback (most recent call last): File "/Users/kdang/.pyenv/versions/3.6.7/lib/python3.6/logging/__init__.py", line 994, in emit msg = self.format(record) F...
[ { "body": "Stack trace: \r\n\r\n```\r\n....\r\n[00:04<00:00, 1.83s/batch, batch_nb=1, loss=0.478, v_nb=13--- Logging error ---\r\nTraceback (most recent call last):\r\n File \"/Users/kdang/.pyenv/versions/3.6.7/lib/python3.6/logging/__init__.py\", line 994, in emit\r\n msg = self.format(record)\r\n File \...
89ececb32ba0cfd810737cb90b2285a27332f5d4
{ "head_commit": "b4e44fe20f37a1297babafa0c82120b5b644ecb1", "head_commit_message": "fix logging error", "patch_to_review": "diff --git a/pytorch_lightning/callbacks/pt_callbacks.py b/pytorch_lightning/callbacks/pt_callbacks.py\nindex c55a48849696f..29279541ee571 100644\n--- a/pytorch_lightning/callbacks/pt_callb...
[ { "diff_hunk": "@@ -312,15 +312,15 @@ def on_epoch_end(self, epoch, logs=None):\n self.best = max(self.best_k_models.values())\n if self.verbose > 0:\n logging.info(\n- f'\\nEpoch {epoch:05d}: {self.mo...
0228fba45a543ec7ebb5d74465c9b516b728e897
diff --git a/pytorch_lightning/callbacks/pt_callbacks.py b/pytorch_lightning/callbacks/pt_callbacks.py index c55a48849696f..1951719877199 100644 --- a/pytorch_lightning/callbacks/pt_callbacks.py +++ b/pytorch_lightning/callbacks/pt_callbacks.py @@ -312,16 +312,16 @@ def on_epoch_end(self, epoch, logs=None): ...
{ "difficulty": "low", "estimated_review_effort": 1, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-481@0c01ee4
Lightning-AI/pytorch-lightning
Python
481
Comet fix
# Before submitting - [X] Was this discussed/approved via a Github issue? (no need for typos, doc improvements) - [X] Did you read the [contributor guideline](https://github.com/williamFalcon/pytorch-lightning/blob/master/.github/CONTRIBUTING.md)? - [X] Did you make sure to update the docs? - [x] Did you write...
2019-11-08T16:51:57Z
CometLogger does not implement name() and version() class methods Explicitly creating a CometLogger instance and passing it to Trainer using trainer(logger=my_comet_logger) raises a NotImplementedError because CometLogger does not implement the name() and version() class methods. Below is the traceback: ` Tracebac...
[ { "body": "Explicitly creating a CometLogger instance and passing it to Trainer using trainer(logger=my_comet_logger) raises a NotImplementedError because CometLogger does not implement the name() and version() class methods.\r\n\r\nBelow is the traceback:\r\n`\r\nTraceback (most recent call last):\r\n File \"...
e22dea228f32966675eb760d6df56f1141f45b8c
{ "head_commit": "0c01ee45d53db041492a24b211682af2a38c1a9d", "head_commit_message": "Adding offline logging mode for comet_ml, updating tests and docs", "patch_to_review": "diff --git a/.run_local_tests.sh b/.run_local_tests.sh\nindex 57d40c26b0ee5..0b06d104f5f70 100644\n--- a/.run_local_tests.sh\n+++ b/.run_loca...
[ { "diff_hunk": "@@ -30,10 +33,25 @@ def __init__(self, api_key, workspace, rest_api_key=None, project_name=None, exp\n super().__init__()\n self._experiment = None\n \n- self.api_key = api_key\n+ # Determine online or offline mode based on which arguments were passed to CometLogger...
18c706d718fbfaca3f001a44d2b00d31722d9c4f
diff --git a/.run_local_tests.sh b/.run_local_tests.sh index 57d40c26b0ee5..0b06d104f5f70 100644 --- a/.run_local_tests.sh +++ b/.run_local_tests.sh @@ -2,6 +2,7 @@ rm -rf _ckpt_* rm -rf tests/save_dir* rm -rf tests/mlruns_* +rm -rf tests/cometruns* rm -rf tests/tests/* rm -rf lightning_logs coverage run --source...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-453@eab2fe7
Lightning-AI/pytorch-lightning
Python
453
Fix min_max gpu memory logging bug
## Before submitting - Was this discussed/approved via a Github issue? Yes. #452 - Did you read the [contributor guideline](https://github.com/williamFalcon/pytorch-lightning/blob/master/.github/CONTRIBUTING.md)? Yes. - Did you make sure to update the docs? N/A - Did you write any new necessary tests? Yes. #...
2019-11-03T14:35:56Z
min_max log_gpu_memory option bug **Describe the bug** Setting `log_gpu_memory='min_max'` in `Trainer` leads to the following bug. ``` Traceback (most recent call last): File "/opt/conda/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 347, in fit self.single_gpu_train(model) File...
[ { "body": "**Describe the bug**\r\nSetting `log_gpu_memory='min_max'` in `Trainer` leads to the following bug.\r\n\r\n```\r\nTraceback (most recent call last):\r\n File \"/opt/conda/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py\", line 347, in fit\r\n self.single_gpu_train(model)\r\n Fil...
37729f0a17995e847fa8693f0fe694f8dd0b259b
{ "head_commit": "eab2fe7794de3a8d1fce98df954ba79d9d0d1852", "head_commit_message": "#452 Add test for get_memory_profile", "patch_to_review": "diff --git a/pytorch_lightning/root_module/memory.py b/pytorch_lightning/root_module/memory.py\nindex d16d2659405cf..3b968bb3bfdeb 100644\n--- a/pytorch_lightning/root_mo...
[ { "diff_hunk": "@@ -224,17 +215,18 @@ def get_gpu_memory_map():\n Keys are device ids as integers.\n Values are memory usage as integers in MB.\n \"\"\"\n- result = subprocess.check_output(\n+ result = subprocess.run(\n [\n- 'nvidia-smi', '--query-gpu=memory.used',\n...
dacc4de727c6329a6773eaf0d3e14a209eaab954
diff --git a/pytorch_lightning/root_module/memory.py b/pytorch_lightning/root_module/memory.py index d16d2659405cf..53203e7ae6a01 100644 --- a/pytorch_lightning/root_module/memory.py +++ b/pytorch_lightning/root_module/memory.py @@ -3,6 +3,7 @@ ''' import gc +import os import subprocess import numpy as np @@ -1...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
PrefectHQ__prefect-18444@1ffae47
PrefectHQ/prefect
Python
18,444
Add setting for configuring custom headers
Adds a new setting for configuring custom client headers, including documentation. Closes https://github.com/PrefectHQ/prefect/issues/18435
2025-07-07T01:34:51Z
Add Cloudflare Access Client ID/secret in every request headers ### Describe the current behavior I am trying to use Prefect OSS in a secure way. Thus I wanted to add Cloudflare Access Service Auth, in order to protect the `/api` endpoint, but at the moment it is not working. ### Describe the proposed behavior Would...
[ { "body": "### Describe the current behavior\n\nI am trying to use Prefect OSS in a secure way.\nThus I wanted to add Cloudflare Access Service Auth, in order to protect the `/api` endpoint, but at the moment it is not working.\n\n### Describe the proposed behavior\n\nWould it be possible to add the values belo...
19a4b4d5cc72b1f61855006b21be4e2a9906ef26
{ "head_commit": "1ffae47744a262eb97239cdcebe34b1d9ab31f64", "head_commit_message": "Fix settings test to accomodate new setting", "patch_to_review": "diff --git a/docs/v3/advanced/api-client.mdx b/docs/v3/advanced/api-client.mdx\nindex 797d6e4fa487..c1e56a1c6b59 100644\n--- a/docs/v3/advanced/api-client.mdx\n+++...
[ { "diff_hunk": "@@ -203,3 +204,94 @@ def test_websocket_proxy_creation_is_deferred():\n os.environ[\"HTTPS_PROXY\"] = old_proxy\n elif \"HTTPS_PROXY\" in os.environ:\n del os.environ[\"HTTPS_PROXY\"]\n+\n+\n+def test_websocket_custom_headers():\n+ \"\"\"Test that custom header...
fdeebcd59774925635072fb8f531d4fa88efc745
diff --git a/docs/v3/advanced/api-client.mdx b/docs/v3/advanced/api-client.mdx index 797d6e4fa487..c1e56a1c6b59 100644 --- a/docs/v3/advanced/api-client.mdx +++ b/docs/v3/advanced/api-client.mdx @@ -1,6 +1,6 @@ --- -title: How to use the Prefect API client -sidebarTitle: Use the API client +title: How to use and confi...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
Lightning-AI__pytorch-lightning-448@a895c45
Lightning-AI/pytorch-lightning
Python
448
Ddp2 fix
This PR does the following: 1. Fixes #446 2. Adds a hook for modifying ddp init. Related to #353 3. adds a hook for modifying apex.
2019-11-01T19:20:49Z
Add a way to operate on all outputs from training_step I realized the ddp2 implementation i put together doesn't allow the user to operate on the ouputs of all DP processes. For instance, you calculate some logits on each process and current ddp2 forces the loss to be calculated in each process individually. However...
I think it's a little confusing for the user. If I'm understanding correctly, this would only work for dp and ddp2, but not for ddp. Would this break the idea that the same code should work across different backends? well, for ddp you don’t need to do this because you’re not sharing across processes. the PR i submi...
[ { "body": "I realized the ddp2 implementation i put together doesn't allow the user to operate on the ouputs of all DP processes.\r\n\r\nFor instance, you calculate some logits on each process and current ddp2 forces the loss to be calculated in each process individually. However, if you wanted to say normalize...
32dd803b1ebed02d3ca05705b719880b57b8830a
{ "head_commit": "a895c45ec40837033f0efaba2b0bb18db5aef006", "head_commit_message": "bananas", "patch_to_review": "diff --git a/README.md b/README.md\nindex 1797c2b217acc..2c08869933f64 100644\n--- a/README.md\n+++ b/README.md\n@@ -294,6 +294,7 @@ Lightning also adds a text column with all the hyperparameters for...
[ { "diff_hunk": "@@ -293,6 +295,13 @@ def training_forward(self, batch, batch_nb, opt_idx, hiddens):\n else:\n output = self.model.training_step(*args)\n \n+ # allow any mode to define training_end\n+ # dp and ddp2 need it but optional for all others", "line": null, "ori...
9f11a049d0eb61fa4e7211db8d02a0cc81adbea2
diff --git a/README.md b/README.md index f0cd30db5d40c..0db819f9178e9 100644 --- a/README.md +++ b/README.md @@ -294,6 +294,7 @@ Lightning also adds a text column with all the hyperparameters for this experime #### Distributed training +- [Implement Your Own Distributed (DDP) training](https://williamfalcon.gi...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
PrefectHQ__prefect-18232@412c3e6
PrefectHQ/prefect
Python
18,232
Subclassing to set the max_range per sandox environment (#18083)
closes #18083 When prefect is imported, it sets a jinja.sandbox.MAX_RANGE globally. This affects all other processes that might use jinja, including dbt. Therefore, the change subclasses the environment to a new class so that the range can be set for just that class and thus dbt (and other jinja environments) ...
2025-06-04T08:56:11Z
prefect-dbt with dbt-snowlfake>=1.9.4 errors out ### Bug summary I tried upgrading my dependencies which moved `dbt-snowflake` from 1.9.2 to 1.9.4 However my `prefect-dbt==0.5.5` flows began to fail with: ``` in exception_handler raise DbtRuntimeError(str(e)) from e dbt_common.exceptions.base.DbtRuntimeError: Run...
Here's an MRE. ```python # /// script # requires-python = ">=3.11" # dependencies = [ # "prefect==2.20.18", # "prefect-dbt", # "dbt-snowflake==1.9.4", # ] # /// from pathlib import Path import tempfile import textwrap from prefect import flow from prefect_dbt.cli.commands import trigger_dbt_cli_command @fl...
[ { "body": "### Bug summary\n\nI tried upgrading my dependencies which moved `dbt-snowflake` from 1.9.2 to 1.9.4\n\nHowever my `prefect-dbt==0.5.5` flows began to fail with:\n```\nin exception_handler\n raise DbtRuntimeError(str(e)) from e\ndbt_common.exceptions.base.DbtRuntimeError: Runtime Error\n Range to...
5fa9936c7a1638db9eb9c5cf45ff19a05a47c692
{ "head_commit": "412c3e698f05c56642b2b2577b2154af7930cd7b", "head_commit_message": "Merge branch 'main' into bump-jinja-range", "patch_to_review": "diff --git a/src/prefect/server/utilities/user_templates.py b/src/prefect/server/utilities/user_templates.py\nindex 320459b03d62..ff70b4788b62 100644\n--- a/src/pref...
[ { "diff_hunk": "@@ -14,12 +13,30 @@\n logger: \"logging.Logger\" = get_logger(__name__)\n \n \n-jinja2.sandbox.MAX_RANGE = 100\n+MAX_TEMPLATE_RANGE = 100\n MAX_LOOP_COUNT = 10\n MAX_NESTED_LOOP_DEPTH = 2\n \n \n-_template_environment = ImmutableSandboxedEnvironment(\n+def _check_template_range(*args: int) -> ra...
43efbec1b7c9430102721dbe0ff8a9728257f77d
diff --git a/src/prefect/server/utilities/user_templates.py b/src/prefect/server/utilities/user_templates.py index 320459b03d62..c13cfc44bed9 100644 --- a/src/prefect/server/utilities/user_templates.py +++ b/src/prefect/server/utilities/user_templates.py @@ -2,7 +2,6 @@ from typing import TYPE_CHECKING, Any, Optiona...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
PrefectHQ__prefect-18410@dfc2ded
PrefectHQ/prefect
Python
18,410
Resolve dbt profiles and other improvements
<!-- Thanks for opening a pull request to Prefect! If this is your first contribution, please make sure to review our contribution guidelines: https://docs.prefect.io/contribute/index --> <!-- Include an overview of the proposed changes here --> Closes #18430 This PR makes a number of improvements and fixes...
2025-07-01T06:52:33Z
prefect-dbt - template rendering stopped working in 0.7.1 ### Bug summary During the release candidate for prefect dbt (0.7.0rc1) - template rendering as defined in the docs was working. However after upgrading to 0.7.1 - same flow no changes is erroring out with: ``` ValueError: Failed to invoke dbt command 'debug...
[ { "body": "### Bug summary\n\nDuring the release candidate for prefect dbt (0.7.0rc1) - template rendering as defined in the docs was working. \n\nHowever after upgrading to 0.7.1 - same flow no changes is erroring out with:\n\n```\nValueError: Failed to invoke dbt command 'debug': Compilation Error\n Could no...
0efc8d5417789ba9a27156e816f1ce28ac0924ee
{ "head_commit": "dfc2dede9940d2c31c9ca9c56c4c573ad070a939", "head_commit_message": "test for skipped nodes", "patch_to_review": "diff --git a/src/integrations/prefect-dbt/prefect_dbt/core/_tracker.py b/src/integrations/prefect-dbt/prefect_dbt/core/_tracker.py\nindex 933f273dc83f..8ca272378c8a 100644\n--- a/src/i...
[ { "diff_hunk": "@@ -153,12 +167,27 @@ def manifest(self) -> Manifest:\n return self._manifest\n \n @property\n- def project(self) -> RuntimeConfig:\n+ def project(self) -> Project:\n if self._project is None:\n self._set_project_from_project_dir()\n assert self....
42449a23ea262d5562d7fc0e05df80213fc9f313
diff --git a/src/integrations/prefect-dbt/prefect_dbt/core/_tracker.py b/src/integrations/prefect-dbt/prefect_dbt/core/_tracker.py index 933f273dc83f..8ca272378c8a 100644 --- a/src/integrations/prefect-dbt/prefect_dbt/core/_tracker.py +++ b/src/integrations/prefect-dbt/prefect_dbt/core/_tracker.py @@ -3,10 +3,12 @@ ""...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
PaddlePaddle__PaddleNLP-6812@9c45846
PaddlePaddle/PaddleNLP
Python
6,812
Update FG for latest paddle and cuda
<!-- Demo: https://github.com/PaddlePaddle/PaddleNLP/pull/26 --> ### PR types <!-- One of [ New features | Bug fixes | Function optimization | Performance optimization | Breaking changes | Others ] --> Bug fixes ### PR changes <!-- One of [ Models | APIs | Docs | Others ] --> Others ### Description <!-- Des...
2023-08-24T03:08:29Z
[Question]: 中文摘要模型export加速build出错 中文摘要unimo模型导出静态图模式报错: > [2022-10-20` 15:15:01,602] [ INFO] - Already cached C:\Users\wangyiting\.paddlenlp\models\unimo-text-1.0-summary\unimo-text-1.0-summary.pdparams W1020 15:15:01.602730 63484 gpu_resources.cc:61] Please NOTE: device: 0, GPU Compute Capability: 8.6, Driver A...
请问您那边是Windows环境是吗 你好,windows暂时不支持,目前支持的环境为Linux+CUDA 对windows环境,好的换成服务器了,在linux环境下执行报错,请问可以帮忙看下是哪里的问题吗,谢谢 > Scanning dependencies of target cuda_kernels [ 2%] Building CUDA object fastertransformer/cuda/CMakeFiles/cuda_kernels.dir/cuda_kernels.cu.o nvcc warning : The -std=c++14 flag is not supported with the conf...
[ { "body": "中文摘要unimo模型导出静态图模式报错:\r\n\r\n> [2022-10-20` 15:15:01,602] [ INFO] - Already cached C:\\Users\\wangyiting\\.paddlenlp\\models\\unimo-text-1.0-summary\\unimo-text-1.0-summary.pdparams\r\nW1020 15:15:01.602730 63484 gpu_resources.cc:61] Please NOTE: device: 0, GPU Compute Capability: 8.6, Driver API ...
2f3eac3e2982a78871eae7783da85254a4acf701
{ "head_commit": "9c45846a9b8e2aaa69c6952a472c2707ae143372", "head_commit_message": "update", "patch_to_review": "diff --git a/paddlenlp/ops/CMakeLists.txt b/paddlenlp/ops/CMakeLists.txt\nindex fb73814be68e..b54bec507b97 100644\n--- a/paddlenlp/ops/CMakeLists.txt\n+++ b/paddlenlp/ops/CMakeLists.txt\n@@ -24,7 +24,...
[ { "diff_hunk": "@@ -198,9 +201,17 @@ def build_with_command(self, ext_builder):\n # `GetCUDAComputeCapability` is not exposed yet, and detect CUDA/GPU\n # version in cmake file.\n # self.cmake_args += [f\"-DSM={self.sm}\"] if self.sm is not None else []\n- self.cmake_args += [\"-D...
4e3d473d992f7f712f08033a8d059d5c11428396
diff --git a/paddlenlp/ops/CMakeLists.txt b/paddlenlp/ops/CMakeLists.txt index fb73814be68e..1e6263ea2062 100644 --- a/paddlenlp/ops/CMakeLists.txt +++ b/paddlenlp/ops/CMakeLists.txt @@ -24,7 +24,7 @@ endif() INCLUDE(ExternalProject) -set(CXX_STD "14" CACHE STRING "C++ standard") +set(CXX_STD "17" CACHE STRING "C+...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
Lightning-AI__pytorch-lightning-128@3bb6e3e
Lightning-AI/pytorch-lightning
Python
128
change Checkpoint callback's `save_best_only` to `save_top_k`
this pr should close #70 bringing `save_function` outside of `pytorch_lightning/callbacks/pt_callbacks.py` is really confusing, since in that case `pt_callbacks.py` cannot be run on its own :new_moon_with_face: not sure where to add the tests, so I appended them at the end of the file.
2019-08-17T03:07:10Z
change Checkpoint callback's `save_best_only` to `save_top_k` **Is your feature request related to a problem? Please describe.** `save_best_only` is a special case of `save_top_k`. However, `save_tok_k` checkpoints can be used to create ensemble model during the test time. **Describe the solution you'd like** keep...
@vincentzlt good suggestion. I like the change. Any takers? @vincentzlt interested in making this change? i'm interested in this feature, i'll give it a try :smile: awesome! Hi, I have some questions. I noticed `save_function` option was deleted in this commit: https://github.com/williamFalcon/pytorch-lightning/...
[ { "body": "**Is your feature request related to a problem? Please describe.**\r\n`save_best_only` is a special case of `save_top_k`. However, `save_tok_k` checkpoints can be used to create ensemble model during the test time.\r\n\r\n**Describe the solution you'd like**\r\nkeep a dict of `{epoch: monitor}` of le...
d120c1edd8689e05e0949aba979d1a38c2aefb84
{ "head_commit": "3bb6e3eac46d3cdf09c7354c4b7c8b8c535e1867", "head_commit_message": "Update test_models.py", "patch_to_review": "diff --git a/docs/Trainer/Checkpointing.md b/docs/Trainer/Checkpointing.md\nindex de99f9589b141..7abb25e90e724 100644\n--- a/docs/Trainer/Checkpointing.md\n+++ b/docs/Trainer/Checkpoint...
[ { "diff_hunk": "@@ -27,6 +27,85 @@\n # TESTS\n # ------------------------------------------------------------------------\n \n+def test_model_checkpoint_options():", "line": null, "original_line": 30, "original_start_line": null, "path": "tests/test_models.py", "start_line": null, "text"...
b000db98f4bdd7a7b7e4ba06e2fe601ee61878e5
diff --git a/docs/Trainer/Checkpointing.md b/docs/Trainer/Checkpointing.md index 791e72ebd5955..b6f57e0805c4b 100644 --- a/docs/Trainer/Checkpointing.md +++ b/docs/Trainer/Checkpointing.md @@ -1,6 +1,7 @@ Lightning can automate saving and loading checkpoints. --- + ### Model saving Checkpointing is enabled by def...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "New Feature Additions" }
PaddlePaddle__PaddleNLP-6725@fbfe7bf
PaddlePaddle/PaddleNLP
Python
6,725
fix trainer during saving checkpoints
<!-- Demo: https://github.com/PaddlePaddle/PaddleNLP/pull/26 --> ### PR types <!-- One of [ New features | Bug fixes | Function optimization | Performance optimization | Breaking changes | Others ] --> Bug fixes ### PR changes <!-- One of [ Models | APIs | Docs | Others ] --> Others ### Description <!-- Des...
2023-08-15T02:21:53Z
[Bug]: 单卡微调gpt-3模型,出现GPTTrainer获取不到dp_group ### 软件环境 ```Markdown - paddlepaddle:2.5.0 - paddlepaddle-xpu: 2.5.0 - paddlenlp: 2.6.0rc0.post0 ``` ### 重复问题 - [X] I have searched the existing issues ### 错误描述 ```Markdown 单卡微调时,通过paddle.distributed.get_world_size()获取world_size的值为1, 无法对dp_group属性进行赋值。只有当world_size大于1...
你贴一下 报错吧。
[ { "body": "### 软件环境\n\n```Markdown\n- paddlepaddle:2.5.0\r\n- paddlepaddle-xpu: 2.5.0\r\n- paddlenlp: 2.6.0rc0.post0\n```\n\n\n### 重复问题\n\n- [X] I have searched the existing issues\n\n### 错误描述\n\n```Markdown\n单卡微调时,通过paddle.distributed.get_world_size()获取world_size的值为1,\r\n无法对dp_group属性进行赋值。只有当world_size大于1时,才会赋...
3fe62a16a97ce23e34f529fb245d261d9b9f3207
{ "head_commit": "fbfe7bfa2a0fa5fa6762e27e1ab9e4151e33e651", "head_commit_message": "fix", "patch_to_review": "diff --git a/paddlenlp/trainer/training_args.py b/paddlenlp/trainer/training_args.py\nindex 39dc07a7512a..828288c1e3fc 100644\n--- a/paddlenlp/trainer/training_args.py\n+++ b/paddlenlp/trainer/training_a...
[ { "diff_hunk": "@@ -766,8 +766,9 @@ def __post_init__(self):\n if len(self.sharding) == 0 and self.sharding_parallel_degree > 0:\n warnings.warn(\"`--sharding_parallel_degree` is useful only when `--sharding` is specified.\")\n \n- if len(self.sharding) > 0 or self.tensor_parallel_deg...
cf56f355f7ca4245ec2d98005bb5d485c5d03696
diff --git a/paddlenlp/trainer/training_args.py b/paddlenlp/trainer/training_args.py index 88c1581adfee..b72e365211ee 100644 --- a/paddlenlp/trainer/training_args.py +++ b/paddlenlp/trainer/training_args.py @@ -790,7 +790,9 @@ def __post_init__(self): if len(self.sharding) == 0 and self.sharding_parallel_degre...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
PaddlePaddle__PaddleNLP-3260@3f185fb
PaddlePaddle/PaddleNLP
Python
3,260
[BugFix]update vocab_size in init_config
### PR types Bug fixes ### PR changes Models ### Description try to fix: https://github.com/PaddlePaddle/PaddleNLP/issues/3254
2022-09-14T02:53:47Z
增加special tokens后,save_pretrained保存的model_config,vocab size没有改变 问题:增加special tokens后,进行resize_token_embeddings,save_pretrained保存的model_config,vocab size没有改变,导致from_pretrained的时候,embedding层加载有误,而且没有warning。 版本:PaddleNLP develop 复现代码: ```python import os from paddlenlp.transformers import GPTModel, GPTTokenizer ...
## 问题分析 此问题源于`resize_token_embeddings`中对于`vocab_size`信息的修改是基于[`config`](https://github.com/PaddlePaddle/PaddleNLP/blob/develop/paddlenlp/transformers/model_utils.py#L130),可是系统当中还存储的有:[`init_config`](https://github.com/PaddlePaddle/PaddleNLP/blob/develop/paddlenlp/transformers/utils.py#L163). 在模型`save_pretrained`...
[ { "body": "问题:增加special tokens后,进行resize_token_embeddings,save_pretrained保存的model_config,vocab size没有改变,导致from_pretrained的时候,embedding层加载有误,而且没有warning。\r\n\r\n版本:PaddleNLP develop\r\n\r\n复现代码:\r\n```python\r\nimport os\r\nfrom paddlenlp.transformers import GPTModel, GPTTokenizer\r\n\r\nmodel = GPTModel(**GPTMo...
e1f700a0a2c70537304d5776b8ead6163e193e32
{ "head_commit": "3f185fb86fb231ff6e6c7cde431b4bf47fc62882", "head_commit_message": "update vocab_size in init_config", "patch_to_review": "diff --git a/paddlenlp/transformers/model_utils.py b/paddlenlp/transformers/model_utils.py\nindex db5c57cc79bf..11ea3f559774 100644\n--- a/paddlenlp/transformers/model_utils....
[ { "diff_hunk": "@@ -546,6 +546,20 @@ def resize_token_embeddings(self,\n self.base_model.config['vocab_size'] = new_num_tokens\n self.vocab_size = new_num_tokens\n \n+ # update init_config\n+ def update_init_config_vocab_size_field(sub_dict: dict):\n+ if 'vocab_size' in ...
ca95199cf4ca97bed8635bee7975bd51fba20bc2
diff --git a/paddlenlp/transformers/model_utils.py b/paddlenlp/transformers/model_utils.py index db5c57cc79bf..f9ba83006492 100644 --- a/paddlenlp/transformers/model_utils.py +++ b/paddlenlp/transformers/model_utils.py @@ -19,7 +19,7 @@ import six import logging import inspect -from typing import Optional +from typi...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
PrefectHQ__prefect-18195@4038295
PrefectHQ/prefect
Python
18,195
setting to disable cache globally
closes https://github.com/PrefectHQ/prefect/issues/18161 Adds a new setting `PREFECT_TASKS_DISABLE_CACHING` that allows users to globally disable task caching, even when tasks have explicit `cache_policy` parameters set. ### Example ```python from prefect import task from prefect.cache_policies import TASK_S...
2025-05-28T21:48:59Z
Prefect caching activated when setting cache_policy ### Bug summary When I define a task like ``` @task(name="Extract Task", cache_policy=TASK_SOURCE) def extract(x): logger = get_run_logger() logger.info("inside extract task") return x + 1 ``` caching is automatically activated, even though I do not defi...
hi @OliverKleinBST - thanks for the issue! currently, explicitly setting a `cache_policy` is meant to enable caching. > What I want to achieve is that I can control caching via PREFECT_RESULTS_PERSIST_BY_DEFAULT=true / false > to allow me to globally enable or disable caching - while explicitly not setting persists_...
[ { "body": "### Bug summary\n\nWhen I define a task like\n\n```\n@task(name=\"Extract Task\", cache_policy=TASK_SOURCE)\ndef extract(x):\n logger = get_run_logger()\n logger.info(\"inside extract task\")\n return x + 1\n```\ncaching is automatically activated, even though I do not define persist_result=...
18563e53e1a449088b95da7ee4878e8ff123cccb
{ "head_commit": "4038295fb90e4f9ac32da1a6e13ece00388b0a90", "head_commit_message": "add to list of settings", "patch_to_review": "diff --git a/src/prefect/settings/models/tasks.py b/src/prefect/settings/models/tasks.py\nindex 5dd2cef4fb24..6d006c517393 100644\n--- a/src/prefect/settings/models/tasks.py\n+++ b/sr...
[ { "diff_hunk": "@@ -466,6 +466,10 @@ def __init__(\n ):\n persist_result = True\n \n+ # Check for global cache disable setting\n+ if settings.tasks.disable_cache:\n+ persist_result = False", "line": null, "original_line": 471, "original_start_line...
7b2c7d8a5a70b0c9eeb256a46abb565a31a3533b
diff --git a/src/prefect/settings/models/tasks.py b/src/prefect/settings/models/tasks.py index 5dd2cef4fb24..12b6bf6dd86b 100644 --- a/src/prefect/settings/models/tasks.py +++ b/src/prefect/settings/models/tasks.py @@ -63,6 +63,11 @@ class TasksSettings(PrefectBaseSettings): description="If `True`, sets the de...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
PaddlePaddle__PaddleNLP-1535@2f7c540
PaddlePaddle/PaddleNLP
Python
1,535
Fix albert tokenizer
<!-- Demo: https://github.com/PaddlePaddle/PaddleNLP/pull/26 --> ### PR types <!-- One of [ New features | Bug fixes | Function optimization | Performance optimization | Breaking changes | Others ] --> Bug fixes ### PR changes <!-- One of [ Models | APIs | Docs | Others ] --> Models ### Description <!-- Describ...
2021-12-29T12:32:19Z
AlbertTokenizer Pad的id是否正确? 欢迎您反馈PaddleNLP使用问题,非常感谢您对PaddleNLP的贡献! 在留下您的问题时,辛苦您同步提供如下信息: - 版本、环境信息 1)PaddleNLP和PaddlePaddle版本:请提供您的PaddleNLP和PaddlePaddle版本号,例如PaddleNLP 2.0.4,PaddlePaddle2.1.1 PaddleNLP 2.1.1 PaddlePaddle-GPU 2.2.0 2)系统环境:请您描述系统类型,例如Linux/Windows/MacOS/,python版本 Linux Python 3.8.11 - 复现信息:如为报错,请...
我在调整batch_size的大小时,发现不同的batch_size得到了截然不同的结果 > 我在调整batch_size的大小时,发现不同的batch_size得到了截然不同的结果 可以给出具体的代码吗? 我刚刚试了一下pad_token_id=0 测试代码 ```python import paddle from paddlenlp.transformers import AlbertTokenizer from paddlenlp.transformers import AlbertModel model = AlbertModel.from_pretrained('albert-chinese-small...
[ { "body": "欢迎您反馈PaddleNLP使用问题,非常感谢您对PaddleNLP的贡献!\r\n在留下您的问题时,辛苦您同步提供如下信息:\r\n- 版本、环境信息\r\n1)PaddleNLP和PaddlePaddle版本:请提供您的PaddleNLP和PaddlePaddle版本号,例如PaddleNLP 2.0.4,PaddlePaddle2.1.1\r\nPaddleNLP 2.1.1 PaddlePaddle-GPU 2.2.0\r\n2)系统环境:请您描述系统类型,例如Linux/Windows/MacOS/,python版本\r\nLinux Python 3.8.11\r\n- 复现信息:如...
51793e8f15aff551a3f92869ce48c0d6374d99b2
{ "head_commit": "2f7c540c238fec7c03ecd12d42b63f4be6004049", "head_commit_message": "Fix albert tokenizer", "patch_to_review": "diff --git a/paddlenlp/transformers/albert/tokenizer.py b/paddlenlp/transformers/albert/tokenizer.py\nindex 7a854b7c0821..5d63a1e6f166 100644\n--- a/paddlenlp/transformers/albert/tokeniz...
[ { "diff_hunk": "@@ -663,32 +825,55 @@ class AlbertChineseTokenizer(BertTokenizer):\n }\n pretrained_init_configuration = {\n \"albert-chinese-tiny\": {\n- \"do_lower_case\": False\n+ \"do_lower_case\": False,\n+ \"unk_token\": \"[UNK]\",\n+ \"sep_token...
05f604d7705ff4da973e065cacee6950bcb97e8b
diff --git a/paddlenlp/transformers/albert/tokenizer.py b/paddlenlp/transformers/albert/tokenizer.py index d498049dffbb..be73e11d5389 100644 --- a/paddlenlp/transformers/albert/tokenizer.py +++ b/paddlenlp/transformers/albert/tokenizer.py @@ -133,46 +133,90 @@ class AlbertTokenizer(PretrainedTokenizer): pretrain...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
PaddlePaddle__PaddleNLP-464@ca54f4a
PaddlePaddle/PaddleNLP
Python
464
fix 2.0.1 crf bug
<!-- Demo: https://github.com/PaddlePaddle/PaddleNLP/pull/26 --> ### PR types <!-- One of [ New features | Bug fixes | Function optimization | Performance optimization | Breaking changes | Others ] --> Bug fixes ### PR changes <!-- One of [ Models | APIs | Docs | Others ] --> Models ### Description <!-- Describ...
2021-05-31T08:19:12Z
window系统运行出现普遍性的报错The current variable type is (int64_t), but the previous variable type is (int). InvalidArgumentError: The DataType of greater_than Op's duplicable Variable Y must be consistent. The current variable type is (int64_t), but the previous variable type is (int). (at C:\home\workspace\Paddle_release\padd...
希望解决下
[ { "body": "InvalidArgumentError: The DataType of greater_than Op's duplicable Variable Y must be consistent. The current variable type is (int64_t), but the previous variable type is (int). (at C:\\home\\workspace\\Paddle_release\\paddle\\fluid\\framework\\operator.cc:1574)\r\n [operator < greater_than > error...
880b4e276282465beb24a9ad0a090dec36b0bb9c
{ "head_commit": "ca54f4a2ff31898c7b48c2991e2cf27a35aaaab5", "head_commit_message": "1.fix 2.0.1 slice bug; 2. cast int32 label which returned in Windows to int64", "patch_to_review": "diff --git a/examples/information_extraction/waybill_ie/run_bigru_crf.py b/examples/information_extraction/waybill_ie/run_bigru_c...
[ { "diff_hunk": "@@ -83,10 +83,10 @@ def predict(model, data_loader, ds, label_vocab):\n \n ignore_label = -1\n batchify_fn = lambda samples, fn=Tuple(\n- Pad(axis=0, pad_val=tokenizer.pad_token_id), # input_ids\n- Pad(axis=0, pad_val=tokenizer.pad_token_type_id), # token_type_ids\n- ...
839eed5a7f77d87034ee8b39dcf289dc31a19f30
diff --git a/examples/information_extraction/waybill_ie/run_bigru_crf.py b/examples/information_extraction/waybill_ie/run_bigru_crf.py index d506944f67db..db8b5ba4838d 100644 --- a/examples/information_extraction/waybill_ie/run_bigru_crf.py +++ b/examples/information_extraction/waybill_ie/run_bigru_crf.py @@ -87,9 +87,...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
PrefectHQ__prefect-17972@3dd8e02
PrefectHQ/prefect
Python
17,972
add parameter form docs
closes https://github.com/PrefectHQ/prefect/issues/17963
2025-05-02T20:38:19Z
Better documentation for parameters including BaseModel parameter groups ### Describe the current behavior The documentation around parameters is good to get people started but there's a lot of details and more advanced features that are not documented, particularly around BaseModel groups and how the UI handles diffe...
hi @bkkkk - thanks for the issue! totally agreed we were missing detailed docs on this, so I opened the PR linked above preview [here](https://prefect-bd373955-form-building.mintlify.app/v3/tutorials/form-building) - should be available on the main docs soon! lmk if you have thoughts / questions
[ { "body": "### Describe the current behavior\n\nThe documentation around parameters is good to get people started but there's a lot of details and more advanced features that are not documented, particularly around BaseModel groups and how the UI handles different data types.\n\n### Describe the proposed behavi...
c80e444246c8805f1dfb684267e0d88dbfcc8d38
{ "head_commit": "3dd8e0215d1b6a1e93e3b2a340fae578b31624b3", "head_commit_message": "add note", "patch_to_review": "diff --git a/docs/docs.json b/docs/docs.json\nindex ef6fce9f3d21..d7d430df1919 100644\n--- a/docs/docs.json\n+++ b/docs/docs.json\n@@ -28,6 +28,7 @@\n \"group\": \"For data engineers...
[ { "diff_hunk": "@@ -0,0 +1,286 @@\n+---\n+title: Building forms for workflow inputs\n+description: Learn how to craft validated and user-friendly input forms for workflows.\n+---\n+\n+Parameterizing workflows is a critical part of orchestration. It allows you to create contracts between modular workflows in you...
326c50ca92a4afc4e2abff603c0ca0d83d39284f
diff --git a/docs/docs.json b/docs/docs.json index ef6fce9f3d21..d7d430df1919 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -28,6 +28,7 @@ "group": "For data engineers", "pages": [ "v3/tutorials/schedule", + "v3/tutorials/form-building", ...
{ "difficulty": "low", "estimated_review_effort": 2, "problem_domain": "Documentation Updates" }
PrefectHQ__prefect-17791@5f42a25
PrefectHQ/prefect
Python
17,791
update classifiers and matrix generation for integrations 3.13 support
closes #17784
2025-04-09T17:42:31Z
Prefect integrations support for Python3.13 ### Describe the current behavior Hello, Would it be possible to add support for prefect integrations like prefect-docker and prefect-bitbucket since Prefect supports python3.13 without pendulum dependency? ### Describe the proposed behavior Remove the pendulum as a depend...
Hey @lazargugleta! I think we should be able to add 3.13 support to integration libraries without too much trouble, but it depends on 3.13 support for those library's dependencies. I'll start with `prefect-docker` and `prefect-bitbucket` first to see how it goes. Thanks for the prompt response! @desertaxle
[ { "body": "### Describe the current behavior\n\nHello,\nWould it be possible to add support for prefect integrations like prefect-docker and prefect-bitbucket since Prefect supports python3.13 without pendulum dependency?\n\n### Describe the proposed behavior\n\nRemove the pendulum as a dependency and increase ...
5ebffe3cca8056f3183350a8115e831fbfb86b52
{ "head_commit": "5f42a254b356c4e19656e588480426a1f0b93dcd", "head_commit_message": "omit ray 3.13", "patch_to_review": "diff --git a/scripts/generate_integration_package_tests_matrix.py b/scripts/generate_integration_package_tests_matrix.py\nindex a89195fb73a8..ef24a36f2ee6 100644\n--- a/scripts/generate_integra...
[ { "diff_hunk": "@@ -20,6 +20,7 @@ classifiers = [\n \"Programming Language :: Python :: 3.10\",\n \"Programming Language :: Python :: 3.11\",\n \"Programming Language :: Python :: 3.12\",\n+ \"Programming Language :: Python :: 3.13\",", "line": null, "original_line": 23, "original_start_line"...
23a389b0037a9fbc3a8f0d8beba612c4058bbe40
diff --git a/scripts/generate_integration_package_tests_matrix.py b/scripts/generate_integration_package_tests_matrix.py index a89195fb73a8..ef24a36f2ee6 100644 --- a/scripts/generate_integration_package_tests_matrix.py +++ b/scripts/generate_integration_package_tests_matrix.py @@ -1,21 +1,21 @@ import json import su...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
PrefectHQ__prefect-17866@9e0ae4a
PrefectHQ/prefect
Python
17,866
feat: added option to persist auto-generated Dockerfile
# Fix for #12938 Adds `persist_dockerfile` and `dockerfile_output_path` parameters to the `build_docker_image` step. This allows users to keep the auto-generated Dockerfile for inspection or reuse. By default, the Dockerfile is still deleted after the build unless `persist_dockerfile` is set to True. Closes ...
2025-04-19T18:50:53Z
Ability to save the Dockerfile created by `build_docker_image` deployment step ### First check - [X] I added a descriptive title to this issue. - [X] I used the GitHub search to find a similar request and didn't find it. - [X] I searched the Prefect documentation for this feature. ### Prefect Version 2.x ### Descri...
I think if we removed deletion of the Dockerfile at the end of `prefect_docker.steps.build_docker_image`, the Dockerfile will persist, but the build step will still have `dockerfile: auto` which would no longer be accurate the next time that the build step was run, as we'd want to use the Dockerfile they have. So we'd ...
[ { "body": "### First check\n\n- [X] I added a descriptive title to this issue.\n- [X] I used the GitHub search to find a similar request and didn't find it.\n- [X] I searched the Prefect documentation for this feature.\n\n### Prefect Version\n\n2.x\n\n### Describe the current behavior\n\nNo Dockerfile is persis...
6c2637fd03aef5cd6293b1ac87d3c77ba2e8d7df
{ "head_commit": "9e0ae4a5b9e5f194f18fac989c1118c7aa9beafd", "head_commit_message": "Merge branch 'main' into fix-issue-12938", "patch_to_review": "diff --git a/src/integrations/prefect-docker/prefect_docker/deployments/steps.py b/src/integrations/prefect-docker/prefect_docker/deployments/steps.py\nindex 4273b571...
[ { "diff_hunk": "@@ -127,6 +127,8 @@ def build_docker_image(\n tag: str | None = None,\n additional_tags: list[str] | None = None,\n ignore_cache: bool = False,\n+ persist_dockerfile: bool = False,\n+ dockerfile_output_path: str | None = None,", "line": null, "original_line": 131, "...
bbbd8b046b7f5f45d10cc7b362ca887f189b5387
diff --git a/src/integrations/prefect-docker/prefect_docker/deployments/steps.py b/src/integrations/prefect-docker/prefect_docker/deployments/steps.py index 4273b571825e..d7e77a5df1f4 100644 --- a/src/integrations/prefect-docker/prefect_docker/deployments/steps.py +++ b/src/integrations/prefect-docker/prefect_docker/de...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
PrefectHQ__prefect-17769@3f59d02
PrefectHQ/prefect
Python
17,769
Avoid deleting runs where execution has been attempted or are past their scheduled start date
This PR updates the patch deployment API to avoid deleting runs in `AwaitingConcurrencySlot` or have passed their scheduled start time. The latter condition means that `Late` runs would not be deleted by updating a deployment. Closes https://github.com/PrefectHQ/prefect/issues/17764
2025-04-08T14:21:06Z
late flow runs get deleted on new prefect deploy ### Bug summary flow runs that are late or awaitingconcurrencyslot in a given deployment are deleted and not rescheduled when a fresh `prefect deploy` is issued for the deployment. steps to reproduce: 1. deploy a simple flow like below to a process workpool 2. make sur...
When updating a deployment, the server will delete all flow runs in a `SCHEDULED` state for the deployment. Since `AwaitingConcurrencySlot` is a `SCHEDULED` state type, those runs get deleted. I suspect the same thing would happen with `AwaitingRetry` as well. We could either exclude `SCHEDULED` states named `Awaiting...
[ { "body": "### Bug summary\n\nflow runs that are late or awaitingconcurrencyslot in a given deployment are deleted and not rescheduled when a fresh `prefect deploy` is issued for the deployment.\n\nsteps to reproduce:\n1. deploy a simple flow like below to a process workpool\n2. make sure schedule is active + f...
137c682b93b70591c8b69ae8d706bf3a61fff5a6
{ "head_commit": "3f59d027fa14f62c131b52e90b6bed3a7ae96d1e", "head_commit_message": "Fix failing test", "patch_to_review": "diff --git a/src/prefect/server/api/deployments.py b/src/prefect/server/api/deployments.py\nindex 9fd876d53e8f..c883e0a08d5c 100644\n--- a/src/prefect/server/api/deployments.py\n+++ b/src/pr...
[ { "diff_hunk": "@@ -468,6 +468,24 @@ def AwaitingRetry(\n )\n \n \n+def AwaitingConcurrencySlot(\n+ cls: type[_State] = State,\n+ scheduled_time: Optional[DateTime] = None,\n+ **kwargs: Any,\n+) -> _State:\n+ \"\"\"Convenience function for creating `AwaitingConcurrencySlot` states.\n+\n+ Retu...
d940eb5188701fdfc27ab7217b3ef5d2d50db336
diff --git a/src/prefect/server/api/deployments.py b/src/prefect/server/api/deployments.py index 9fd876d53e8f..c883e0a08d5c 100644 --- a/src/prefect/server/api/deployments.py +++ b/src/prefect/server/api/deployments.py @@ -911,6 +911,7 @@ async def update_deployment_schedule( session=session, ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
PrefectHQ__prefect-17741@3c22d43
PrefectHQ/prefect
Python
17,741
respect auth for websockets
closes https://github.com/PrefectHQ/prefect/issues/17687 Addresses an issue where `PREFECT_SERVER_API_AUTH_STRING` did not enforce authentication for the WebSocket event stream (`/events/out`). Clients (e.g., `prefect events stream`) could connect without a valid `PREFECT_API_AUTH_STRING`. **notable changes** ...
2025-04-04T17:51:09Z
Events endpoints don't require auth when PREFECT_SERVER_API_AUTH_STRING is set ### Bug summary Steps: 1. Set PREFECT_SERVER_API_AUTH_STRING 2. Run prefect server: `prefect server start` 3. Confirm credentials are required to view the UI or access the API 4. Run `prefect events stream` Expected outcome: Without sett...
hi @willhcr - thanks for the issue! > Without setting `PREFECT_API_AUTH_STRING` I expect some kind of 401 error. agree! we should have this and will add it
[ { "body": "### Bug summary\n\nSteps:\n\n1. Set PREFECT_SERVER_API_AUTH_STRING\n2. Run prefect server: `prefect server start`\n3. Confirm credentials are required to view the UI or access the API\n4. Run `prefect events stream`\n\nExpected outcome:\n\nWithout setting PREFECT_API_AUTH_STRING I expect some kind of...
c094fa154d390a8eb148449b9bb305e00a03e899
{ "head_commit": "3c22d43dc5cd8e9afa984dcae11b3d26a804b8a4", "head_commit_message": "clarify error message", "patch_to_review": "diff --git a/src/prefect/events/clients.py b/src/prefect/events/clients.py\nindex 8a89ef6d49cf..1ccc49f92a66 100644\n--- a/src/prefect/events/clients.py\n+++ b/src/prefect/events/client...
[ { "diff_hunk": "@@ -21,16 +28,49 @@ async def accept_prefect_socket(websocket: WebSocket) -> Optional[WebSocket]:\n # message is expected to be an auth message, and if any other type of\n # message is received then the connection will be closed.\n #\n- # There is no authentication...
9b67f13e433bd922b3474124f2139ec720108bee
diff --git a/src/prefect/events/clients.py b/src/prefect/events/clients.py index 8a89ef6d49cf..1ccc49f92a66 100644 --- a/src/prefect/events/clients.py +++ b/src/prefect/events/clients.py @@ -39,6 +39,7 @@ from prefect.events import Event from prefect.logging import get_logger from prefect.settings import ( + PREF...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
PrefectHQ__prefect-17692@83dce04
PrefectHQ/prefect
Python
17,692
Use platform independent datetime in `prefect version`
closes #17689 also consolidates scattered windows tests (that were not running or passing) in preparation of bringing back windows tests in a later PR in some limited capacity, which are currently failing database tests due to a timestamp related unique constraint conflict
2025-04-02T14:03:33Z
Parsing of version in windows leads to error 'ValueError: Invalid format string' ### Bug summary Running 'prefect version' leads to the following error: File "\Lib\site-packages\prefect\cli\root.py", line 115, in version "Built": parse_datetime(prefect.__version_info__["date"]).strftime( ^^^^^^^^^^^...
thanks @freekmenger for the issue, [I think you are right](https://github.com/PrefectHQ/marvin/issues/795#issuecomment-1902541274). this should be fixed in the PR above
[ { "body": "### Bug summary\n\nRunning 'prefect version' leads to the following error:\n File \"\\Lib\\site-packages\\prefect\\cli\\root.py\", line 115, in version\n \"Built\": parse_datetime(prefect.__version_info__[\"date\"]).strftime(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
262e10ca543bbfe5991315a0c1d531abd3e26c88
{ "head_commit": "83dce04cf0180b24c631070de0601a426dd5831d", "head_commit_message": "omit windows tests to fix in another PR", "patch_to_review": "diff --git a/.github/workflows/test-windows-unc.yaml b/.github/workflows/test-windows-unc.yaml\ndeleted file mode 100644\nindex 3def94b4ec23..000000000000\n--- a/.gith...
[ { "diff_hunk": "@@ -1,9 +1,14 @@\n-name: Windows tests\n+name: Windows Tests\n \n on:\n- workflow_dispatch: {}\n- schedule:\n- - cron: '0 16 * * *' # every day at 4 p.m. UTC / 9 a.m. PDT\n+ workflow_dispatch:", "line": null, "original_line": 4, "original_start_line": null, "path": ".githu...
5e3d63315c11ed9459863b370da6962a85f8b9af
diff --git a/.github/workflows/test-windows-unc.yaml b/.github/workflows/test-windows-unc.yaml deleted file mode 100644 index 3def94b4ec23..000000000000 --- a/.github/workflows/test-windows-unc.yaml +++ /dev/null @@ -1,53 +0,0 @@ -name: Test Windows UNC Paths - -on: - workflow_dispatch: # Allow manual triggering - pu...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }
PrefectHQ__prefect-17600@43377e9
PrefectHQ/prefect
Python
17,600
Adds `prefect-client` images to the release and pre-release builds
Closes #17599 <!-- Thanks for opening a pull request to Prefect! If this is your first contribution, please make sure to review our contribution guidelines: https://docs.prefect.io/contribute/index --> <!-- Include an overview of the proposed changes here --> ### Checklist <!-- These boxes may be checked after openi...
2025-03-25T19:14:41Z
Publish a `prefecthq/prefect-client` image based on the `prefect-client` Python package ### Describe the current behavior The current image is ~770MB and includes everything you'd need to run workers and a permanent Prefect server. ### Describe the proposed behavior With a build just based on `prefect-client`, we ca...
[ { "body": "### Describe the current behavior\n\nThe current image is ~770MB and includes everything you'd need to run workers and a permanent Prefect server.\n\n### Describe the proposed behavior\n\nWith a build just based on `prefect-client`, we can get down to ~310MB\n\n### Example Use\n\nThe goal here would ...
a2719b51e517b855e4872da0e9c2c6302c5c7ae3
{ "head_commit": "43377e9a96e41011ba8648764a7068c0f63a28a6", "head_commit_message": "Adds `prefect-client` images to the release and pre-release builds\n\nCloses #17599", "patch_to_review": "diff --git a/.github/workflows/docker-images.yaml b/.github/workflows/docker-images.yaml\nindex 6ef293ceef11..dccf604501f8 ...
[ { "diff_hunk": "@@ -22,19 +22,29 @@ jobs:\n strategy:\n fail-fast: false\n matrix:\n- flavor:\n- - \"\"\n- - \"-conda\"\n- - \"-kubernetes\"\n+ image:\n+ - \"prefecthq/prefect\"\n+ - \"prefecthq/prefect-client\"\n+ release:\n+ ...
b95b65c458d065802ad5ed9c07a51364602208c1
diff --git a/.github/workflows/docker-images.yaml b/.github/workflows/docker-images.yaml index 6ef293ceef11..f3c26e497ed8 100644 --- a/.github/workflows/docker-images.yaml +++ b/.github/workflows/docker-images.yaml @@ -22,15 +22,23 @@ jobs: strategy: fail-fast: false matrix: - flavor: - ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
PrefectHQ__prefect-17731@e560a9e
PrefectHQ/prefect
Python
17,731
Update event occurred + related resource indexes for Postgres
This PR replaces the current `ix_events__event_related_occurred` and `ix_events__related_resource_ids` indexes with new versions that use an `md5` hash of potentially large columns. This fixes an issue where events will many related resources could not be inserted into the database. I also updated the default value ...
2025-04-04T14:31:41Z
Events with large related_resources causes looping insert error ### Bug summary When submitting events to prefect the with a large amount of data in the `related` field can cause the `ix_events__event_related_occurred` index can prevent events from being inserted into the database and cause looping errors as Prefect c...
Thanks for the issue @ogenstad! There's a setting that controls the maximum number of related resources accepted by the API (`server.events.maxiumum_related_resources`), but it looks like that defaults to 500, so I'm surprised that you're hitting this error so far below that value. I'm going to try the suggestion in t...
[ { "body": "### Bug summary\n\nWhen submitting events to prefect the with a large amount of data in the `related` field can cause the `ix_events__event_related_occurred` index can prevent events from being inserted into the database and cause looping errors as Prefect continues to attempt to insert the too large...
2b9d98292285ee62ce2a8d5a3dd477962d32e68b
{ "head_commit": "e560a9edabfb45789ba42d275778674215bf6e5f", "head_commit_message": "Update maximum related resources to 100 for safety", "patch_to_review": "diff --git a/docs/v3/api-ref/settings-ref.mdx b/docs/v3/api-ref/settings-ref.mdx\nindex efdb415ecc00..1d770a1908ce 100644\n--- a/docs/v3/api-ref/settings-re...
[ { "diff_hunk": "@@ -1399,7 +1416,14 @@ def __tablename__(cls) -> str:\n return \"events\"\n \n __table_args__: Any = (\n- sa.Index(\"ix_events__related_resource_ids\", \"related_resource_ids\"),\n+ sa.Index(\"ix_events__related_resource_ids\", \"related_resource_ids\").ddl_if(\n+ ...
eaecfd9772643fc5fe4eb6ce8382e7055e337d12
diff --git a/docs/v3/api-ref/settings-ref.mdx b/docs/v3/api-ref/settings-ref.mdx index efdb415ecc00..1d770a1908ce 100644 --- a/docs/v3/api-ref/settings-ref.mdx +++ b/docs/v3/api-ref/settings-ref.mdx @@ -1393,7 +1393,7 @@ The maximum number of related resources an Event may have. **Type**: `integer` -**Default**: `...
{ "difficulty": "medium", "estimated_review_effort": 4, "problem_domain": "Bug Fixes" }
PrefectHQ__prefect-17374@ee792b3
PrefectHQ/prefect
Python
17,374
add `freeze` annotation
closes #11073 this PR adds a `freeze` annotation type as described in the linked PR. adding a parameterized type (e.g. `freeze[str]`) is not necessary the field's value becomes a read-only `Enum` with only this member value (which be refined to more specifically patch the parameter schema) ```python from pref...
2025-03-05T01:37:57Z
Parameter Freezing or Hiding for Deployment Flow Configuration ### First check - [X] I added a descriptive title to this issue. - [X] I used the GitHub search to find a similar request and didn't find it. - [X] I searched the Prefect documentation for this feature. ### Prefect Version 2.x ### Describe the...
Hey @dlomartra1 ! I strongly agree with your proposal and especially given example. I'm wondering how this situation should be tackled according to current Prefect implementation and policies. This is in fact already possible - at least for **all** deployments of a flow ```python @flow def test_flow(a: int, b: Literal...
[ { "body": "### First check\r\n\r\n- [X] I added a descriptive title to this issue.\r\n- [X] I used the GitHub search to find a similar request and didn't find it.\r\n- [X] I searched the Prefect documentation for this feature.\r\n\r\n### Prefect Version\r\n\r\n2.x\r\n\r\n### Describe the current behavior\r\n\r\...
834b72703284f17371aec5f7121d57101e3ea3a1
{ "head_commit": "ee792b391babacfb74e2a5f72130f9a2bf648e7d", "head_commit_message": "fix validator", "patch_to_review": "diff --git a/src/prefect/client/schemas/actions.py b/src/prefect/client/schemas/actions.py\nindex 7dbc5f9d8bf7..bb8c7eea10f9 100644\n--- a/src/prefect/client/schemas/actions.py\n+++ b/src/prefe...
[ { "diff_hunk": "@@ -275,6 +279,27 @@ def check_valid_configuration(self, base_job_template: dict[str, Any]) -> None:\n \n jsonschema.validate(self.job_variables, variables_schema)\n \n+ @model_validator(mode=\"after\")\n+ def validate_parameters(self) -> Self:\n+ \"\"\"Update the parame...
c0c7f92f3a7bea6aadfdf178fffcd1ede1e55874
diff --git a/src/prefect/client/schemas/actions.py b/src/prefect/client/schemas/actions.py index 7dbc5f9d8bf7..45a8acd9fef7 100644 --- a/src/prefect/client/schemas/actions.py +++ b/src/prefect/client/schemas/actions.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from copy import deepcopy from typing import ...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "New Feature Additions" }
PrefectHQ__prefect-16926@b5a83b2
PrefectHQ/prefect
Python
16,926
fix `create_markdown_artifact` usage in `prefect-dbt`
closes https://github.com/PrefectHQ/prefect/issues/16924 https://github.com/PrefectHQ/prefect/pull/16877 removed `sync_compatible` from artifact methods / top-level utils
2025-01-31T19:08:53Z
prefect-dbt trigger_dbt_cli_command fails with ‘TypeError: object UUID can’t be used in ‘await’ expression’ after minor version 3.1.15 was published ### Bug summary We are using the prefect-dbt package to trigger dbt commands within a Prefect flow. Without making any changes to our environment, all runs started failin...
thanks for the issue @dylan-delport - this is likely related to https://github.com/PrefectHQ/prefect/pull/16877
[ { "body": "### Bug summary\n\nWe are using the prefect-dbt package to trigger dbt commands within a Prefect flow. Without making any changes to our environment, all runs started failing after a minor version release of Prefect that was published around 9 PM (UTC) on 30 Jan 2025 (version 3.1.15). The failure occ...
81f952dc297ec1874723eae0e9dc092d41b235a0
{ "head_commit": "b5a83b2d303149be263b58d9c4c4ab382c3698fc", "head_commit_message": "fix markdown creation", "patch_to_review": "diff --git a/src/integrations/prefect-dbt/prefect_dbt/cli/commands.py b/src/integrations/prefect-dbt/prefect_dbt/cli/commands.py\nindex 1e130a77024f..73edcaa52771 100644\n--- a/src/inte...
[ { "diff_hunk": "@@ -195,8 +195,7 @@ def _stream_output(event):\n run_results = consolidate_run_results(result)\n markdown = create_summary_markdown(run_results, command)\n artifact_id = await create_markdown_artifact(\n- markdown=markdown,\n- key=summary_artifact_ke...
d4662fbc95735ed8c212b3b1802cd1756591549c
diff --git a/src/integrations/prefect-dbt/prefect_dbt/cli/commands.py b/src/integrations/prefect-dbt/prefect_dbt/cli/commands.py index 1e130a77024f..1a4ef5881562 100644 --- a/src/integrations/prefect-dbt/prefect_dbt/cli/commands.py +++ b/src/integrations/prefect-dbt/prefect_dbt/cli/commands.py @@ -13,7 +13,7 @@ from p...
{ "difficulty": "medium", "estimated_review_effort": 3, "problem_domain": "Bug Fixes" }