repo
stringclasses
5 values
pull_number
int64
4.81k
20.4k
instance_id
stringlengths
17
42
issue_numbers
listlengths
1
2
base_commit
stringlengths
40
40
patch
stringlengths
417
316k
test_patch
stringlengths
397
34.2k
problem_statement
stringlengths
109
22k
hints_text
stringlengths
0
29.2k
created_at
stringlengths
20
20
version
stringclasses
8 values
base_commit_date
stringlengths
20
20
FAIL_TO_PASS
listlengths
1
388
PASS_TO_PASS
listlengths
0
530
environment_setup_commit
stringclasses
8 values
manhtdd/deepspeed__deepspeed
6,613
deepspeed__deepspeed-6613
[ "4460" ]
adec99121b411709e1b185a486d18aa846c82c64
diff --git a/deepspeed/launcher/multinode_runner.py b/deepspeed/launcher/multinode_runner.py index a816b5685760..74d20a6d53e5 100644 --- a/deepspeed/launcher/multinode_runner.py +++ b/deepspeed/launcher/multinode_runner.py @@ -141,6 +141,17 @@ def validate_args(self): def get_cmd(self, environment, active_resource...
diff --git a/tests/unit/launcher/test_multinode_runner.py b/tests/unit/launcher/test_multinode_runner.py index ec0459ab0a6f..a3b50a4c90ab 100644 --- a/tests/unit/launcher/test_multinode_runner.py +++ b/tests/unit/launcher/test_multinode_runner.py @@ -32,6 +32,27 @@ def test_openmpi_runner(runner_info): runner = mn...
[BUG] OpenMPI launcher has hard-coded values for network interface **Describe the bug** When using the OpenMPI launcher, the network options `btl` and `btl_tcp_if_include` have hard-coded values (to ignore InfiniBand and use `eth0` interface, respectively), making it impossible to run in configurations with different ...
2024-10-09T09:50:48Z
v0.16.0
2024-10-10T02:59:26Z
[ "tests/unit/launcher/test_multinode_runner.py::test_btl_nic_openmpi_runner", "tests/unit/launcher/test_multinode_runner.py::test_btl_nic_two_dashes_openmpi_runner" ]
[ "tests/unit/launcher/test_multinode_runner.py::test_pdsh_runner", "tests/unit/launcher/test_multinode_runner.py::test_openmpi_runner", "tests/unit/launcher/test_multinode_runner.py::test_mpich_runner", "tests/unit/launcher/test_multinode_runner.py::test_slurm_runner", "tests/unit/launcher/test_multinode_run...
9a2c209cee898931df310c218cd87d0840a72572
manhtdd/gradio__gradio
9,450
gradio__gradio-9450
[ "6041" ]
d054262f611d5f1eb1a1c936db7152347a891f8e
diff --git a/.changeset/chilly-socks-poke.md b/.changeset/chilly-socks-poke.md new file mode 100644 index 0000000000000..85f9336838641 --- /dev/null +++ b/.changeset/chilly-socks-poke.md @@ -0,0 +1,7 @@ +--- +"@gradio/code": minor +"@gradio/icons": minor +"gradio": minor +--- + +feat:Improve `gr.Code` diff --git a/grad...
diff --git a/test/components/test_code.py b/test/components/test_code.py index 072e46d34c815..1d4169c73c1fb 100644 --- a/test/components/test_code.py +++ b/test/components/test_code.py @@ -32,7 +32,7 @@ def fn(a): "value": None, "language": None, "lines": 5, - "max_line...
issues with code component ### Describe the bug Few things: - Using the Code component on its own is an exercise in frustration. This is probably true for most of our component but I've experienced it first hand now. - You need to pass a million props, many of which don't make sense on their own. - Some pro...
2024-09-26T12:41:14Z
@gradio-accordion@0.3.23-beta.5
2024-10-02T18:03:13Z
[ "test/components/test_code.py::TestCode::test_component_functions" ]
[ "test/components/test_code.py::TestCode::test_process_example" ]
17e6c84d6b11651cd03c1d47caec85de62030ea0
manhtdd/gradio__gradio
9,582
gradio__gradio-9582
[ "8253" ]
17e6c84d6b11651cd03c1d47caec85de62030ea0
diff --git a/.changeset/lazy-clubs-help.md b/.changeset/lazy-clubs-help.md new file mode 100644 index 0000000000000..987753ba7e0d4 --- /dev/null +++ b/.changeset/lazy-clubs-help.md @@ -0,0 +1,9 @@ +--- +"@gradio/chatbot": minor +"@gradio/icons": minor +"@gradio/image": minor +"@gradio/video": minor +"gradio": minor +--...
diff --git a/test/components/test_chatbot.py b/test/components/test_chatbot.py index 0b6287f6d69c8..a7aa3f298c3ea 100644 --- a/test/components/test_chatbot.py +++ b/test/components/test_chatbot.py @@ -46,6 +46,7 @@ def test_component_functions(self): "height": 400, "max_height": None, ...
Add auto-scroll down to the bottom of the Gradio chat box whenever there's a new LLM response or show down arrow button - Yes, I have searched to see if a similar issue already exists. While using the Gradio chat interface I noticed that when I scroll up to see previous LLM responses, and then submit a new question,...
Related (but not the same): https://github.com/gradio-app/gradio/issues/5785 +1 on this, would be great to see the autoscroll functionality added to textbox was also added to chatbot! You can add this javascript with gr.Blocks(js="scrolldown.js") (either as a file in the same folder as the python script or as a text va...
2024-10-08T10:26:23Z
@gradio-accordion@0.3.23-beta.5
2024-10-08T18:32:32Z
[ "test/components/test_chatbot.py::TestChatbot::test_component_functions" ]
[ "test/components/test_chatbot.py::TestChatbot::test_avatar_images_are_moved_to_cache" ]
17e6c84d6b11651cd03c1d47caec85de62030ea0
manhtdd/gradio__gradio
9,589
gradio__gradio-9589
[ "9540" ]
17e6c84d6b11651cd03c1d47caec85de62030ea0
diff --git a/.changeset/evil-clocks-visit.md b/.changeset/evil-clocks-visit.md new file mode 100644 index 0000000000000..c31c3eb685db4 --- /dev/null +++ b/.changeset/evil-clocks-visit.md @@ -0,0 +1,6 @@ +--- +"gradio": minor +"gradio_client": minor +--- + +feat:Only move files to the cache that have a meta key diff --g...
diff --git a/test/components/test_json.py b/test/components/test_json.py index 5530bd15f31ef..b72c685053cc7 100644 --- a/test/components/test_json.py +++ b/test/components/test_json.py @@ -86,6 +86,12 @@ def get_avg_age_per_gender(data): "O": 20, } + @pytest.mark.asyncio + async def test_d...
gradio.JSON component adds extra data to my dict value when key includes 'path' and 'assets' ### Describe the bug When using the gradio.JSON component to display a dictionary value that includes a key named 'path' and is nested within a key named 'assets', the component adds an extra key-value pair to the dictionary. ...
2024-10-08T18:50:03Z
@gradio-accordion@0.3.23-beta.5
2024-10-08T18:32:32Z
[ "test/components/test_json.py::TestJSON::test_dict_with_path_key_not_moved" ]
[ "test/components/test_json.py::TestJSON::test_component_functions", "test/components/test_json.py::TestJSON::test_chatbot_selectable_in_config", "test/components/test_json.py::TestJSON::test_in_interface", "test/components/test_json.py::TestJSON::test_postprocess_returns_json_serializable_value[None-None]", ...
17e6c84d6b11651cd03c1d47caec85de62030ea0
manhtdd/keras__keras
19,190
keras__keras-19190
[ "19180" ]
436937dea3d52eecff3cb6f1bd5161f23c825fae
diff --git a/keras/layers/preprocessing/text_vectorization.py b/keras/layers/preprocessing/text_vectorization.py index 2e1fa4633a3..c40715f6c4a 100644 --- a/keras/layers/preprocessing/text_vectorization.py +++ b/keras/layers/preprocessing/text_vectorization.py @@ -492,6 +492,10 @@ def from_config(cls, config): ...
diff --git a/keras/layers/preprocessing/text_vectorization_test.py b/keras/layers/preprocessing/text_vectorization_test.py index ac3e92652e3..633013adc6e 100644 --- a/keras/layers/preprocessing/text_vectorization_test.py +++ b/keras/layers/preprocessing/text_vectorization_test.py @@ -1,11 +1,15 @@ +import os + import ...
`ValueError`: `ngrams` when loading a model with a `TextVectorization` layer ### Describe a bug Loading a model that contains a `TextVectorization` layer with `ngram` set to a tuple results in a `ValueError`. ### Code to Reproduce ```python import numpy as np import tensorflow as tf from tensorflow import k...
2024-02-16T15:30:56Z
v3.6.0
2024-02-16T06:34:26Z
[ "keras/layers/preprocessing/text_vectorization_test.py::TextVectorizationTest::test_save_load_with_ngrams_flow" ]
[ "keras/layers/preprocessing/text_vectorization_test.py::TextVectorizationTest::test_adapt_flow", "keras/layers/preprocessing/text_vectorization_test.py::TextVectorizationTest::test_config", "keras/layers/preprocessing/text_vectorization_test.py::TextVectorizationTest::test_fixed_vocabulary", "keras/layers/pre...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
19,387
keras__keras-19387
[ "19383" ]
2958e0a8e61b01523b6232486683e21e22c85465
diff --git a/keras/dtype_policies/dtype_policy.py b/keras/dtype_policies/dtype_policy.py index 7c8586c2a6e..8734037f7d4 100644 --- a/keras/dtype_policies/dtype_policy.py +++ b/keras/dtype_policies/dtype_policy.py @@ -69,6 +69,10 @@ def __new__(cls, name): return FloatDTypePolicy(name) return super...
diff --git a/keras/dtype_policies/dtype_policy_test.py b/keras/dtype_policies/dtype_policy_test.py index 9df8dd0a85f..7b3535e66a7 100644 --- a/keras/dtype_policies/dtype_policy_test.py +++ b/keras/dtype_policies/dtype_policy_test.py @@ -61,6 +61,32 @@ def test_get_config_from_config(self): new_policy = DTypePo...
TypeError: DTypePolicy.__new__() when deepcopy(layer_instance) Hello, I use `Python==3.11.8` with `keras==3.1.1`. When I create a layer instance and try to deepcopy this layer I receive the following error which did not happen before. ```python >>> import keras >>> import copy >>> layer_obj = keras.layers...
Related to this line apparently: https://github.com/keras-team/keras/blob/v3.1.1/keras/dtype_policies/dtype_policy.py#L58
2024-03-27T01:49:48Z
v3.6.0
2024-03-26T17:14:45Z
[ "keras/dtype_policies/dtype_policy_test.py::DTypePolicyTest::test_deepcopy" ]
[ "keras/dtype_policies/dtype_policy_test.py::DTypePolicyTest::test_get_config_from_config", "keras/dtype_policies/dtype_policy_test.py::DTypePolicyTest::test_initialization_invalid_name", "keras/dtype_policies/dtype_policy_test.py::DTypePolicyTest::test_initialization_non_string_name", "keras/dtype_policies/dt...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
19,143
keras__keras-19143
[ "19062" ]
ca179cf1dea6a8e5dfd862678484fb2af2b64f32
diff --git a/keras/backend/jax/__init__.py b/keras/backend/jax/__init__.py index 587fa47b773..327bd95dc0d 100644 --- a/keras/backend/jax/__init__.py +++ b/keras/backend/jax/__init__.py @@ -1,6 +1,7 @@ from keras.backend.jax import core from keras.backend.jax import distribution_lib from keras.backend.jax import imag...
diff --git a/keras/ops/linalg_test.py b/keras/ops/linalg_test.py new file mode 100644 index 00000000000..f0146d63f66 --- /dev/null +++ b/keras/ops/linalg_test.py @@ -0,0 +1,519 @@ +import numpy as np +from absl.testing import parameterized + +from keras import backend +from keras import ops +from keras import testing +...
What are the keras3 operations to replace those in tf.linalg? I am looking for a replacement to tf.linalg.eigh, etc. There doesn't seem to be equivalent functionality in keras.ops or keras.utils.
Hi @tsjain , This Op seems not yet implemented in Keras3. But if you are using tensorflow as backend you can still use Tensorflow API itself. The major promise of keras 3 was to seamlessly switch backends, so it would be good if this functionality was abstracted into the API as well. Looks like a wide variety of t...
2024-02-03T16:59:29Z
v3.6.0
2024-02-02T18:56:19Z
[ "keras/ops/linalg_test.py::LinalgOpsDynamicShapeTest::test_cholesky", "keras/ops/linalg_test.py::LinalgOpsDynamicShapeTest::test_det", "keras/ops/linalg_test.py::LinalgOpsDynamicShapeTest::test_eig", "keras/ops/linalg_test.py::LinalgOpsDynamicShapeTest::test_inv", "keras/ops/linalg_test.py::LinalgOpsDynamic...
[]
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
19,799
keras__keras-19799
[ "19792" ]
c94663711d738b50af324214d89f895e046a2b66
diff --git a/keras/src/models/functional.py b/keras/src/models/functional.py index 85533d0a32e..51d7eb021a4 100644 --- a/keras/src/models/functional.py +++ b/keras/src/models/functional.py @@ -181,6 +181,10 @@ def compute_output_spec(self, inputs, training=None, mask=None): # From Function return supe...
diff --git a/keras/src/models/functional_test.py b/keras/src/models/functional_test.py index 7d17abee66d..de425d44582 100644 --- a/keras/src/models/functional_test.py +++ b/keras/src/models/functional_test.py @@ -118,6 +118,20 @@ def test_basic_flow_dict_io(self): out_val = model(in_val) self.assertEq...
TimeDistributed layer with nested model no longer working in TensorFlow 2.16.1 With TensorFlow `2.15.1`, the following code works fine: ```python3 import numpy as np from tensorflow.keras.layers import Input, TimeDistributed, Flatten from tensorflow.keras.models import Model, Sequential inputs = [Input((17, 4)...
2024-06-04T05:07:23Z
v3.6.0
2024-06-03T18:46:08Z
[ "keras/src/models/functional_test.py::FunctionalTest::test_basic_flow_as_a_submodel", "keras/src/models/sequential_test.py::SequentialTest::test_basic_flow_as_a_submodel", "keras/src/models/sequential_test.py::SequentialTest::test_compute_output_shape", "keras/src/ops/function_test.py::FunctionTest::test_dyna...
[ "keras/src/models/functional_test.py::FunctionalTest::test_add_loss", "keras/src/models/functional_test.py::FunctionalTest::test_bad_input_spec", "keras/src/models/functional_test.py::FunctionalTest::test_basic_flow_dict_io", "keras/src/models/functional_test.py::FunctionalTest::test_basic_flow_multi_input", ...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
20,197
keras__keras-20197
[ "20188" ]
8b1ca959bd23d68848eed58f337cf3d25b00f9aa
diff --git a/keras/src/trainers/trainer.py b/keras/src/trainers/trainer.py index 4c91cf21e60..7bf0ba8b795 100644 --- a/keras/src/trainers/trainer.py +++ b/keras/src/trainers/trainer.py @@ -134,6 +134,7 @@ def compile( wrapped in a `LossScaleOptimizer`, which will dynamically scale the ...
diff --git a/keras/src/trainers/trainer_test.py b/keras/src/trainers/trainer_test.py index fee4fa3f282..c590436f1a9 100644 --- a/keras/src/trainers/trainer_test.py +++ b/keras/src/trainers/trainer_test.py @@ -199,8 +199,8 @@ def __init__(self, units): # my_metric. self.assertEqual(len(model.metrics), ...
Cannot get result() since the metric has not yet been built Basically the heading. I am attaching the colab notebook for reproducibility purpose, and have printed out the tensorflow and keras versions for perusal. [Link here](https://colab.research.google.com/drive/1F5Wzq6AqbYTzlBZHXypgiTn9xUVMOhyt#scrollTo=PUKQ6_Vv3nG...
2024-09-02T13:48:09Z
v3.6.0
2024-09-01T15:05:37Z
[ "keras/src/trainers/trainer_test.py::TestTrainer::test_metric_tracking", "keras/src/trainers/trainer_test.py::TestTrainer::test_nested_trainer_metrics" ]
[ "keras/src/trainers/trainer_test.py::TestTrainer::test_adds_loss_scaling_optimizer", "keras/src/trainers/trainer_test.py::TestTrainer::test_callback_methods_keys", "keras/src/trainers/trainer_test.py::TestTrainer::test_callbacks_can_update_state_at_batch_boundary", "keras/src/trainers/trainer_test.py::TestTra...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
19,331
keras__keras-19331
[ "19328" ]
b2ef949cceb01c53d231a4da9cbfbaa12cea981d
diff --git a/keras/layers/rnn/bidirectional.py b/keras/layers/rnn/bidirectional.py index 6c996d55d8b..9a2569fa159 100644 --- a/keras/layers/rnn/bidirectional.py +++ b/keras/layers/rnn/bidirectional.py @@ -182,13 +182,13 @@ def compute_output_shape(self, sequences_shape, initial_state_shape=None): output_sh...
diff --git a/keras/layers/rnn/bidirectional_test.py b/keras/layers/rnn/bidirectional_test.py index b2a082657c5..6391abdace2 100644 --- a/keras/layers/rnn/bidirectional_test.py +++ b/keras/layers/rnn/bidirectional_test.py @@ -234,3 +234,29 @@ def test_return_state(self): np.array([[0.2501858, 0.2501858], [0...
Error "Can only concatenate list (not "tuple") to list" when passing Embedding layer to Bidirectional LSTM layer in Keras 3 **TensorFlow version**: 2.16.1 **Keras version**: 3.1.0 I was playing with encoder-decoder architectures and encountered the "_can only concatenate list (not "tuple") to list_" error when pass...
Hi @csttsn , Thanks for reporting. Replicated the reported error and attached [gist](https://colab.sandbox.google.com/gist/SuryanarayanaY/08914fe3d1b6b3f49bca3dfaacfbd4c5/19328.ipynb). Seems like a bug. Will gig more and comeback to you.
2024-03-19T06:40:04Z
v3.6.0
2024-03-18T22:25:43Z
[ "keras/layers/rnn/bidirectional_test.py::SimpleRNNTest::test_output_shape" ]
[ "keras/layers/rnn/bidirectional_test.py::SimpleRNNTest::test_basics", "keras/layers/rnn/bidirectional_test.py::SimpleRNNTest::test_correctness", "keras/layers/rnn/bidirectional_test.py::SimpleRNNTest::test_masking", "keras/layers/rnn/bidirectional_test.py::SimpleRNNTest::test_pass_initial_state", "keras/lay...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
20,410
keras__keras-20410
[ "19740" ]
0c2bdff313f7533f0d7e6670a906102cc2fb046d
diff --git a/keras/src/backend/numpy/numpy.py b/keras/src/backend/numpy/numpy.py index f6817958772..be1753bd07a 100644 --- a/keras/src/backend/numpy/numpy.py +++ b/keras/src/backend/numpy/numpy.py @@ -1056,7 +1056,9 @@ def divide_no_nan(x1, x2): ) x1 = convert_to_tensor(x1, dtype) x2 = convert_to_tensor(...
diff --git a/keras/src/losses/loss_test.py b/keras/src/losses/loss_test.py index 003dd1e7b4a..849e553ff9c 100644 --- a/keras/src/losses/loss_test.py +++ b/keras/src/losses/loss_test.py @@ -271,7 +271,7 @@ def test_dtype_arg(self): # `dtype` setter should raise AttributeError with self.assertRaises(A...
Unexpected Losses with Sample Weights When using `sample_weight`, and the default reduction `sum_over_batch_size`, the computed losses are technically correct (they are the sum divided by the batch size), but they are not what someone would want them to be. They are computed by summing the `loss * sample_weight` and di...
Hi @seandaug , I have replicated the reported behaviour and attached [gist](https://colab.sandbox.google.com/gist/SuryanarayanaY/8ad451e885136b61d04a264081d122fe/19740.ipynb#scrollTo=sA55eiSuvtqn). Will dig more and comeback. Thanks! I have come across a similar problem. Using keras 3. I tested it with jax and torch...
2024-10-25T16:23:31Z
v3.6.0
2024-10-25T00:38:51Z
[ "keras/src/losses/losses_test.py::MeanSquaredErrorTest::test_mean_with_sample_weight_reduction", "keras/src/losses/losses_test.py::MeanAbsoluteErrorTest::test_mean_with_sample_weight_reduction", "keras/src/losses/losses_test.py::MeanAbsolutePercentageErrorTest::test_mean_with_sample_weight_reduction", "keras/...
[ "keras/src/losses/loss_test.py::LossTest::test_default_dtype", "keras/src/losses/loss_test.py::LossTest::test_dtype_arg", "keras/src/losses/loss_test.py::LossTest::test_get_method", "keras/src/losses/loss_test.py::LossTest::test_mask", "keras/src/losses/loss_test.py::LossTest::test_mask_and_sample_weight", ...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
20,079
keras__keras-20079
[ "20072" ]
d8b331412a89cbeaf07cc94fa5b55b9e5b6bf626
diff --git a/keras/src/layers/preprocessing/rescaling.py b/keras/src/layers/preprocessing/rescaling.py index a7131eaabd5..862f854bcf5 100644 --- a/keras/src/layers/preprocessing/rescaling.py +++ b/keras/src/layers/preprocessing/rescaling.py @@ -1,6 +1,7 @@ from keras.src import backend from keras.src.api_export impor...
diff --git a/keras/src/layers/preprocessing/rescaling_test.py b/keras/src/layers/preprocessing/rescaling_test.py index 83a55e1f8a1..bd0a7742328 100644 --- a/keras/src/layers/preprocessing/rescaling_test.py +++ b/keras/src/layers/preprocessing/rescaling_test.py @@ -84,3 +84,21 @@ def test_rescaling_with_channels_first_a...
Rescaling Layer Issue when Loading .keras Model Hello, I have an issue with saving and reloading a .keras model when I use a rescaling layer. [I opened an issue in the tensorflow repo](https://github.com/tensorflow/tensorflow/issues/69719) but they pointed me here! Here's the reproduced issue I put on my original issue...
2024-08-01T15:15:58Z
v3.6.0
2024-08-01T14:11:13Z
[ "keras/src/layers/preprocessing/rescaling_test.py::RescalingTest::test_numpy_args" ]
[ "keras/src/layers/preprocessing/rescaling_test.py::RescalingTest::test_rescaling_basics", "keras/src/layers/preprocessing/rescaling_test.py::RescalingTest::test_rescaling_correctness", "keras/src/layers/preprocessing/rescaling_test.py::RescalingTest::test_rescaling_dtypes", "keras/src/layers/preprocessing/res...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
19,636
keras__keras-19636
[ "19629" ]
880f0cdd67591474d8ed98a6b192655322b7ecfc
diff --git a/keras/src/dtype_policies/dtype_policy.py b/keras/src/dtype_policies/dtype_policy.py index a55eaa4c065..e9bf91aaab9 100644 --- a/keras/src/dtype_policies/dtype_policy.py +++ b/keras/src/dtype_policies/dtype_policy.py @@ -1,5 +1,4 @@ from keras.src import backend -from keras.src import ops from keras.src.a...
diff --git a/keras/src/layers/layer_test.py b/keras/src/layers/layer_test.py index 6bc93859abc..e0c71a0cf7f 100644 --- a/keras/src/layers/layer_test.py +++ b/keras/src/layers/layer_test.py @@ -437,13 +437,13 @@ def test_mixed_precision(self): y = layer(x) self.assertEqual(layer.compute_dtype, "float16...
keras autocast casts numpy int types to float In keras 2 I was using model input tuples with mixed types (some float and some int). This worked nicely with all policies. In keras 3 in case numpy arrays are used used as input np.int32 will be converted into tf.float32 or tf.float16 (depending on policy). See her...
The expected behavior is that all inputs should be autocasted to `self.input_dtype`, which is what's happening here. You could just set `input_dtype` to be what you want. Alternatively, you can make a layer/model that does not cast/convert its inputs at all, by setting `self._convert_input_args = False`. You will...
2024-04-29T02:11:03Z
v3.6.0
2024-04-28T18:43:08Z
[ "keras/src/layers/layer_test.py::LayerTest::test_autocast_with_np_array" ]
[ "keras/src/layers/layer_test.py::LayerTest::test_activity_regularization", "keras/src/layers/layer_test.py::LayerTest::test_add_loss", "keras/src/layers/layer_test.py::LayerTest::test_add_weight_defaults", "keras/src/layers/layer_test.py::LayerTest::test_autocast", "keras/src/layers/layer_test.py::LayerTest...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
20,002
keras__keras-20002
[ "19982" ]
576daec845cbc83cebb040e018ba9fdae1902738
diff --git a/keras/src/models/sequential.py b/keras/src/models/sequential.py index 821b12d2041..194d59ce602 100644 --- a/keras/src/models/sequential.py +++ b/keras/src/models/sequential.py @@ -137,6 +137,12 @@ def _maybe_rebuild(self): if isinstance(self._layers[0], InputLayer) and len(self._layers) > 1: ...
diff --git a/keras/src/models/sequential_test.py b/keras/src/models/sequential_test.py index ce51d7238fd..99f673b86e0 100644 --- a/keras/src/models/sequential_test.py +++ b/keras/src/models/sequential_test.py @@ -150,6 +150,58 @@ def test_basic_flow_as_a_submodel(self): y = model(x) self.assertEqual(y...
"ValueError: Undefined shapes are not supported." when calling model.call() hello everybody. I'm having trouble creating a Siamese network class, which extends keras.Model , from a function that returns the same model. My knowledge about [keras.Model](https://keras.io/api/models/model/) isn't good, so I don't know i...
Got the same Error, ![image](https://github.com/user-attachments/assets/a4a406d1-4426-4427-9423-c235e8afb9d8) ![image](https://github.com/user-attachments/assets/7b71b264-ed57-4be9-a55c-d5267c33e639) Hey @jpeg-souza you can try the following: ```python import keras from keras import ops def euclidean_di...
2024-07-17T03:10:57Z
v3.6.0
2024-07-15T05:27:14Z
[ "keras/src/models/sequential_test.py::SequentialTest::test_basic_flow_with_functional_model_as_first_layer", "keras/src/models/sequential_test.py::SequentialTest::test_basic_flow_with_sequential_model_as_first_layer" ]
[ "keras/src/models/sequential_test.py::SequentialTest::test_bad_layer", "keras/src/models/sequential_test.py::SequentialTest::test_basic_flow_as_a_submodel", "keras/src/models/sequential_test.py::SequentialTest::test_basic_flow_deferred", "keras/src/models/sequential_test.py::SequentialTest::test_basic_flow_wi...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
19,973
keras__keras-19973
[ "19769" ]
10a008fac10e2eb7dd343c128cbf2e0f971fa993
diff --git a/keras/src/layers/attention/multi_head_attention.py b/keras/src/layers/attention/multi_head_attention.py index 5fae1302336..49dc103be3c 100644 --- a/keras/src/layers/attention/multi_head_attention.py +++ b/keras/src/layers/attention/multi_head_attention.py @@ -210,6 +210,21 @@ def build( key: O...
diff --git a/keras/src/layers/attention/multi_head_attention_test.py b/keras/src/layers/attention/multi_head_attention_test.py index 979f9cd78a3..c4bcdc0fb04 100644 --- a/keras/src/layers/attention/multi_head_attention_test.py +++ b/keras/src/layers/attention/multi_head_attention_test.py @@ -148,6 +148,10 @@ def test_s...
Inconsistent assertion in keras.layers.MultiHeadAttention I've noticed that depending on what is fed as the key, query and value to the keras.layers.MultiHeadAttention the assertion query_shape==value_shape is only _sometimes_ activated. Minimal working example (no assertion error): ``` `import os` `os.environ["K...
2024-07-11T01:00:28Z
v3.6.0
2024-07-10T22:17:57Z
[ "keras/src/layers/attention/multi_head_attention_test.py::MultiHeadAttentionTest::test_shape_mismatch_error_key_value_dim_mismatch", "keras/src/layers/attention/multi_head_attention_test.py::MultiHeadAttentionTest::test_shape_mismatch_error_key_value_dim_mismatch_high_dim", "keras/src/layers/attention/multi_hea...
[ "keras/src/layers/attention/multi_head_attention_test.py::MultiHeadAttentionTest::test_basics", "keras/src/layers/attention/multi_head_attention_test.py::MultiHeadAttentionTest::test_compute_output_shape_high_dim_different_proj", "keras/src/layers/attention/multi_head_attention_test.py::MultiHeadAttentionTest::...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
19,838
keras__keras-19838
[ "19825" ]
26abe697a8802de40cb2761fc98b843fe1b2d5f6
diff --git a/keras/src/losses/losses.py b/keras/src/losses/losses.py index 8bb32c21b8f..db19dc64d4c 100644 --- a/keras/src/losses/losses.py +++ b/keras/src/losses/losses.py @@ -1711,6 +1711,9 @@ def sparse_categorical_crossentropy( array([0.0513, 2.303], dtype=float32) """ + if len(y_true.shape) == len(y...
diff --git a/keras/src/losses/losses_test.py b/keras/src/losses/losses_test.py index f5475fb9ccc..b09f4573e17 100644 --- a/keras/src/losses/losses_test.py +++ b/keras/src/losses/losses_test.py @@ -1055,7 +1055,7 @@ def test_no_reduction(self): from_logits=True, reduction=None ) loss = cce...
sparse_categorical_crossentropy with ignore_class fails for 4D inputs Using `ignore_class` with `keras.losses.sparse_categorical_crossentropy` and 4D inputs (Batch x Height x Width x Class) fails with a ValueError indicating wrong shapes. Minimal example to reproduce: ``` import numpy as np import tensorflow as t...
> y_true = np.zeros((1, 224, 224, 1)) => `y_true = np.zeros((1, 224, 224))` Shouldn't `y_true` has one dimension less than `y_pred`? Oh, you are right, with `y_true = np.zeros((1, 224, 224))` it seems to work... However, when omitting `ignore_class` from `sparse_categorical_crossentropy`, `y_true = np.zeros((1...
2024-06-11T16:45:49Z
v3.6.0
2024-06-11T14:42:49Z
[ "keras/src/losses/losses_test.py::SparseCategoricalCrossentropyTest::test_ignore_class" ]
[ "keras/src/losses/losses_test.py::MeanSquaredErrorTest::test_all_correct_unweighted", "keras/src/losses/losses_test.py::MeanSquaredErrorTest::test_base_function_reduction", "keras/src/losses/losses_test.py::MeanSquaredErrorTest::test_config", "keras/src/losses/losses_test.py::MeanSquaredErrorTest::test_no_red...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
19,863
keras__keras-19863
[ "19535" ]
f6cf6a0e77dd504cfc35dd499dd8694b0b80b4ae
diff --git a/keras/src/utils/summary_utils.py b/keras/src/utils/summary_utils.py index 94c82af7ff8..7fe10f776b5 100644 --- a/keras/src/utils/summary_utils.py +++ b/keras/src/utils/summary_utils.py @@ -76,17 +76,31 @@ def bold_text(x, color=None): def format_layer_shape(layer): - if not layer._inbound_nodes: + ...
diff --git a/keras/src/utils/summary_utils_test.py b/keras/src/utils/summary_utils_test.py index 7b917da4f84..439b9464497 100644 --- a/keras/src/utils/summary_utils_test.py +++ b/keras/src/utils/summary_utils_test.py @@ -40,3 +40,37 @@ def print_to_variable(text, line_break=False): self.assertNotIn("Op...
model.summary() broken for custom models subclassed from keras.Model ### Current behavior? **Custom model classes built from keras.Model do not think they get built properly, and the model.summary() is missing information.** However, the model will run just fine. In keras version 2.15.0, we see it working properly, ...
> the layer does not have a `build()` method implemented and it looks like it has unbuilt state. This will cause the layer to be marked as built, despite not being actually built, which may cause failures down the line. Make sure to implement a proper `build()` method. As indicated by this message, you need to i...
2024-06-17T09:58:10Z
v3.6.0
2024-06-17T04:07:19Z
[ "keras/src/utils/summary_utils_test.py::SummaryUtilsTest::test_print_model_summary_custom_build" ]
[ "keras/src/utils/summary_utils_test.py::SummaryUtilsTest::test_print_model_summary0", "keras/src/utils/summary_utils_test.py::SummaryUtilsTest::test_print_model_summary1" ]
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
18,553
keras__keras-18553
[ "18535" ]
c8a5a8969a8712a9a1939937ce34158e04cfc09d
diff --git a/keras/ops/nn.py b/keras/ops/nn.py index 7d3e3a13a3f..c539da0a0aa 100644 --- a/keras/ops/nn.py +++ b/keras/ops/nn.py @@ -592,7 +592,7 @@ def __init__( super().__init__() self.pool_size = pool_size self.strides = strides - self.padding = padding + self.padding = paddi...
diff --git a/keras/ops/nn_test.py b/keras/ops/nn_test.py index 67c438df875..12d39832aed 100644 --- a/keras/ops/nn_test.py +++ b/keras/ops/nn_test.py @@ -121,12 +121,16 @@ def test_conv(self): # Test 1D conv. inputs_1d = KerasTensor([None, 20, 3]) kernel = KerasTensor([4, 3, 2]) - self....
depthwise_conv ops padding same is not working in on torch backend ```python import numpy as np import os os.environ["KERAS_BACKEND"] = "jax" # 'tensorflow', 'torch', 'jax' import keras_core as keras from keras_core import ops input = np.ones((1, 613, 696, 3)) kernel = np.ones((1, 5, 3, 1)) ``` ```pyt...
2023-10-05T20:35:56Z
v3.6.0
2023-10-05T13:46:22Z
[ "keras/ops/nn_test.py::NNOpsDynamicShapeTest::test_conv", "keras/ops/nn_test.py::NNOpsDynamicShapeTest::test_depthwise_conv" ]
[ "keras/ops/nn_test.py::NNOpsDynamicShapeTest::test_average_pool", "keras/ops/nn_test.py::NNOpsDynamicShapeTest::test_conv_transpose", "keras/ops/nn_test.py::NNOpsDynamicShapeTest::test_elu", "keras/ops/nn_test.py::NNOpsDynamicShapeTest::test_gelu", "keras/ops/nn_test.py::NNOpsDynamicShapeTest::test_hard_sig...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
20,008
keras__keras-20008
[ "19991", "19991" ]
0ed820f5649bcb27531d73cfc023763712fc8bf9
diff --git a/keras/src/backend/tensorflow/nn.py b/keras/src/backend/tensorflow/nn.py index 3eef471f74c..85e4dd63df1 100644 --- a/keras/src/backend/tensorflow/nn.py +++ b/keras/src/backend/tensorflow/nn.py @@ -237,28 +237,25 @@ def _conv(): dilations=dilation_rate, ) - # Reason for making this...
diff --git a/keras/src/ops/nn_test.py b/keras/src/ops/nn_test.py index 178da78546a..689a3b00d98 100644 --- a/keras/src/ops/nn_test.py +++ b/keras/src/ops/nn_test.py @@ -1479,6 +1479,19 @@ def test_conv_3d(self, strides, padding, data_format): ) self.assertAllClose(outputs, expected, rtol=1e-5, atol=1e...
Regression bug when using 3D convolution with channels_first on GPU The following code stopped working after release 3.3.3 when running on GPU and using `run_eagerly=False` ```python import keras import numpy as np # 3D input with channels_first model_input = keras.Input(shape=(1, 10, 10, 10)) # (None, 1, 10,...
I'm running on Nvidia driver 550.54.15, CUDA version 12.4 and am using a H100XM-80C GPU I was able to replicate the issue using Keras 3.4.1 on GPU, attaching the Gist for reference [![](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.sandbox.google.com/gist/sachinprasadhs/5cea3254fc749928420f...
2024-07-18T05:28:29Z
v3.6.0
2024-07-18T18:36:32Z
[ "keras/src/ops/nn_test.py::NNOpsCorrectnessTest::test_conv_3d0", "keras/src/ops/nn_test.py::NNOpsCorrectnessTest::test_conv_3d10", "keras/src/ops/nn_test.py::NNOpsCorrectnessTest::test_conv_3d2", "keras/src/ops/nn_test.py::NNOpsCorrectnessTest::test_conv_3d4", "keras/src/ops/nn_test.py::NNOpsCorrectnessTest...
[ "keras/src/ops/nn_test.py::NNOpsDynamicShapeTest::test_average_pool", "keras/src/ops/nn_test.py::NNOpsDynamicShapeTest::test_batch_normalization", "keras/src/ops/nn_test.py::NNOpsDynamicShapeTest::test_conv", "keras/src/ops/nn_test.py::NNOpsDynamicShapeTest::test_conv_transpose", "keras/src/ops/nn_test.py::...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
19,459
keras__keras-19459
[ "19437" ]
68e0368c680decbc7c9e1da57b56b3a8212b3ec2
diff --git a/keras/backend/numpy/random.py b/keras/backend/numpy/random.py index dd7e7234a33..b3204b43029 100644 --- a/keras/backend/numpy/random.py +++ b/keras/backend/numpy/random.py @@ -67,6 +67,7 @@ def truncated_normal(shape, mean=0.0, stddev=1.0, dtype=None, seed=None): def dropout(inputs, rate, noise_shape=...
diff --git a/keras/layers/regularization/alpha_dropout_test.py b/keras/layers/regularization/alpha_dropout_test.py index 916ef1fa66c..bcde257818c 100644 --- a/keras/layers/regularization/alpha_dropout_test.py +++ b/keras/layers/regularization/alpha_dropout_test.py @@ -15,6 +15,7 @@ def test_alpha_dropout_basics(self): ...
Keras with TF backend GaussianDropout gives error with mixed_bfloat16 When using Keras with 3.1.1 with Tensorflow 2.16.1 backend, using GaussianDropout layer with mixed_bfloat16 results in the following error message: ``` TypeError: Exception encountered when calling GaussianDropout.call(). Input 'y' of 'Mul' Op h...
BTW, I can see that Keras 2.15 uses dtype=inputs.dtype when calling self._random_generator.random_normal function. Another addition: Keras 3 Documentation suggests setting mixed policy with following line: `tf.keras.config.set_dtype_policy('mixed_bfloat16')` instead of the one I supplied above. Still same error.
2024-04-08T07:27:18Z
v3.6.0
2024-04-08T04:40:44Z
[ "keras/layers/regularization/gaussian_dropout_test.py::GaussianDropoutTest::test_gaussian_dropout_basics", "keras/layers/regularization/gaussian_noise_test.py::GaussianNoiseTest::test_gaussian_noise_basics", "keras/random/random_test.py::RandomDTypeTest::test_beta_bfloat16", "keras/random/random_test.py::Rand...
[ "keras/layers/regularization/alpha_dropout_test.py::AlphaDropoutTest::test_alpha_dropout_basics", "keras/layers/regularization/alpha_dropout_test.py::AlphaDropoutTest::test_alpha_dropout_correctness", "keras/layers/regularization/alpha_dropout_test.py::AlphaDropoutTest::test_alpha_dropout_negative_rate", "ker...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
20,041
keras__keras-20041
[ "19984" ]
f6a81cc2f524bf3d2e9cb1923d101f1308e4711b
diff --git a/keras/src/layers/reshaping/zero_padding1d.py b/keras/src/layers/reshaping/zero_padding1d.py index 2777423b792..c9e50d8897b 100644 --- a/keras/src/layers/reshaping/zero_padding1d.py +++ b/keras/src/layers/reshaping/zero_padding1d.py @@ -1,3 +1,4 @@ +from keras.src import backend from keras.src import ops ...
diff --git a/keras/src/layers/reshaping/zero_padding1d_test.py b/keras/src/layers/reshaping/zero_padding1d_test.py index 90767d5b080..8af0bfa4812 100644 --- a/keras/src/layers/reshaping/zero_padding1d_test.py +++ b/keras/src/layers/reshaping/zero_padding1d_test.py @@ -7,18 +7,30 @@ class ZeroPadding1DTest(testing....
Support for channels first data format with zeropadding1D Hi Keras team, It appears that the 1D ZeroPadding layer always assumes a channels-last data format. It would be beneficial to add support for cases where the data format is channels-first. Currently, the 1D ZeroPadding layer does not accept an input variable ...
Hi @ROZBEH, thank you for opening this issue. This could be a good standardization effort for our ZeroPadding layers, it does seem that our `ZeroPadding2D` and `ZeroPadding3D` have a `data_format` parameter that `ZeroPadding1D` doesn't. In general, we only have `data_format` parameters for reshaping layers that work on...
2024-07-24T14:55:31Z
v3.6.0
2024-07-24T04:44:07Z
[ "keras/src/layers/reshaping/zero_padding1d_test.py::ZeroPadding1DTest::test_zero_padding_1d0", "keras/src/layers/reshaping/zero_padding1d_test.py::ZeroPadding1DTest::test_zero_padding_1d1", "keras/src/layers/reshaping/zero_padding1d_test.py::ZeroPadding1DTest::test_zero_padding_1d_get_config0", "keras/src/lay...
[ "keras/src/layers/reshaping/zero_padding1d_test.py::ZeroPadding1DTest::test_zero_padding_1d_errors_if_padding_argument_invalid0", "keras/src/layers/reshaping/zero_padding1d_test.py::ZeroPadding1DTest::test_zero_padding_1d_errors_if_padding_argument_invalid1", "keras/src/layers/reshaping/zero_padding1d_test.py::...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
19,903
keras__keras-19903
[ "19708" ]
596d5ba420dd2865d576db2c5f860d9d77db8054
diff --git a/keras/api/_tf_keras/keras/ops/__init__.py b/keras/api/_tf_keras/keras/ops/__init__.py index a7a9bb32b3b..4a7d1145a57 100644 --- a/keras/api/_tf_keras/keras/ops/__init__.py +++ b/keras/api/_tf_keras/keras/ops/__init__.py @@ -16,6 +16,7 @@ from keras.src.ops.core import dtype from keras.src.ops.core import...
diff --git a/keras/src/ops/core_test.py b/keras/src/ops/core_test.py index 91b788e7544..a881609be44 100644 --- a/keras/src/ops/core_test.py +++ b/keras/src/ops/core_test.py @@ -19,6 +19,23 @@ class CoreOpsStaticShapeTest(testing.TestCase): + def test_map(self): + def f(x): + return x**2 + + ...
Request for a map function like map_fn in TF and vmap in Jax Currently, it seems there is no function to map a function to a tensor in keras 3.0. Such a function should do what map_fn in TF and vmap in Jax do. Otherwise, it is not very challenging to switch between the backends. Perhaps I missed something here coul...
Do you mean `keras.ops.vectorized_map`? Hi François, Thank you for your quick response. Sorry I am not so familiar with Jax. Now I found that vmap is similar to vectorized_map in TF and keras. I am particularly interested in map_fn because my operation cannot be vectorialized due to the large intermediate va...
2024-06-22T15:48:34Z
v3.6.0
2024-06-22T01:10:28Z
[ "keras/src/ops/core_test.py::CoreOpsStaticShapeTest::test_map", "keras/src/ops/core_test.py::CoreOpsCorrectnessTest::test_map", "keras/src/ops/core_test.py::CoreOpsCallsTests::test_map_basic_call" ]
[ "keras/src/ops/core_test.py::CoreOpsStaticShapeTest::test_fori_loop", "keras/src/ops/core_test.py::CoreOpsStaticShapeTest::test_scan", "keras/src/ops/core_test.py::CoreOpsStaticShapeTest::test_scatter", "keras/src/ops/core_test.py::CoreOpsStaticShapeTest::test_scatter_update", "keras/src/ops/core_test.py::C...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
18,659
keras__keras-18659
[ "18653" ]
26831056309d7af88899941d52ba0a7d987d7c62
diff --git a/keras/backend/jax/trainer.py b/keras/backend/jax/trainer.py index cc76d3a06e2..1be9290b8d7 100644 --- a/keras/backend/jax/trainer.py +++ b/keras/backend/jax/trainer.py @@ -352,6 +352,7 @@ def fit( ): self._assert_compile_called("fit") # TODO: respect compiled trainable state + ...
diff --git a/keras/trainers/trainer_test.py b/keras/trainers/trainer_test.py index ee96a0e5f8c..bd7071f605d 100644 --- a/keras/trainers/trainer_test.py +++ b/keras/trainers/trainer_test.py @@ -650,6 +650,49 @@ def call(self, inputs): out = model.predict({"a": x1, "b": x2}) self.assertEqual(out.shape, ...
Unable to change validation dataset for "model.fit()" function after it raises an exception Cross reporting issue #[62014](https://github.com/tensorflow/tensorflow/issues/62104) from tensorflow repo. When using model.fit() with validation_data, during first call to fit() it will create an `EpochIterator` object for ...
If worth to consider this as bug, a simple fix may be initializing `EpochIterator` to `None` in `model.fit` at beginning itself. In the source code self._eval_epoch_iterator is the validation_data EpochIterator object. Setting `self._eval_epoch_iterator = None` at the beginning of model.fit() ensures creation of n...
2023-10-20T06:24:03Z
v3.6.0
2023-10-19T16:40:10Z
[ "keras/trainers/trainer_test.py::TestTrainer::test_for_eval_epoch_iterator" ]
[ "keras/trainers/trainer_test.py::TestTrainer::test_adds_loss_scaling_optimizer", "keras/trainers/trainer_test.py::TestTrainer::test_callback_methods_keys", "keras/trainers/trainer_test.py::TestTrainer::test_evaluate_flow_eager", "keras/trainers/trainer_test.py::TestTrainer::test_evaluate_flow_graph_fn", "ke...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
20,296
keras__keras-20296
[ "20243" ]
ef407dbdc4b2d827a4509572904d6a6c539064e4
diff --git a/keras/src/trainers/compile_utils.py b/keras/src/trainers/compile_utils.py index 3a0ba8ce797..410a782dbcd 100644 --- a/keras/src/trainers/compile_utils.py +++ b/keras/src/trainers/compile_utils.py @@ -591,14 +591,21 @@ def _filter_unused_inputs( filtered_y_pred_keys, output_names, ): ...
diff --git a/keras/src/models/model_test.py b/keras/src/models/model_test.py index 5a6a5730244..0bbcf011d96 100644 --- a/keras/src/models/model_test.py +++ b/keras/src/models/model_test.py @@ -389,6 +389,49 @@ def test_functional_dict_outputs_dict_losses(self): ) self.assertListEqual(hist_keys, ref_ke...
support for dictionary-type loss functions without explicitly declaring `None` In previous versions of Keras, when providing a loss function as a dictionary for models with multiple outputs, the compileLoss function would automatically assign a default value for outputs without a defined loss. The relevant code was: `...
Thanks, this is a reasonable ask. Would you be able to open a PR for the change?
2024-09-27T06:47:29Z
v3.6.0
2024-09-26T22:04:29Z
[ "keras/src/models/model_test.py::ModelTest::test_functional_dict_outputs_dict_losses_with_undefined_loss" ]
[ "keras/src/models/model_test.py::ModelTest::test_functional_dict_outputs_dict_losses", "keras/src/models/model_test.py::ModelTest::test_functional_dict_outputs_dict_losses_invalid_keys", "keras/src/models/model_test.py::ModelTest::test_functional_dict_outputs_dict_metrics_invalid_keys", "keras/src/models/mode...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
19,284
keras__keras-19284
[ "19257" ]
4c356306273153d5dc26fc5772b106b4f750095f
diff --git a/keras/dtype_policies/dtype_policy.py b/keras/dtype_policies/dtype_policy.py index c546022f5f5..7c8586c2a6e 100644 --- a/keras/dtype_policies/dtype_policy.py +++ b/keras/dtype_policies/dtype_policy.py @@ -173,9 +173,6 @@ def _parse_name(self, name): return "float16", "float32" elif nam...
diff --git a/keras/layers/attention/attention_test.py b/keras/layers/attention/attention_test.py index c6010b67461..102717994ea 100644 --- a/keras/layers/attention/attention_test.py +++ b/keras/layers/attention/attention_test.py @@ -342,3 +342,19 @@ def test_attention_compute_mask_with_different_input_shapes(self): ...
Keras 3 Attention layer value tensor dimension hi, I found the below would not return the proper size output in Keras 3 (but works fine in Keras 2) Please help to fix it, Thanks. ```python import keras from keras import layers i = layers.Input((8,4)) xq = layers.Conv1D(5,1)(i) xk = layers.Conv1D(...
2024-03-11T17:59:37Z
v3.6.0
2024-03-18T19:46:58Z
[ "keras/layers/attention/attention_test.py::AttentionTest::test_attention_compute_output_shape" ]
[ "keras/layers/attention/attention_test.py::AttentionTest::test_attention_basics", "keras/layers/attention/attention_test.py::AttentionTest::test_attention_calculate_score_mask_no_causal_no_vmask", "keras/layers/attention/attention_test.py::AttentionTest::test_attention_calculate_score_mask_with_causal_and_vmask...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
18,766
keras__keras-18766
[ "18754" ]
4803b5497ad060cce345a323be2546152315ec3d
diff --git a/keras/layers/attention/attention.py b/keras/layers/attention/attention.py index 30027a3ff7a..de742f165f3 100644 --- a/keras/layers/attention/attention.py +++ b/keras/layers/attention/attention.py @@ -27,6 +27,7 @@ class Attention(Layer): attention scores. dropout: Float between 0 and ...
diff --git a/keras/layers/attention/additive_attention_test.py b/keras/layers/attention/additive_attention_test.py index 5aa7e7f2ee4..00f0dcb3c42 100644 --- a/keras/layers/attention/additive_attention_test.py +++ b/keras/layers/attention/additive_attention_test.py @@ -17,12 +17,12 @@ def test_attention_basics(self): ...
`noise_shape` Attribute Not Found in Attention Layer The source of this issue is at training time with the Attention layer. This is where self.noise_shape is referenced, but it is never assigned: https://github.com/keras-team/keras/blob/d4feb16c82b8e3d47721520e9b45ef4bebc1ead0/keras/layers/attention/attention.py#L17...
@nkovela1 , IMO we can set `noise_shape` to `None` here since this is being called inside the function `backend.random.dropout()` which has argument `noise_shape`. I think if the default value for this arg is `None` it will its value infer from inputs. I have referred legacy dropout API below. https://github.com...
2023-11-12T07:42:14Z
v3.6.0
2023-11-12T04:12:38Z
[ "keras/layers/attention/additive_attention_test.py::AdditiveAttentionTest::test_attention_basics", "keras/layers/attention/attention_test.py::AttentionTest::test_attention_basics", "keras/layers/attention/attention_test.py::AttentionTest::test_attention_with_dropout" ]
[ "keras/layers/attention/additive_attention_test.py::AdditiveAttentionTest::test_attention_correctness", "keras/layers/attention/additive_attention_test.py::AdditiveAttentionTest::test_attention_errors", "keras/layers/attention/additive_attention_test.py::AdditiveAttentionTest::test_attention_with_mask", "kera...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
20,040
keras__keras-20040
[ "19997" ]
f6a81cc2f524bf3d2e9cb1923d101f1308e4711b
diff --git a/keras/src/backend/common/variables.py b/keras/src/backend/common/variables.py index 34b69958ff2..e76930f0a1e 100644 --- a/keras/src/backend/common/variables.py +++ b/keras/src/backend/common/variables.py @@ -237,12 +237,13 @@ def assign(self, value): scope.add_update((self, value)) el...
diff --git a/keras/src/backend/common/variables_test.py b/keras/src/backend/common/variables_test.py index ab40c905cd5..2b36fbda58c 100644 --- a/keras/src/backend/common/variables_test.py +++ b/keras/src/backend/common/variables_test.py @@ -297,18 +297,36 @@ def test_variable_assign(self): v.assign(np.array([4...
Assign doesn't return a value When assigning a placeholder value to a KerasVariable I get returned a None type as there is no return in assignment, where as when assigning to a tf.Variable I get returned the proper assign operation. This is the code in keras.Variable: ``` def _direct_assign(self, value): ...
@sachinprasadhs Hi @markomitos, what is your use case for this? In general KerasVariables are used as an internal representation tool for cross-backend Jax functionality. As a user they are also created after calling `self.add_weight()` inside of a layer scope. Any placeholder value should be assigned as an `self.add_...
2024-07-24T14:30:53Z
v3.6.0
2024-07-24T04:44:07Z
[ "keras/src/backend/common/variables_test.py::VariableNumpyValueAndAssignmentTest::test_variable_assign_add_return", "keras/src/backend/common/variables_test.py::VariableNumpyValueAndAssignmentTest::test_variable_assign_return", "keras/src/backend/common/variables_test.py::VariableNumpyValueAndAssignmentTest::te...
[ "keras/src/backend/common/variables_test.py::VariableInitializationTest::test_deferred_initialization", "keras/src/backend/common/variables_test.py::VariableInitializationTest::test_deferred_initialize_already_initialized", "keras/src/backend/common/variables_test.py::VariableInitializationTest::test_variable_i...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
18,975
keras__keras-18975
[ "18970" ]
4a4a139c7aada9f4495620e5a1c5f7ef20d84395
diff --git a/keras/trainers/compile_utils.py b/keras/trainers/compile_utils.py index 8f830f4c9de..789844c31d7 100644 --- a/keras/trainers/compile_utils.py +++ b/keras/trainers/compile_utils.py @@ -468,6 +468,8 @@ def build(self, y_true, y_pred): "must be a callable. " f"Receive...
diff --git a/keras/trainers/compile_utils_test.py b/keras/trainers/compile_utils_test.py index f8927f111db..0d53dcacc35 100644 --- a/keras/trainers/compile_utils_test.py +++ b/keras/trainers/compile_utils_test.py @@ -251,6 +251,21 @@ def test_single_output_case(self): value = compile_loss(y_true, y_pred) ...
Setting loss="crossentropy" in the compile method of a model raises an error: 'list' object has no attribute 'shape' I love the workflow style of Keras so I decide to make some new metric in my own project. I want metrics more general like "accuracy". So when I run some tests like above, I came across that the loss see...
2023-12-20T14:15:26Z
v3.6.0
2023-12-19T21:38:23Z
[ "keras/trainers/compile_utils_test.py::TestCompileLoss::test_single_output_case_with_crossentropy_loss" ]
[ "keras/trainers/compile_utils_test.py::TestCompileMetrics::test_custom_metric_function", "keras/trainers/compile_utils_test.py::TestCompileMetrics::test_dict_output_case", "keras/trainers/compile_utils_test.py::TestCompileMetrics::test_list_output_case", "keras/trainers/compile_utils_test.py::TestCompileMetri...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
19,300
keras__keras-19300
[ "19299" ]
df705d4fc719ab617705197248804d689ad74767
diff --git a/keras/ops/nn.py b/keras/ops/nn.py index 6731d9980a3..5724f8de456 100644 --- a/keras/ops/nn.py +++ b/keras/ops/nn.py @@ -538,10 +538,13 @@ def softmax(x, axis=-1): array([0.09003057, 0.24472847, 0.66524096], shape=(3,), dtype=float64) """ - if isinstance(axis, int) and backend.shape(x)[axis] ...
diff --git a/keras/ops/nn_test.py b/keras/ops/nn_test.py index e5f9e10a065..bc77ca2700b 100644 --- a/keras/ops/nn_test.py +++ b/keras/ops/nn_test.py @@ -2,10 +2,12 @@ import pytest from absl.testing import parameterized +import keras from keras import backend from keras import layers from keras import losses fr...
`keras.ops.softmax` errors out when used in a TensorFlow compiled function ## MRE ```python import keras from keras import ops class SoftmaxLayer(keras.Layer): def call(self, x): return ops.softmax(x, axis=-1) class Model(keras.Model): def __init__(self): x = keras.Input(shape=(None,)) y...
2024-03-13T07:57:31Z
v3.6.0
2024-03-12T23:00:24Z
[ "keras/ops/nn_test.py::NNOpsDynamicShapeTest::test_softmax_in_graph" ]
[ "keras/ops/nn_test.py::NNOpsDynamicShapeTest::test_average_pool", "keras/ops/nn_test.py::NNOpsDynamicShapeTest::test_batch_normalization", "keras/ops/nn_test.py::NNOpsDynamicShapeTest::test_conv", "keras/ops/nn_test.py::NNOpsDynamicShapeTest::test_conv_transpose", "keras/ops/nn_test.py::NNOpsDynamicShapeTes...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
19,773
keras__keras-19773
[ "19770" ]
a243d91e43b4c43fe8d184b541b608b6ddd80f71
diff --git a/keras/src/layers/preprocessing/string_lookup.py b/keras/src/layers/preprocessing/string_lookup.py index 848ac99b123..8e8f4ac4c5c 100644 --- a/keras/src/layers/preprocessing/string_lookup.py +++ b/keras/src/layers/preprocessing/string_lookup.py @@ -316,6 +316,7 @@ def __init__( raise ValueError...
diff --git a/keras/src/layers/preprocessing/string_lookup_test.py b/keras/src/layers/preprocessing/string_lookup_test.py index 848cf6b34e0..4319d511a9a 100644 --- a/keras/src/layers/preprocessing/string_lookup_test.py +++ b/keras/src/layers/preprocessing/string_lookup_test.py @@ -5,6 +5,7 @@ from keras.src import back...
[BUG] keras.layers.StringLookup and Vocabulary of Tensors There is a bug in keras.layers.StringLookup when initializing it with a vocabulary of tensors. ``` import tensorflow as tf vocab = ["a", "b", "c", "d"] data = [["a", "c", "d"], ["d", "z", "b"]] layer = tf.keras.layers.StringLookup(vocabulary=tf.convert_...
Hi @rlcauvin , Thanks for report. I have reporduced the issue with Keras3 and TF2.15v as well. Tested with Tf2.12v and it works well.[Gist](https://colab.sandbox.google.com/gist/SuryanarayanaY/9b18cf4427067c71060aa3adfcf03873/19770.ipynb) The rootcause pointed by you seems proper solution. In **TF2.12v** , I can...
2024-05-29T06:29:26Z
v3.6.0
2024-05-27T18:35:30Z
[ "keras/src/layers/preprocessing/string_lookup_test.py::StringLookupTest::test_tensor_as_vocab" ]
[ "keras/src/layers/preprocessing/string_lookup_test.py::StringLookupTest::test_adapt_flow", "keras/src/layers/preprocessing/string_lookup_test.py::StringLookupTest::test_config", "keras/src/layers/preprocessing/string_lookup_test.py::StringLookupTest::test_fixed_vocabulary", "keras/src/layers/preprocessing/str...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
19,844
keras__keras-19844
[ "19828" ]
1c60668f6bdd05dab619806e7b2dc25d3ed4ccbf
diff --git a/keras/src/initializers/__init__.py b/keras/src/initializers/__init__.py index af46b7ff9b8..e7cf6f76e3e 100644 --- a/keras/src/initializers/__init__.py +++ b/keras/src/initializers/__init__.py @@ -49,6 +49,7 @@ "uniform": RandomUniform, "normal": RandomNormal, "orthogonal": Orthog...
diff --git a/keras/src/initializers/random_initializers_test.py b/keras/src/initializers/random_initializers_test.py index b58cf64ba61..c0fec3812ea 100644 --- a/keras/src/initializers/random_initializers_test.py +++ b/keras/src/initializers/random_initializers_test.py @@ -147,6 +147,10 @@ def test_orthogonal_initialize...
Keras 3.0 load h5 model with Orthogonal initializer fails Hi guys, I'm trying to load an h5 model that was working in earlier versions. * This is a small part of the h5 file, where you can see (last part of the snippet) a recurrent initializer with a classname of **Orthogonal**. ``` {"name": "decoder_gru0", ...
Hi @mahnehsilla - Thanks for raising the issue. Can you share the code snippet and h5 model with me where you are getting this error ? So I can reproduce it and try to help you on this.
2024-06-12T08:33:53Z
v3.6.0
2024-06-11T23:18:26Z
[ "keras/src/initializers/random_initializers_test.py::InitializersTest::test_orthogonal_initializer", "keras/src/layers/rnn/gru_test.py::GRUTest::test_legacy_implementation_argument" ]
[ "keras/src/initializers/random_initializers_test.py::InitializersTest::test_get_method", "keras/src/initializers/random_initializers_test.py::InitializersTest::test_random_normal", "keras/src/initializers/random_initializers_test.py::InitializersTest::test_random_uniform", "keras/src/initializers/random_initi...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
20,122
keras__keras-20122
[ "20094" ]
816d219c04b2bdb7de81081fa14eac63000dac30
diff --git a/keras/src/backend/tensorflow/linalg.py b/keras/src/backend/tensorflow/linalg.py index 636586d144a..2813303a4c4 100644 --- a/keras/src/backend/tensorflow/linalg.py +++ b/keras/src/backend/tensorflow/linalg.py @@ -185,6 +185,8 @@ def solve_triangular(a, b, lower=False): def svd(x, full_matrices=True, co...
diff --git a/keras/src/ops/linalg_test.py b/keras/src/ops/linalg_test.py index bc04ab0b0d2..8e722dd4125 100644 --- a/keras/src/ops/linalg_test.py +++ b/keras/src/ops/linalg_test.py @@ -534,6 +534,10 @@ def test_svd(self): # High tolerance due to numerical instability self.assertAllClose(x_reconstructe...
SVD operation failed when compute_uv=False (TF backend) ### Problem raised TensorFlow `tf.linalg.svd()` with compute_uv=False returns a single tensor containing the singular values, and not three tensors "s, u, v" when compute_uv=True. However, code line 188 in `keras/src/backend/tensorflow/linalg.py` always expect...
2024-08-14T14:53:12Z
v3.6.0
2024-08-12T23:22:06Z
[ "keras/src/ops/linalg_test.py::LinalgOpsCorrectnessTest::test_svd" ]
[ "keras/src/ops/linalg_test.py::LinalgOpsDynamicShapeTest::test_cholesky", "keras/src/ops/linalg_test.py::LinalgOpsDynamicShapeTest::test_det", "keras/src/ops/linalg_test.py::LinalgOpsDynamicShapeTest::test_eig", "keras/src/ops/linalg_test.py::LinalgOpsDynamicShapeTest::test_eigh", "keras/src/ops/linalg_test...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
20,125
keras__keras-20125
[ "20124" ]
6fd4873a367d20624105967c5be0d451f72f946d
diff --git a/keras/src/ops/core.py b/keras/src/ops/core.py index 88814ea5b2a..33f9eaf6874 100644 --- a/keras/src/ops/core.py +++ b/keras/src/ops/core.py @@ -609,6 +609,8 @@ def stop_gradient(variable): ... ) >>> var = keras.ops.stop_gradient(var) """ + if any_symbolic_tensors((variable,)): + re...
diff --git a/keras/src/ops/core_test.py b/keras/src/ops/core_test.py index 9610ba06b84..675a2ab357f 100644 --- a/keras/src/ops/core_test.py +++ b/keras/src/ops/core_test.py @@ -583,6 +583,15 @@ def test_stop_gradient_return(self): y = ops.stop_gradient(x) self.assertAllClose(x, y) + def test_stop...
`ops.stop_gradient` does not work with `KerasTensor` This example: ```python from keras import Input, Model, layers, ops a = Input(shape=(2,)) b = layers.Dense(4)(a) c = layers.Dense(4)(b) d = ops.stop_gradient(b) + c model = Model(inputs=a, outputs=d) print(model(ops.convert_to_tensor([[1,2]]))) ``` thro...
2024-08-15T10:14:47Z
v3.6.0
2024-08-14T15:36:47Z
[ "keras/src/ops/core_test.py::CoreOpsCorrectnessTest::test_stop_gradient_functional" ]
[ "keras/src/ops/core_test.py::CoreOpsStaticShapeTest::test_associative_scan", "keras/src/ops/core_test.py::CoreOpsStaticShapeTest::test_fori_loop", "keras/src/ops/core_test.py::CoreOpsStaticShapeTest::test_map", "keras/src/ops/core_test.py::CoreOpsStaticShapeTest::test_scan", "keras/src/ops/core_test.py::Cor...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
18,871
keras__keras-18871
[ "18864" ]
10252a9e7d68c6818423deee1c4c8549038e4171
diff --git a/keras/models/model.py b/keras/models/model.py index ee89bb42493..3132350d156 100644 --- a/keras/models/model.py +++ b/keras/models/model.py @@ -7,7 +7,6 @@ from keras import utils from keras.api_export import keras_export from keras.layers.layer import Layer -from keras.legacy.saving import legacy_h5_fo...
diff --git a/keras/saving/saving_api_test.py b/keras/saving/saving_api_test.py index f41de47e49e..e6a0d4158d1 100644 --- a/keras/saving/saving_api_test.py +++ b/keras/saving/saving_api_test.py @@ -171,8 +171,10 @@ def test_h5_deprecation_warning(self): with mock.patch.object(logging, "warning") as mock_warn: ...
Feature duplication on model.save() and keras.saving.save_model() When I was reading the code of model saving, I got strange feeling. https://github.com/keras-team/keras/blob/724321c7b39a90f6125b79931284aa9932c673a0/keras/models/model.py#L294-L297 It says `model.save()` is an alias for `keras.saving.save_model()`. ...
Yes, feel free to open a PR to reduce code redundancy. Thanks!
2023-12-02T09:56:38Z
v3.6.0
2023-12-02T01:01:44Z
[ "keras/saving/saving_api_test.py::SaveModelTestsWarning::test_h5_deprecation_warning" ]
[ "keras/saving/saving_api_test.py::SaveModelTests::test_basic_saving", "keras/saving/saving_api_test.py::SaveModelTests::test_invalid_save_format", "keras/saving/saving_api_test.py::SaveModelTests::test_save_h5_format", "keras/saving/saving_api_test.py::SaveModelTests::test_save_unsupported_extension", "kera...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
19,937
keras__keras-19937
[ "19932" ]
309f2c9c8959222e59d537b447c087a65c8b8998
diff --git a/keras/src/losses/loss.py b/keras/src/losses/loss.py index a35ecf7d48f..c73690e6f62 100644 --- a/keras/src/losses/loss.py +++ b/keras/src/losses/loss.py @@ -1,4 +1,5 @@ from keras.src import backend +from keras.src import dtype_policies from keras.src import ops from keras.src import tree from keras.src...
diff --git a/keras/src/losses/loss_test.py b/keras/src/losses/loss_test.py index e438f7d882b..fd120fcb9e3 100644 --- a/keras/src/losses/loss_test.py +++ b/keras/src/losses/loss_test.py @@ -4,6 +4,7 @@ import pytest from keras.src import backend +from keras.src import dtype_policies from keras.src import losses as ...
`unhashable type: 'DTypePolicy'` may leads problems in keras 3.4.1 Hello. Thank you for your contributions and maintenance for the best Keras. I'm working on a customized loss and using `keras.DTypePolicy` to config the dtype in it, as the following: ```python class MyCustomizedLoss(keras.losses.Loss): def __...
Hi @Zhaopudark - Thanks for reporting the issue. I have tested the code snippet and reproduces the reported behaviour. Attached [gist](https://colab.sandbox.google.com/gist/mehtamansi29/62c99255871ca72042fb42c3f3391c5a/19932-unhashable-type-dtypepolicy-may-leads-problems-in-keras-3-4-1.ipynb) file for reference. We...
2024-06-29T15:23:58Z
v3.6.0
2024-06-28T18:15:13Z
[ "keras/src/losses/loss_test.py::LossTest::test_dtype_arg", "keras/src/metrics/metric_test.py::MetricTest::test_dtype_arg" ]
[ "keras/src/losses/loss_test.py::LossTest::test_get_method", "keras/src/losses/loss_test.py::LossTest::test_mask", "keras/src/losses/loss_test.py::LossTest::test_mask_and_sample_weight", "keras/src/losses/loss_test.py::LossTest::test_mask_and_sample_weight_rank2", "keras/src/losses/loss_test.py::LossTest::te...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
18,977
keras__keras-18977
[ "18976" ]
fe2f54aa5bc42fb23a96449cf90434ab9bb6a2cd
diff --git a/keras/utils/tracking.py b/keras/utils/tracking.py index 17c8ae8b38a..d1acc013537 100644 --- a/keras/utils/tracking.py +++ b/keras/utils/tracking.py @@ -107,7 +107,6 @@ def add_to_store(self, store_name, value): class TrackedList(list): - # TODO: override item removal methods? def __init__(self...
diff --git a/keras/utils/tracking_test.py b/keras/utils/tracking_test.py index 8fcb4c84eec..38a0fcd3037 100644 --- a/keras/utils/tracking_test.py +++ b/keras/utils/tracking_test.py @@ -33,3 +33,24 @@ def test_untracking_in_tracked_list(self): lst.remove(v2) self.assertLen(lst, 2) self.assertL...
chore: override item removal methods in tracking Based on the TODO comments in keras/keras/utils/tracking.py
2023-12-21T07:57:15Z
v3.6.0
2023-12-21T06:10:45Z
[ "keras/utils/tracking_test.py::TrackingTest::test_untracking_in_tracked_list" ]
[]
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
19,924
keras__keras-19924
[ "19921" ]
a2e9a5252d2eab389bd19d359e6e7325a8232c79
diff --git a/keras/src/saving/saving_lib.py b/keras/src/saving/saving_lib.py index 6aad62db577..34430530aba 100644 --- a/keras/src/saving/saving_lib.py +++ b/keras/src/saving/saving_lib.py @@ -160,6 +160,9 @@ def _save_model_to_fileobj(model, fileobj, weights_format): f.write(config_json.encode()) ...
diff --git a/keras/src/saving/saving_lib_test.py b/keras/src/saving/saving_lib_test.py index 91e40426285..644afdb04e8 100644 --- a/keras/src/saving/saving_lib_test.py +++ b/keras/src/saving/saving_lib_test.py @@ -634,6 +634,7 @@ def save_own_variables(self, store): with zipfile.ZipFile(filepath) as zf: ...
Bug in Keras 3.4.0: Loading model error 'No such file or directory: 'model.weights.h5' ### Environment: Ubuntu 22.04 Tensorflow 2.16.1 Keras 3.4.0 ### Reproducing steps (1) Create the following python script `tf-save.py` to generate model file: ``` import os.path import pandas as pd import numpy as n...
We have confirmed this issue is not Tensorflow issue but bug introduced in Keras 3.4.0 https://github.com/tensorflow/tensorflow/issues/70273#issuecomment-2191371907 Our MLflow CI starting to fail since yesterday due to the same reason (becaus yesterday Keras 3.4.0 was released) https://github.com/mlflow-automation/ml...
2024-06-26T14:50:58Z
v3.6.0
2024-06-26T14:49:44Z
[ "keras/src/saving/saving_lib_test.py::SavingTest::test_save_model_exception_raised" ]
[ "keras/src/saving/saving_lib_test.py::SavingTest::test_compile_arg", "keras/src/saving/saving_lib_test.py::SavingTest::test_compile_overridden_warnings_sequential", "keras/src/saving/saving_lib_test.py::SavingTest::test_compile_overridden_warnings_subclassed", "keras/src/saving/saving_lib_test.py::SavingTest:...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
20,389
keras__keras-20389
[ "20307" ]
c31fad7b695faad63108c39bd008da9681bd8183
diff --git a/keras/src/models/functional.py b/keras/src/models/functional.py index 3d3f2fd68f1..91de7b82f23 100644 --- a/keras/src/models/functional.py +++ b/keras/src/models/functional.py @@ -699,7 +699,7 @@ def convert_revived_tensor(x): inbound_node_index = history[1] inbound_tensor_index =...
diff --git a/keras/src/saving/saving_lib_test.py b/keras/src/saving/saving_lib_test.py index 579b23478da..5c90c9f6975 100644 --- a/keras/src/saving/saving_lib_test.py +++ b/keras/src/saving/saving_lib_test.py @@ -723,6 +723,18 @@ def test_load_model_concurrently(self): pool.join() [r.get() for r i...
ValueError when loading models that has reused weights if I create a model wich reuses layers I get a Error when trying to load it again. ```python import tensorflow as tf from keras.models import load_model,save_model from keras import layers inputs = layers.Input(shape=(10,)) x=inputs t=layers.Dense(10) ...
Hi @K1521 - Thanks for reporting this issue. Here While creating the model you can reuse the layer weight store in variable(t) `t=layers.Dense(10)` instead of declaring new layer `x = layers.Dense(10)(x)`. Attached [gist](https://colab.sandbox.google.com/gist/mehtamansi29/1c65dbaa96744ee79bb7f124c81fd587/20307-val...
2024-10-22T08:57:23Z
v3.6.0
2024-10-21T16:14:11Z
[ "keras/src/saving/saving_lib_test.py::SavingTest::test_load_model_containing_reused_layer" ]
[ "keras/src/saving/saving_lib_test.py::SavingTest::test_compile_arg", "keras/src/saving/saving_lib_test.py::SavingTest::test_compile_overridden_warnings_sequential", "keras/src/saving/saving_lib_test.py::SavingTest::test_compile_overridden_warnings_subclassed", "keras/src/saving/saving_lib_test.py::SavingTest:...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
20,023
keras__keras-20023
[ "19219" ]
f9501f53fa15fe6286ca834618a6bcf10f86f7e8
diff --git a/keras/__init__.py b/keras/__init__.py index 701568f2a01..5a429d3a5d8 100644 --- a/keras/__init__.py +++ b/keras/__init__.py @@ -18,6 +18,7 @@ from keras.api import Regularizer from keras.api import Sequential from keras.api import StatelessScope +from keras.api import SymbolicScope from keras.api impor...
diff --git a/keras/src/backend/common/symbolic_scope_test.py b/keras/src/backend/common/symbolic_scope_test.py new file mode 100644 index 00000000000..092dcfe0748 --- /dev/null +++ b/keras/src/backend/common/symbolic_scope_test.py @@ -0,0 +1,26 @@ +import numpy as np + +from keras.src import ops +from keras.src import ...
[Feature Request] Re-enable multi-output logs If a model is configured for multi-output, in keras 2, we can get the log message for all corresponding outputs. But in keras 3, it is removed and only shows the summarized log message. Unlike mult-class classification, returning log message for mult-output sounds more natu...
+1 for this I have also filed the issue at #18993 I'm having the same restriction using GAN models, which have several loss values... The recommendation is to pass `metrics=` with a dict mapping different outputs to the metric you want to monitor. If the metric you need is the same as the loss, pass that. e.g. ```...
2024-07-21T08:52:57Z
v3.6.0
2024-07-22T05:38:31Z
[ "keras/src/backend/common/symbolic_scope_test.py::TestSymbolicScope::test_basic_flow", "keras/src/models/model_test.py::ModelTest::test_functional_dict_outputs_dict_losses", "keras/src/models/model_test.py::ModelTest::test_functional_dict_outputs_dict_losses_invalid_keys", "keras/src/models/model_test.py::Mod...
[]
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
19,641
keras__keras-19641
[ "19591" ]
9f4da5159a098256dfbccd2c926107953a6812e5
diff --git a/keras/src/backend/tensorflow/nn.py b/keras/src/backend/tensorflow/nn.py index cb6bff3b444..e590d10e2d3 100644 --- a/keras/src/backend/tensorflow/nn.py +++ b/keras/src/backend/tensorflow/nn.py @@ -252,6 +252,12 @@ def _conv_xla(): # If kernel's in_channel does not match input's channels, it indica...
diff --git a/keras/src/ops/nn_test.py b/keras/src/ops/nn_test.py index 2c825c4f416..4f85e96cd8c 100644 --- a/keras/src/ops/nn_test.py +++ b/keras/src/ops/nn_test.py @@ -1445,23 +1445,29 @@ def test_conv_2d_group_2(self, strides, dilation_rate): ) self.assertAllClose(outputs, expected) - @paramete...
Conv3D crash when the data_format is 'channels_first' and using Tensorflow backend According to the [document](https://keras.io/api/layers/convolution_layers/convolution3d/) of Conv3D in keras website, Conv3D should accept inputs with data format 'channels_first' or 'channels_last'. While in this [colab](https://colab...
According to the error message, the lack of support is only on CPU -- GPU should work fine. There's no CPU kernel for channels_first Conv3D. We can't fix that on the Keras side except by doing a transpose/counter-transpose in that case, which would be very inefficient. Got it. I'll try it on GPU. @fchollet Sorry for ...
2024-04-30T00:14:46Z
v3.6.0
2024-04-29T20:20:28Z
[ "keras/src/ops/nn_test.py::NNOpsCorrectnessTest::test_conv_3d0", "keras/src/ops/nn_test.py::NNOpsCorrectnessTest::test_conv_3d10", "keras/src/ops/nn_test.py::NNOpsCorrectnessTest::test_conv_3d2", "keras/src/ops/nn_test.py::NNOpsCorrectnessTest::test_conv_3d4", "keras/src/ops/nn_test.py::NNOpsCorrectnessTest...
[ "keras/src/ops/nn_test.py::NNOpsDynamicShapeTest::test_average_pool", "keras/src/ops/nn_test.py::NNOpsDynamicShapeTest::test_batch_normalization", "keras/src/ops/nn_test.py::NNOpsDynamicShapeTest::test_conv", "keras/src/ops/nn_test.py::NNOpsDynamicShapeTest::test_conv_transpose", "keras/src/ops/nn_test.py::...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
19,955
keras__keras-19955
[ "19952" ]
ca9519bf182650cd464d6825de451471b3243627
diff --git a/keras/src/backend/common/keras_tensor.py b/keras/src/backend/common/keras_tensor.py index d0ff42516b2..1314a266dfc 100644 --- a/keras/src/backend/common/keras_tensor.py +++ b/keras/src/backend/common/keras_tensor.py @@ -90,6 +90,20 @@ def squeeze(self, axis=None): return ops.Squeeze(axis)(self) ...
diff --git a/keras/src/backend/common/variables_test.py b/keras/src/backend/common/variables_test.py index 7ece491e8d0..ab40c905cd5 100644 --- a/keras/src/backend/common/variables_test.py +++ b/keras/src/backend/common/variables_test.py @@ -1,3 +1,5 @@ +import itertools + import numpy as np import pytest from absl.t...
Can't get learning rate as a value instead of a keras.Variable (and docs are incorrect) I need to capture the learning rate from a compiled keras model (tensorflow backend but it shouldn't matter). Previously I did this with tf.keras.backend.get_value(...), but keras 3.0 doesn't seem to have an equivalent. I want to ...
2024-07-04T12:57:24Z
v3.6.0
2024-07-03T21:31:20Z
[ "keras/src/backend/common/variables_test.py::VariableOpsCorrentnessTest::test_float", "keras/src/backend/common/variables_test.py::VariableOpsCorrentnessTest::test_int", "keras/src/backend/common/variables_test.py::VariableOpsCorrentnessTest::test_round", "keras/src/backend/common/variables_test.py::VariableO...
[ "keras/src/backend/common/variables_test.py::VariableInitializationTest::test_deferred_initialization", "keras/src/backend/common/variables_test.py::VariableInitializationTest::test_deferred_initialize_already_initialized", "keras/src/backend/common/variables_test.py::VariableInitializationTest::test_variable_i...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/keras__keras
20,206
keras__keras-20206
[ "20203" ]
fa6be07ce86b3f8c5072a3d5ff355b4266baa32d
diff --git a/keras/src/models/sequential.py b/keras/src/models/sequential.py index c0ed98fb854..cdf5687a430 100644 --- a/keras/src/models/sequential.py +++ b/keras/src/models/sequential.py @@ -268,7 +268,7 @@ def compute_output_shape(self, input_shape): def input_shape(self): if self._functional: ...
diff --git a/keras/src/models/sequential_test.py b/keras/src/models/sequential_test.py index 943f6723b55..5e407804203 100644 --- a/keras/src/models/sequential_test.py +++ b/keras/src/models/sequential_test.py @@ -227,6 +227,12 @@ def call(self, inputs): self.assertEqual(type(y), list) model.summary() ...
Nested sequentials broken in 3.5 The following reduced example gives an error in Keras 3.5.0 but worked in 3.4.1 and earlier: ```python import keras model = keras.Sequential() model.add(keras.Input(shape=(16,))) keras.Sequential([model]) ``` ``` ValueError: Sequential model 'sequential' has no defined inp...
2024-09-04T02:18:31Z
v3.6.0
2024-09-03T18:18:16Z
[ "keras/src/models/sequential_test.py::SequentialTest::test_hasattr", "keras/src/models/sequential_test.py::SequentialTest::test_nested_sequential" ]
[ "keras/src/models/sequential_test.py::SequentialTest::test_bad_layer", "keras/src/models/sequential_test.py::SequentialTest::test_basic_flow_as_a_submodel", "keras/src/models/sequential_test.py::SequentialTest::test_basic_flow_deferred", "keras/src/models/sequential_test.py::SequentialTest::test_basic_flow_wi...
0c2bdff313f7533f0d7e6670a906102cc2fb046d
manhtdd/pytorch-lightning__pytorch-lightning
6,088
pytorch-lightning__pytorch-lightning-6088
[ "5875", "5851" ]
079fe9bc0908fffdd55a08f7321a199bceaef6f8
diff --git a/docs/source/common/hyperparameters.rst b/docs/source/common/hyperparameters.rst index 5240a4690e388..83398c1d63388 100644 --- a/docs/source/common/hyperparameters.rst +++ b/docs/source/common/hyperparameters.rst @@ -53,10 +53,10 @@ a module (i.e.: if your project has a model that trains on Imagenet and ano...
diff --git a/tests/trainer/test_trainer_cli.py b/tests/trainer/test_trainer_cli.py index ac3906eee3ec0..32da5d2b2fa99 100644 --- a/tests/trainer/test_trainer_cli.py +++ b/tests/trainer/test_trainer_cli.py @@ -67,10 +67,15 @@ def test_add_argparse_args_redefined(cli_args: list): @pytest.mark.parametrize('cli_args',...
Improve interface between Trainer and argparse ## 🚀 Feature Current Trainer.add_argparse_args(parser_param) creates a new ArgumentParser object, passing the parser_param object as a parent to the newly created parser. Trainer.add_argparse_args() returns the new ArgumentParser object to its caller. An improved in...
Duplicate of https://github.com/PyTorchLightning/pytorch-lightning/issues/3076 (requires the same fix) Note that we plan to migrate our argparse functionalities to use https://github.com/PyTorchLightning/pytorch-lightning/pull/4492. Please have a look to see if it fits your use case! Sorry about the duplication — so...
2021-02-19T18:10:14Z
2.4.0
2021-03-11T11:19:48Z
[ "tests/trainer/test_trainer_cli.py::test_default_args", "tests/trainer/test_trainer_cli.py::test_add_argparse_args_redefined[cli_args0]", "tests/trainer/test_trainer_cli.py::test_add_argparse_args_redefined[cli_args1]", "tests/trainer/test_trainer_cli.py::test_add_argparse_args_redefined[cli_args2]", "tests...
[]
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
17,323
pytorch-lightning__pytorch-lightning-17323
[ "14816" ]
e9d685635580e6150a0e65d9b4c7ee8ad2a1de71
diff --git a/src/lightning/fabric/CHANGELOG.md b/src/lightning/fabric/CHANGELOG.md index b2f62abb6c095..759a8bad38db7 100644 --- a/src/lightning/fabric/CHANGELOG.md +++ b/src/lightning/fabric/CHANGELOG.md @@ -20,6 +20,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added suppo...
diff --git a/.github/workflows/ci-tests-pytorch.yml b/.github/workflows/ci-tests-pytorch.yml index a76588accb3d0..24d1933b8af5e 100644 --- a/.github/workflows/ci-tests-pytorch.yml +++ b/.github/workflows/ci-tests-pytorch.yml @@ -115,7 +115,7 @@ jobs: - name: Install package & dependencies run: | - ...
Checkpointing primitives for Fabric ## 🚀 Feature Add `Lite.save_checkpoint` and `Lite.load_checkpoint` convenience methods. ### Motivation It is cumbersome to manually construct a checkpoint dict with all metadata and states. ### Pitch Saving checkpoints: ```py ckpt = self.create_checkpoint(model1, ...
You might find this library useful for such primitives, especially to support distributed checkpointing: https://github.com/pytorch/torchsnapshot @yifuwang Hey @ananthsub @yifuwang Would you be interested in making a contribution to Lite ? @ananthsub Thanks, yes we already saw it and the interface is really nice. It...
2023-04-11T04:46:49Z
2.4.0
2023-04-15T15:21:56Z
[ "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_save_checkpoint_storage_options", "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_save_checkpoint_folder_exists", "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_save_checkpoint_one_fsdp_module_required", "tests/tests_fabric/strategies/test_...
[ "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_support", "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_custom_mixed_precision", "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_cpu_offload", "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_setup_optimizer_validation[False]", "te...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
16,570
pytorch-lightning__pytorch-lightning-16570
[ "14014" ]
e20172d37005046faa74c0a208839cda237cfc10
diff --git a/docs/source-pytorch/api_references.rst b/docs/source-pytorch/api_references.rst index b96911afa771c..4ad07accc0d9f 100644 --- a/docs/source-pytorch/api_references.rst +++ b/docs/source-pytorch/api_references.rst @@ -139,6 +139,7 @@ environments KubeflowEnvironment LightningEnvironment LSFEnv...
diff --git a/tests/tests_fabric/plugins/environments/test_mpi.py b/tests/tests_fabric/plugins/environments/test_mpi.py new file mode 100644 index 0000000000000..6231324e6e8d5 --- /dev/null +++ b/tests/tests_fabric/plugins/environments/test_mpi.py @@ -0,0 +1,131 @@ +# Copyright The PyTorch Lightning team. +# +# Licensed...
ClusterEnvironment for Azure/MPI ## 🚀 Feature Provide a ClusterEnvironment, either specific to Azure or a general one for MPI launchers. ### Motivation Users have asked about this, indirectly, through issues like #13907 and #13639 where they struggled to get multi-node working on Azure/MPI clusters. If Lightn...
Here's a working solution that I've tested on Azure with DDP and deepspeed on the following setups: - 1 node, 1 gpu - 1 node, 2 gpus per node - 2 nodes, 1 gpu per node - 2 nodes, 2 gpus per node I haven't dug into how this would integrate into PTL (to autodetect the environment, etc.), but I can look at that a...
2023-01-30T23:30:34Z
2.4.0
2023-02-03T09:36:56Z
[ "tests/tests_fabric/plugins/environments/test_mpi.py::test_dependencies", "tests/tests_fabric/plugins/environments/test_mpi.py::test_detect", "tests/tests_fabric/plugins/environments/test_mpi.py::test_default_attributes", "tests/tests_fabric/plugins/environments/test_mpi.py::test_init_local_comm", "tests/te...
[]
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
5,351
pytorch-lightning__pytorch-lightning-5351
[ "5070" ]
0c9960bfbb7d76dd594b75c57cf0ac0d0ddaac04
diff --git a/pytorch_lightning/loggers/wandb.py b/pytorch_lightning/loggers/wandb.py index 443c50ac4835f..f588429aa8ea2 100644 --- a/pytorch_lightning/loggers/wandb.py +++ b/pytorch_lightning/loggers/wandb.py @@ -49,19 +49,20 @@ class WandbLogger(LightningLoggerBase): Args: name: Display name for the ru...
diff --git a/tests/loggers/test_wandb.py b/tests/loggers/test_wandb.py index 94c947e8d68d9..fdbf8602d5c28 100644 --- a/tests/loggers/test_wandb.py +++ b/tests/loggers/test_wandb.py @@ -40,6 +40,18 @@ def test_wandb_logger_init(wandb, recwarn): wandb.init.assert_called_once() wandb.init().log.assert_called_onc...
Logging validation metrics with `val_check_interval` ## ❓ Questions and Help <!-- If you still can't find what you need: --> #### What is your question? My training epoch is very long, so I'd like to run mini-validation loops in the middle of the epoch, which I can do easily by setting `val_check_interval=N`. ...
Hi! thanks for your contribution!, great first issue! **Update:** Replicated in the BoringColab with a dummy dataset: https://colab.research.google.com/drive/1_o9L1kOmr8xtB-mS0y3bWWa2o1STh2bA **EDIT:** I've forked pytorch-lightning locally and made some edits to the `trainer.py`, `training_loop.py`, `evaluation_l...
2021-01-04T20:21:34Z
2.4.0
2021-01-24T16:15:52Z
[ "tests/loggers/test_wandb.py::test_wandb_logger_init" ]
[ "tests/loggers/test_wandb.py::test_wandb_pickle", "tests/loggers/test_wandb.py::test_wandb_sanitize_callable_params" ]
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
5,621
pytorch-lightning__pytorch-lightning-5621
[ "5615" ]
da6dbc8d1d128cf783d7151b012a5502bbd52bf5
diff --git a/CHANGELOG.md b/CHANGELOG.md index e51b09899a1fb..5d2b710c4d343 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -80,6 +80,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added `QuantizationAwareTraining` callback ([#5706](https://github.com/PyTorchLightning/pytorch-li...
diff --git a/tests/callbacks/test_callbacks.py b/tests/callbacks/test_callbacks.py index 060d42fd5edc3..8bb6d3c8dc815 100644 --- a/tests/callbacks/test_callbacks.py +++ b/tests/callbacks/test_callbacks.py @@ -12,14 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the...
configure_callbacks hook for LightningModule ## 🚀 Feature ### Motivation Provide model-specific callbacks in a LightningModule ### Pitch Add a configure_callbacks method to LightningModule Append the returned callbacks to the trainer callbacks. ### Additional context cc @edenlightning
Improvements: * Supporting priorities for callbacks CallbackA(priority=1) CallbackB(priority=1) CallbackC(priority=2) In this case, A, B are called sequentially (order does not matter between A, B because both are priority 1. And C is called after A, B C or B, A C Another improvments: Support child callbacks, to cu...
2021-01-23T03:07:05Z
2.4.0
2021-02-12T20:48:56Z
[ "tests/trainer/connectors/test_callback_connector.py::test_checkpoint_callbacks_are_last", "tests/trainer/connectors/test_callback_connector.py::test_attach_model_callbacks", "tests/trainer/connectors/test_callback_connector.py::test_attach_model_callbacks_override_info" ]
[]
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
16,715
pytorch-lightning__pytorch-lightning-16715
[ "13266" ]
52a39c03f8a4799f67d7c27ae12ca92c2a17a9a2
diff --git a/src/lightning/fabric/fabric.py b/src/lightning/fabric/fabric.py index 60ce9e84b14da..c6b9423b400f2 100644 --- a/src/lightning/fabric/fabric.py +++ b/src/lightning/fabric/fabric.py @@ -363,6 +363,33 @@ def backward(self, tensor: Tensor, *args: Any, model: Optional[_FabricModule] = self._precision...
diff --git a/tests/tests_fabric/helpers/models.py b/tests/tests_fabric/helpers/models.py index 5122e0c967642..bc40401d09a6d 100644 --- a/tests/tests_fabric/helpers/models.py +++ b/tests/tests_fabric/helpers/models.py @@ -48,7 +48,7 @@ def step(self, model: Module, batch: Any) -> Tensor: loss = torch.nn.functio...
[Fabric] Gradient Clipping with AMP ## 🚀 Feature Currently, there doesn't seem to be a way to do gradient clipping when using AMP with LightningLite. This is because the grad scalar code is behind the NativeMixedPrecisionPlugin, and there doesn't seem to be any way of changing this for LightningLite. ### Motivat...
@nimashoghi using trainer plugins would be a nice addition to LightningLite, working on it @tanmoyio I don't think it is that easy (and probably not even desired) to really add support for plugins in general, as this would reintroduce some structural requirements we wanted to get rid of with `LightningLite`. Otherwise ...
2023-02-10T11:24:27Z
2.4.0
2023-02-27T20:14:23Z
[ "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_grad_clipping_value_error", "tests/tests_fabric/strategies/test_single_device.py::test_single_device_grad_clipping[norm-32-true]", "tests/tests_fabric/strategies/test_single_device.py::test_single_device_grad_clipping[val-32-true]", "tests/tests_fabric/te...
[ "tests/tests_fabric/plugins/precision/test_amp_integration.py::test_amp[cpu-16-mixed-expected_dtype0]", "tests/tests_fabric/plugins/precision/test_amp_integration.py::test_amp[cpu-bf16-mixed-expected_dtype1]", "tests/tests_fabric/plugins/precision/test_double_integration.py::test_double_precision", "tests/tes...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
5,068
pytorch-lightning__pytorch-lightning-5068
[ "4656" ]
4a3f9069cb8fabf588f08361225d129cc52c933e
diff --git a/pytorch_lightning/metrics/classification/__init__.py b/pytorch_lightning/metrics/classification/__init__.py index 13cb705f30b17..b4cbb6b073efe 100644 --- a/pytorch_lightning/metrics/classification/__init__.py +++ b/pytorch_lightning/metrics/classification/__init__.py @@ -14,7 +14,7 @@ from pytorch_lightni...
diff --git a/tests/test_deprecated.py b/tests/test_deprecated.py index 58384fed0cd4f..59c6728009b6f 100644 --- a/tests/test_deprecated.py +++ b/tests/test_deprecated.py @@ -119,6 +119,20 @@ def test_tbd_remove_in_v1_2_0(): checkpoint_cb = ModelCheckpoint(filepath='.', dirpath='.') +def test_tbd_remove_in_v...
[Metrics] Unification of FBeta ## 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 wi...
@Borda yes, I saw your comment and promised long time ago update to the metric. I have a hard time keeping these unifications PRs small, as it involves moving the old implementation, creating/updating class interface to call functional interface, update docs, update tests ect. so it often involve changes in many files...
2020-12-10T21:48:42Z
2.4.0
2020-12-11T21:11:21Z
[ "tests/test_deprecated.py::test_tbd_remove_in_v1_2_0_metrics" ]
[ "tests/test_deprecated.py::test_tbd_remove_in_v1_3_0", "tests/test_deprecated.py::test_tbd_remove_in_v1_3_0_metrics", "tests/test_deprecated.py::test_tbd_remove_in_v1_2_0", "tests/test_deprecated.py::test_trainer_profiler_remove_in_v1_3_0[True-SimpleProfiler]", "tests/test_deprecated.py::test_trainer_profil...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
18,513
pytorch-lightning__pytorch-lightning-18513
[ "18493" ]
4dfc09c2fe5cf4a66b6ec69e4189fe0ac2a92fb8
diff --git a/src/lightning/fabric/CHANGELOG.md b/src/lightning/fabric/CHANGELOG.md index 4a846a7aeb7fe..a6b4a3f2671cf 100644 --- a/src/lightning/fabric/CHANGELOG.md +++ b/src/lightning/fabric/CHANGELOG.md @@ -121,6 +121,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Improved the...
diff --git a/tests/tests_fabric/strategies/test_deepspeed.py b/tests/tests_fabric/strategies/test_deepspeed.py index 2edded9ca8e87..3694efac56463 100644 --- a/tests/tests_fabric/strategies/test_deepspeed.py +++ b/tests/tests_fabric/strategies/test_deepspeed.py @@ -12,7 +12,6 @@ # See the License for the specific langu...
Saving learning rate schedules with Fabric ### Bug description It is unclear to me how learning rate schedules should be used alongside `fabric.save`. I've defaulted to manually saving with `fabric.save(..., {..., 'schedule': schedule.state_dict()}` and manually loading with `ckpt=fabric.load(...); sched.load(ckpt['sc...
Hey @nikvaessen Thanks again for the feedback here! And that you provide a runnable example is absolutely fantastic! You are right, the pickle error is due to the fact that the scheduler uses the wrapped optimizer. In general however, we shouldn't expect optimizers, schedulers or other modules to be pickleable. ...
2023-09-10T00:14:04Z
2.4.0
2023-09-08T15:49:31Z
[ "tests/tests_fabric/strategies/test_strategy.py::test_save_checkpoint_rank_zero_only[True]", "tests/tests_fabric/strategies/test_strategy.py::test_save_checkpoint_rank_zero_only[False]", "tests/tests_fabric/strategies/test_strategy.py::test_save_checkpoint_empty_state", "tests/tests_fabric/strategies/test_str...
[]
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
18,088
pytorch-lightning__pytorch-lightning-18088
[ "18044" ]
04e2d800af7afb47ab534290a146514c678f7db6
diff --git a/src/lightning/fabric/loggers/csv_logs.py b/src/lightning/fabric/loggers/csv_logs.py index 31756502e95f7..fd0c69c3ab439 100644 --- a/src/lightning/fabric/loggers/csv_logs.py +++ b/src/lightning/fabric/loggers/csv_logs.py @@ -21,7 +21,7 @@ from torch import Tensor from lightning.fabric.loggers.logger imp...
diff --git a/tests/tests_fabric/utilities/test_cloud_io.py b/tests/tests_fabric/utilities/test_cloud_io.py index 9cdc52acd4c8d..cd600eadf7e00 100644 --- a/tests/tests_fabric/utilities/test_cloud_io.py +++ b/tests/tests_fabric/utilities/test_cloud_io.py @@ -15,8 +15,9 @@ import fsspec from fsspec.implementations.loc...
Missing folder exception with Google Cloud Storage checkpointing ### Bug description The training fails when a GCP bucket is chosen as the Trainer's `default_root_dir`. I am properly logged in using `gcloud auth application-default login` and the correct GCP project is set using `gcloud config set project <my-projec...
I managed to trace it back to [this issue](https://github.com/fsspec/gcsfs/issues/312) in gcsfs. Essentially, the first call to `fs.isdir` returns `False` even when the 'folder' exists, while the second call properly returns `True`. I also noticed that a similar behavior was observed and fixed in Lightning back in 2021...
2023-07-15T01:56:35Z
2.4.0
2023-07-31T20:15:58Z
[ "tests/tests_fabric/utilities/test_cloud_io.py::test_get_filesystem_custom_filesystem", "tests/tests_fabric/utilities/test_cloud_io.py::test_get_filesystem_local_filesystem", "tests/tests_fabric/utilities/test_cloud_io.py::test_is_dir_with_local_filesystem", "tests/tests_fabric/utilities/test_cloud_io.py::tes...
[]
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
5,479
pytorch-lightning__pytorch-lightning-5479
[ "4547" ]
8dfcc078c41da3fa95b1282267965dd8080e62d5
diff --git a/CHANGELOG.md b/CHANGELOG.md index 539c08e69ffe0..024d92d22f782 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,6 +68,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added compositional metrics ([#5464](https://github.com/PyTorchLightning/pytorch-lightning/pull/54...
diff --git a/tests/deprecated_api/test_remove_1-4.py b/tests/deprecated_api/test_remove_1-4.py index fc3b201d88a74..a4120d77676b5 100644 --- a/tests/deprecated_api/test_remove_1-4.py +++ b/tests/deprecated_api/test_remove_1-4.py @@ -114,22 +114,44 @@ def test_v1_4_0_deprecated_metrics(): precision_recall(torch...
Class version of AUROC metric ## 🚀 Feature <!-- A clear and concise description of the feature proposal --> Class version of AUROC metric following the v1.x.x standard, so we can do: ```python auroc = AUROC(num_classes=4) auroc(pred, target) auroc.compute() ``` ### Motivation <!-- Please outline the motiv...
I've created a possible implementation of a Metric Class for AUROC: ```python from typing import Optional, Any, Sequence import torch from pytorch_lightning.metrics import Metric from pytorch_lightning.metrics.functional.classification import auroc, multiclass_auroc class AUROC(Metric): def __init__( ...
2021-01-12T10:53:57Z
2.4.0
2021-01-27T10:02:16Z
[ "tests/deprecated_api/test_remove_1-4.py::test_v1_4_0_deprecated_imports", "tests/deprecated_api/test_remove_1-4.py::test_v1_4_0_deprecated_trainer_device_distrib", "tests/deprecated_api/test_remove_1-4.py::test_v1_4_0_deprecated_metrics", "tests/metrics/classification/test_auc.py::TestAUC::test_auc[True-Fals...
[]
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
4,981
pytorch-lightning__pytorch-lightning-4981
[ "4974" ]
4e6a871710055bb64f9eb0fa2e2efd19de064389
diff --git a/pytorch_lightning/core/optimizer.py b/pytorch_lightning/core/optimizer.py index dc63231ba6ccb..e6b973b336e43 100644 --- a/pytorch_lightning/core/optimizer.py +++ b/pytorch_lightning/core/optimizer.py @@ -11,6 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the Li...
diff --git a/tests/core/test_lightning_module.py b/tests/core/test_lightning_module.py index 3e2e6d040f44c..a7054a3a7ef49 100644 --- a/tests/core/test_lightning_module.py +++ b/tests/core/test_lightning_module.py @@ -55,6 +55,11 @@ def test_automatic_optimization_num_calls(enable_pl_optimizer, tmpdir): class...
AttributeError: 'LightningOptimizer' object has no attribute 'state' I am using pytorch lightning with Adam optmiser to train a BYOL model, the model and pipeline works fine while training, when I stop and resume from checkpoint, it raise this error. I didn't do anything just resume from previous checkpoint, have no ...
Thanks for the report, it would be really really useful (and get this fixed faster) if you could reproduce this via the bug report model: https://github.com/PyTorchLightning/pytorch-lightning/blob/master/pl_examples/bug_report_model.py cc @tchaton Hey @yikuanli, Thanks a lot for testing the latest version of ...
2020-12-04T20:01:04Z
2.4.0
2020-12-11T09:37:32Z
[ "tests/core/test_lightning_optimizer.py::test_state", "tests/core/test_lightning_optimizer.py::test_lightning_optimizer_with_wrong_optimizer_interface", "tests/trainer/optimization/test_manual_optimization.py::test_step_with_optimizer_closure_and_extra_arguments", "tests/trainer/optimization/test_manual_optim...
[ "tests/core/test_lightning_module.py::test_automatic_optimization", "tests/core/test_lightning_module.py::test_automatic_optimization_num_calls[False]", "tests/core/test_lightning_module.py::test_automatic_optimization_num_calls[True]", "tests/trainer/optimization/test_manual_optimization.py::test_step_with_o...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
18,049
pytorch-lightning__pytorch-lightning-18049
[ "18041" ]
7116a9f9bb07193add28bcf15041764575fa5bab
diff --git a/docs/source-fabric/api/fabric_methods.rst b/docs/source-fabric/api/fabric_methods.rst index 4e8a7d3a36b9a..9411966178e9d 100644 --- a/docs/source-fabric/api/fabric_methods.rst +++ b/docs/source-fabric/api/fabric_methods.rst @@ -254,10 +254,30 @@ Fabric will handle the loading part correctly, whether runnin...
diff --git a/tests/tests_fabric/strategies/test_deepspeed.py b/tests/tests_fabric/strategies/test_deepspeed.py index 12ae881d42d3b..84cd86ffc3bb5 100644 --- a/tests/tests_fabric/strategies/test_deepspeed.py +++ b/tests/tests_fabric/strategies/test_deepspeed.py @@ -344,6 +344,26 @@ def test_deepspeed_load_checkpoint_opt...
Support loading a raw checkpoint in `Fabric.load()` ### Description & Motivation Fabric's format for saving checkpoints looks like this: ```py state = {"model": ..., "optimizer": ...} fabric.save("file.pt", state) ``` And the resulting checkpoint file simply contains the pickled dictionary with keys "model" e...
2023-07-10T20:30:08Z
2.4.0
2023-07-17T23:09:38Z
[ "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_load_raw_checkpoint_validate_single_file", "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_load_raw_checkpoint_optimizer_unsupported", "tests/tests_fabric/test_fabric.py::test_load_raw" ]
[ "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_support", "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_custom_mixed_precision", "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_cpu_offload", "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_sharding_strategy", "tests/tests_fabric...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
5,095
pytorch-lightning__pytorch-lightning-5095
[ "5092" ]
74171efadf5ea94416d26f1e2c27c1586a3a84b3
diff --git a/docs/source/optimizers.rst b/docs/source/optimizers.rst index 6ca72b8069d6d..06e6e9679d29f 100644 --- a/docs/source/optimizers.rst +++ b/docs/source/optimizers.rst @@ -191,37 +191,48 @@ override the :meth:`optimizer_step` function. For example, here step optimizer A every 2 batches and optimizer B every...
diff --git a/tests/core/test_lightning_module.py b/tests/core/test_lightning_module.py index a7054a3a7ef49..e3a597063d02e 100644 --- a/tests/core/test_lightning_module.py +++ b/tests/core/test_lightning_module.py @@ -103,3 +103,47 @@ def optimizer_step(self, epoch, batch_idx, optimizer, optimizer_idx, assert sgd_z...
Optimization docs and override optimizer_step docs ## 📚 Documentation Optimization docs need to be updated with the correct way of overriding ```optimizer_step()``` method, which now takes in a closure as a non-optional parameter. https://pytorch-lightning.readthedocs.io/en/latest/optimizers.html#step-optimizers...
@edenlightning
2020-12-11T16:10:14Z
2.4.0
2020-12-11T17:42:53Z
[ "tests/core/test_lightning_module.py::test_params_groups_and_state_are_accessible[False]", "tests/core/test_lightning_module.py::test_params_groups_and_state_are_accessible[True]", "tests/trainer/optimization/test_manual_optimization.py::test_step_with_optimizer_closure_and_extra_arguments", "tests/trainer/op...
[ "tests/core/test_lightning_module.py::test_automatic_optimization", "tests/core/test_lightning_module.py::test_automatic_optimization_num_calls[False]", "tests/core/test_lightning_module.py::test_automatic_optimization_num_calls[True]", "tests/core/test_lightning_optimizer.py::test_state", "tests/trainer/op...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
5,056
pytorch-lightning__pytorch-lightning-5056
[ "4763" ]
5f94900361ed53bf55caee66ad6d7eac5230b573
diff --git a/CHANGELOG.md b/CHANGELOG.md index 8efcd6f06c2d6..9209d1363326f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added `R2Score` metric ([#5241](https://github.com/PyTorchLightning/pytorch-lightning/pull/5241)) ...
diff --git a/tests/metrics/functional/test_image_gradients.py b/tests/metrics/functional/test_image_gradients.py new file mode 100644 index 0000000000000..c55a541a3192f --- /dev/null +++ b/tests/metrics/functional/test_image_gradients.py @@ -0,0 +1,109 @@ +import torch +import pytest + +from pytorch_lightning.metrics.f...
[Metrics] Add Image Gradient ## 🚀 Feature <!-- A clear and concise description of the feature proposal --> Implement Image-Gradients for PT Lightning. ### Motivation <!-- Please outline the motivation for the proposal. Is your feature request related to a problem? e.g., I'm always frustrated when [...]. If thi...
Hi! thanks for your contribution!, great first issue! Hey @pranjaldatta, Would you like to create a PR with the `Image gradients` metric implementation ? Best regards, Thomas Chaton. @tchaton Yes! I am currently working on an implementation. Will make a PR asap.
2020-12-10T10:10:56Z
2.4.0
2021-01-07T15:57:26Z
[ "tests/metrics/functional/test_image_gradients.py::test_invalid_input_img_type", "tests/metrics/functional/test_image_gradients.py::test_invalid_input_ndims", "tests/metrics/functional/test_image_gradients.py::test_multi_batch_image_gradients", "tests/metrics/functional/test_image_gradients.py::test_image_gra...
[]
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
17,596
pytorch-lightning__pytorch-lightning-17596
[ "17550" ]
c38cf21ee44eac02a84e866a476f9147220f3f4b
diff --git a/src/lightning/fabric/plugins/environments/slurm.py b/src/lightning/fabric/plugins/environments/slurm.py index 086c7a0012c50..97fceb0218284 100644 --- a/src/lightning/fabric/plugins/environments/slurm.py +++ b/src/lightning/fabric/plugins/environments/slurm.py @@ -31,6 +31,9 @@ class SLURMEnvironment(Clust...
diff --git a/.github/workflows/ci-tests-fabric.yml b/.github/workflows/ci-tests-fabric.yml index a8543078080bd..2f61344c25309 100644 --- a/.github/workflows/ci-tests-fabric.yml +++ b/.github/workflows/ci-tests-fabric.yml @@ -138,7 +138,7 @@ jobs: # NOTE: do not include coverage report here, see: https://github.c...
Concurrent distributed training runs on a SLURM cluster with `srun` ### Description & Motivation When doing a parameter sweep (HPO), you often want to run multiple training runs concurrently. In our use case, the training runs use the `ddp` strategy (1 node, 4 GPUs) and are executed on a SLURM cluster. We reserve t...
I think this is reasonable request @dcfidalgo. If we are exposing the main address, I suggest also exposing the main port. These should be optional. A PR for this would be very welcomed! I'm not familiar enough with SLURM to comment on whether SLURM_STEP_NODELIST should be auto-detected.
2023-05-09T09:16:44Z
2.4.0
2023-05-11T21:24:06Z
[ "tests/tests_fabric/plugins/environments/test_slurm.py::test_main_address_and_port_from_env_variable" ]
[ "tests/tests_fabric/plugins/environments/test_slurm.py::test_default_attributes", "tests/tests_fabric/plugins/environments/test_slurm.py::test_attributes_from_environment_variables", "tests/tests_fabric/plugins/environments/test_slurm.py::test_main_address_from_slurm_node_list[127.0.0.1-127.0.0.1]", "tests/te...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
5,640
pytorch-lightning__pytorch-lightning-5640
[ "1894" ]
ecd3678a1fdf234ac47dba3b56784a3c7467d83d
diff --git a/docs/source/extensions/callbacks.rst b/docs/source/extensions/callbacks.rst index 1e3b04b65d4cc..b4e45042aca5b 100644 --- a/docs/source/extensions/callbacks.rst +++ b/docs/source/extensions/callbacks.rst @@ -106,6 +106,7 @@ Lightning has a few built-in callbacks. ModelPruning ProgressBar Pro...
diff --git a/tests/callbacks/test_swa.py b/tests/callbacks/test_swa.py new file mode 100644 index 0000000000000..b12e20f1c2a01 --- /dev/null +++ b/tests/callbacks/test_swa.py @@ -0,0 +1,159 @@ +# Copyright The PyTorch Lightning team. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not u...
Add stochastic weight averaging Looks like we need to keep two copies of the model. Let $m_r$ define the root model and $m_c$ the current model. Then at the end of each epoch $n$, we update the weights of $m_r$ using a weighted average: ![image](https://user-images.githubusercontent.com/3640001/82359333-c2974a00-99d...
Isnt SWA already in PyTorch master? https://github.com/pytorch/pytorch/pull/35032 So using `torchcontrib.optim.SWA` is relatively simple. Just wrap it around your base optimizer(s) in the configure_optimizers method. The only tricky part would be that `opt.swap_swa_sgd()` needs to be called at `training_epoch_end`. ...
2021-01-24T21:12:11Z
2.4.0
2021-02-10T23:32:47Z
[ "tests/callbacks/test_swa.py::test_swa_raises" ]
[]
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
19,781
pytorch-lightning__pytorch-lightning-19781
[ "19753" ]
58ad56afece3ea7faec2f1b7f68d90195f316d78
diff --git a/src/lightning/pytorch/trainer/connectors/accelerator_connector.py b/src/lightning/pytorch/trainer/connectors/accelerator_connector.py index 269a1c4c7b754..a191859c06c43 100644 --- a/src/lightning/pytorch/trainer/connectors/accelerator_connector.py +++ b/src/lightning/pytorch/trainer/connectors/accelerator_...
diff --git a/tests/tests_pytorch/strategies/test_fsdp.py b/tests/tests_pytorch/strategies/test_fsdp.py index 751a42b96b42f..413a5e6c9dddd 100644 --- a/tests/tests_pytorch/strategies/test_fsdp.py +++ b/tests/tests_pytorch/strategies/test_fsdp.py @@ -28,7 +28,6 @@ from lightning.pytorch.strategies import FSDPStrategy f...
Unable to extend FSDPStrategy to HPU accelerator ### Bug description We are trying to support FSDP strategy on HPU accelerators. But due to a restriction from accelerator connector, we are unable to use FSDPStrategy on HPU. https://github.com/Lightning-AI/pytorch-lightning/blob/76b691d80c6c5203c66365272ce246ac86e...
@Borda FYA @jyothisambolu Isn't PyTorch's FSDP only compatible with CUDA? Do you have a custom FSDPStrategy? I can't find one in lightning-habana. > @jyothisambolu Isn't PyTorch's FSDP only compatible with CUDA? Do you have a custom FSDPStrategy? I can't find one in lightning-habana. @awaelchli - to push HPUFSDPStr...
2024-04-16T09:52:18Z
2.4.0
2024-04-15T14:16:17Z
[ "tests/tests_pytorch/strategies/test_fsdp.py::test_invalid_on_cpu", "tests/tests_pytorch/trainer/connectors/test_accelerator_connector.py::test_check_fsdp_strategy_and_fallback" ]
[ "tests/tests_pytorch/strategies/test_fsdp.py::test_fsdp_custom_mixed_precision", "tests/tests_pytorch/strategies/test_fsdp.py::test_fsdp_forbidden_precision_raises", "tests/tests_pytorch/strategies/test_fsdp.py::test_fsdp_activation_checkpointing", "tests/tests_pytorch/strategies/test_fsdp.py::test_fsdp_strat...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
19,597
pytorch-lightning__pytorch-lightning-19597
[ "19588" ]
3740546899aedad77c80db6b57f194e68c455e28
diff --git a/src/lightning/pytorch/utilities/model_summary/model_summary.py b/src/lightning/pytorch/utilities/model_summary/model_summary.py index 1d5612736a2ab..ef2827d3b7eed 100644 --- a/src/lightning/pytorch/utilities/model_summary/model_summary.py +++ b/src/lightning/pytorch/utilities/model_summary/model_summary.py...
diff --git a/tests/tests_pytorch/utilities/test_model_summary.py b/tests/tests_pytorch/utilities/test_model_summary.py index c493c5043fa1a..290dfb67faf7d 100644 --- a/tests/tests_pytorch/utilities/test_model_summary.py +++ b/tests/tests_pytorch/utilities/test_model_summary.py @@ -345,11 +345,7 @@ def test_lazy_model_su...
Explicitly report layers with UninitializedParameter in ModelSummary ### Description & Motivation If your model has layers with `torch.nn.parameter.UninitializedParameter`, the parameter count can't be known before `forward()` runs. The model summary will show a lower count in parameters than are used during for...
Thank you for your help on this @awaelchli
2024-03-08T03:28:17Z
2.4.0
2024-03-07T17:22:55Z
[ "tests/tests_pytorch/utilities/test_model_summary.py::test_lazy_model_summary" ]
[ "tests/tests_pytorch/utilities/test_model_summary.py::test_invalid_max_depth", "tests/tests_pytorch/utilities/test_model_summary.py::test_empty_model_summary_shapes[-1]", "tests/tests_pytorch/utilities/test_model_summary.py::test_empty_model_summary_shapes[1]", "tests/tests_pytorch/utilities/test_model_summar...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
16,101
pytorch-lightning__pytorch-lightning-16101
[ "14636" ]
07b775fbe5690b3b932798b2b360a6e049f0b0b1
diff --git a/src/lightning_lite/CHANGELOG.md b/src/lightning_lite/CHANGELOG.md index d331abc41c3ca..7353f226c3541 100644 --- a/src/lightning_lite/CHANGELOG.md +++ b/src/lightning_lite/CHANGELOG.md @@ -34,6 +34,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Merged the implementat...
diff --git a/tests/tests_lite/test_lite.py b/tests/tests_lite/test_lite.py index 28e2c926e7861..3314860e1c9b0 100644 --- a/tests/tests_lite/test_lite.py +++ b/tests/tests_lite/test_lite.py @@ -405,7 +405,46 @@ def test_setup_dataloaders_distributed_sampler_shuffle(): for dataloader in shuffle_dataloaders: ...
Introduce a mechanism to set the epoch on the sampler in LightningLite ## 🚀 Feature We need a mechanism to set the epoch on the distributed sampler via `.set_epoch()`. ### Motivation To correctly handle shuffling with the DistributedSampler in DDP, the PyTorch user would normally call ```py sampler.set_e...
There are two other alternatives: 1. Since we are wrapping the dataloader as `_LiteDataloader` in setup, we could expose `dataloader.set_epoch(int)` 2. We could call `set_epoch` internally in `_LiteDataloader` whenever `__iter__()` is called, and keep a count. I like the option of doing it internally as long as the...
2022-12-17T12:48:58Z
2.4.0
2022-12-19T18:42:47Z
[ "tests/tests_lite/test_lite.py::test_setup_dataloaders_distributed_sampler_shuffle", "tests/tests_lite/test_lite.py::test_setup_dataloaders_distributed_sampler_parity[1-True]", "tests/tests_lite/test_lite.py::test_setup_dataloaders_distributed_sampler_parity[1-False]", "tests/tests_lite/test_lite.py::test_set...
[ "tests/tests_lite/test_lite.py::test_run_input_output", "tests/tests_lite/test_lite.py::test_setup_module[setup]", "tests/tests_lite/test_lite.py::test_setup_module[setup_module]", "tests/tests_lite/test_lite.py::test_setup_module_move_to_device[setup-True-cpu-cpu-cpu]", "tests/tests_lite/test_lite.py::test...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
18,298
pytorch-lightning__pytorch-lightning-18298
[ "16900" ]
6df43685ee2f2dd0c53eefec295e0d6c79796fd2
diff --git a/src/lightning/fabric/strategies/launchers/multiprocessing.py b/src/lightning/fabric/strategies/launchers/multiprocessing.py index ccfb24aa8c3ba..e92853a6a2b20 100644 --- a/src/lightning/fabric/strategies/launchers/multiprocessing.py +++ b/src/lightning/fabric/strategies/launchers/multiprocessing.py @@ -15,...
diff --git a/tests/tests_fabric/strategies/launchers/test_multiprocessing.py b/tests/tests_fabric/strategies/launchers/test_multiprocessing.py index f54226f1174e5..f510f055155dd 100644 --- a/tests/tests_fabric/strategies/launchers/test_multiprocessing.py +++ b/tests/tests_fabric/strategies/launchers/test_multiprocessin...
Better error message when "if name == main" guard is needed ### Description & Motivation When you run with DDP-spawn, and don't add the `if __name__ == "__main__"` guard at the entry point, the user gets this error: ``` RuntimeError: An attempt has been made to start a new process before the c...
2023-08-14T01:28:37Z
2.4.0
2023-08-17T19:30:58Z
[ "tests/tests_fabric/strategies/launchers/test_multiprocessing.py::test_start_method[spawn]", "tests/tests_fabric/strategies/launchers/test_multiprocessing.py::test_restore_globals[spawn]", "tests/tests_fabric/strategies/launchers/test_multiprocessing.py::test_check_for_missing_main_guard", "tests/tests_pytorc...
[ "tests/tests_fabric/strategies/launchers/test_multiprocessing.py::test_interactive_compatible[fork]", "tests/tests_fabric/strategies/launchers/test_multiprocessing.py::test_interactive_compatible[forkserver]", "tests/tests_fabric/strategies/launchers/test_multiprocessing.py::test_forking_on_unsupported_platform...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
17,424
pytorch-lightning__pytorch-lightning-17424
[ "16856" ]
8dac2512733bae034f437334a71e4c114d458a7c
diff --git a/src/lightning/fabric/CHANGELOG.md b/src/lightning/fabric/CHANGELOG.md index 50d4d7e51eb2b..b8ee77888f842 100644 --- a/src/lightning/fabric/CHANGELOG.md +++ b/src/lightning/fabric/CHANGELOG.md @@ -27,6 +27,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added support ...
diff --git a/tests/tests_fabric/test_wrappers.py b/tests/tests_fabric/test_wrappers.py index acd4f41e6e3e9..ac14f5c070507 100644 --- a/tests/tests_fabric/test_wrappers.py +++ b/tests/tests_fabric/test_wrappers.py @@ -16,6 +16,7 @@ import pytest import torch +from lightning_utilities.test.warning import no_warning_c...
Calls to LightningModule's `*_step` methods in Fabric bypasses DDP wrapper ### Bug description In Fabric, we wrap the model in DDP, but all inputs going through the model need to go through forward(). If you call other methods on the module, like `training_step` etc., it bypasses the DDP wrapper. ### How to reproduc...
What I've reported here has now also been seen by a user on Discord: https://discord.com/channels/1077906959069626439/1097919761100316832/1097923294180692090 It is not possible for the user to just know they need to pass everything through forward and so I'll brainstorm a solution for this. One possibility is to wra...
2023-04-20T22:32:29Z
2.4.0
2023-04-19T14:39:00Z
[ "tests/tests_fabric/test_wrappers.py::test_fabric_module_method_lookup", "tests/tests_fabric/test_wrappers.py::test_step_method_redirection" ]
[ "tests/tests_fabric/test_wrappers.py::test_fabric_module_wraps", "tests/tests_fabric/test_wrappers.py::test_fabric_module_attribute_lookup", "tests/tests_fabric/test_wrappers.py::test_fabric_module_state_dict_access", "tests/tests_fabric/test_wrappers.py::test_fabric_module_device_dtype_propagation[dtype0-cpu...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
18,488
pytorch-lightning__pytorch-lightning-18488
[ "18482" ]
501eb2930f68695e0fbe42d97cf4a3f84295e8e9
diff --git a/src/lightning/fabric/CHANGELOG.md b/src/lightning/fabric/CHANGELOG.md index f22873a5cf58e..1da509630bc22 100644 --- a/src/lightning/fabric/CHANGELOG.md +++ b/src/lightning/fabric/CHANGELOG.md @@ -194,6 +194,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed model ...
diff --git a/tests/tests_fabric/test_wrappers.py b/tests/tests_fabric/test_wrappers.py index 1b0f7333db177..b9c0f89bb97be 100644 --- a/tests/tests_fabric/test_wrappers.py +++ b/tests/tests_fabric/test_wrappers.py @@ -362,16 +362,35 @@ def test_fabric_optimizer_wraps(): def test_fabric_optimizer_state_dict(): ""...
Fabric wrappers for optimizers do not load state dict ### Bug description When `load_state_dict()` is called on an optimizer object returned by `fabric.setup(...)`, the resulting `state_dict` will be empty. ### What version are you seeing the problem on? v2.0 ### How to reproduce the bug ```python impor...
Hey @nikvaessen This is very odd, I'll look into it. Btw, in case you didn't know [the recommended way to load in Fabric is](https://lightning.ai/docs/fabric/latest/guide/checkpoint.html#restore-from-a-checkpoint) ```py fabric.load("first_session.ckpt", {"network": network, "opt": opt}) ``` because this genera...
2023-09-05T21:22:10Z
2.4.0
2023-09-05T18:38:02Z
[ "tests/tests_fabric/test_wrappers.py::test_fabric_optimizer_load_state_dict" ]
[ "tests/tests_fabric/test_wrappers.py::test_fabric_module_wraps", "tests/tests_fabric/test_wrappers.py::test_fabric_module_attribute_lookup", "tests/tests_fabric/test_wrappers.py::test_fabric_module_method_lookup", "tests/tests_fabric/test_wrappers.py::test_fabric_module_setattr", "tests/tests_fabric/test_wr...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
5,119
pytorch-lightning__pytorch-lightning-5119
[ "5063" ]
b4d926baf25d1c02e3fdedafee85526b8ee1ea97
diff --git a/pytorch_lightning/trainer/connectors/logger_connector/epoch_result_store.py b/pytorch_lightning/trainer/connectors/logger_connector/epoch_result_store.py index 28025859814cc..6d206f3dd929e 100644 --- a/pytorch_lightning/trainer/connectors/logger_connector/epoch_result_store.py +++ b/pytorch_lightning/train...
diff --git a/tests/trainer/optimization/test_multiple_optimizers.py b/tests/trainer/optimization/test_multiple_optimizers.py new file mode 100644 index 0000000000000..78b6f8f7ff84a --- /dev/null +++ b/tests/trainer/optimization/test_multiple_optimizers.py @@ -0,0 +1,63 @@ +# Copyright The PyTorch Lightning team. +# +# ...
Self.log with multiple Optimizers errors out in 1.1.0 but works in 1.0.8 ## 🐛 Bug self.log results in the following error: ``` File "/opt/conda/lib/python3.6/site-packages/pytorch_lightning/trainer/connectors/logger_connector/epoch_result_store.py", line 207, in auto_reduce_results_on_epoch_end opt_outputs...
@tchaton mind taking a look?
2020-12-14T09:45:33Z
1.1.8
2020-12-16T06:44:30Z
[ "tests/trainer/optimization/test_multiple_optimizers.py::test_unbalanced_logging_with_multiple_optimizers" ]
[]
e8c17551291e61972297c12f2491d7b4e87bf511
manhtdd/pytorch-lightning__pytorch-lightning
18,846
pytorch-lightning__pytorch-lightning-18846
[ "18638" ]
1210deb5a0ff720b0ad66e38149cd28471d760ca
diff --git a/src/lightning/fabric/CHANGELOG.md b/src/lightning/fabric/CHANGELOG.md index 7fbc5d25de23d..d9f37f78b57fe 100644 --- a/src/lightning/fabric/CHANGELOG.md +++ b/src/lightning/fabric/CHANGELOG.md @@ -17,6 +17,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Calling a meth...
diff --git a/tests/tests_fabric/utilities/test_seed.py b/tests/tests_fabric/utilities/test_seed.py index f8f6761ad2e24..f371afe96c3bb 100644 --- a/tests/tests_fabric/utilities/test_seed.py +++ b/tests/tests_fabric/utilities/test_seed.py @@ -4,10 +4,16 @@ import lightning.fabric.utilities import pytest import torch -...
Tutorial DataModule leads to Validation data leakage in Multiprocessing ### 📚 Documentation It is recommended in the docs to do splits in the setup() method & [an example is given](https://pytorch-lightning.readthedocs.io/en/1.7.7/data/datamodule.html?highlight=random_split#what-is-a-datamodule) that does random sp...
IMO if users think this is not clear, the example should be updated to set the generator on the [`random_split` function with a fixed seed](https://pytorch.org/docs/stable/data.html#torch.utils.data.random_split). However, I would like to defend the example in that it is a code snippet that tries to highlight the f...
2023-10-23T23:43:11Z
2.4.0
2023-10-24T16:46:53Z
[ "tests/tests_fabric/utilities/test_seed.py::test_default_seed", "tests/tests_fabric/utilities/test_seed.py::test_invalid_seed", "tests/tests_fabric/utilities/test_seed.py::test_out_of_bounds_seed[10000000000.0]", "tests/tests_fabric/utilities/test_seed.py::test_out_of_bounds_seed[-10000000000.0]" ]
[ "tests/tests_fabric/utilities/test_seed.py::test_correct_seed_with_environment_variable", "tests/tests_fabric/utilities/test_seed.py::test_reset_seed_no_op", "tests/tests_fabric/utilities/test_seed.py::test_reset_seed_everything[True]", "tests/tests_fabric/utilities/test_seed.py::test_reset_seed_everything[Fa...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
5,333
pytorch-lightning__pytorch-lightning-5333
[ "5330" ]
c7d0f4c3a29bd5524e0b66f9196f123b64d1587a
diff --git a/CHANGELOG.md b/CHANGELOG.md index 8af6984ac98ca..5614a07b9da01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,10 +9,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Added - - Added a check for optimizer attached to lr_scheduler ([#5338](https://github.com/P...
diff --git a/tests/callbacks/test_lr_monitor.py b/tests/callbacks/test_lr_monitor.py index d29f254df67d0..39dd821e63dcd 100644 --- a/tests/callbacks/test_lr_monitor.py +++ b/tests/callbacks/test_lr_monitor.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under t...
Logging momentum in LearningRateMonitor ## 🐛 Bug Trying to log momentum in [LearningRateMonitor](https://pytorch-lightning.readthedocs.io/en/stable/generated/pytorch_lightning.callbacks.LearningRateMonitor.html?highlight=LearningRateMonitor) crashes training. When `log_momentum = False`, everything runs smoothly. ...
2021-01-02T16:06:45Z
1.1.8
2021-01-05T06:07:28Z
[ "tests/callbacks/test_lr_monitor.py::test_lr_monitor_no_logger" ]
[ "tests/callbacks/test_lr_monitor.py::test_lr_monitor_no_lr_scheduler", "tests/callbacks/test_lr_monitor.py::test_lr_monitor_custom_name" ]
e8c17551291e61972297c12f2491d7b4e87bf511
manhtdd/pytorch-lightning__pytorch-lightning
16,880
pytorch-lightning__pytorch-lightning-16880
[ "16196" ]
70b257c17fbc4d3f21b732215c1463d1d0d7f59e
diff --git a/src/lightning/fabric/CHANGELOG.md b/src/lightning/fabric/CHANGELOG.md index 5d4e9a1b66f8e..32a28673d8eac 100644 --- a/src/lightning/fabric/CHANGELOG.md +++ b/src/lightning/fabric/CHANGELOG.md @@ -18,6 +18,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added support ...
diff --git a/tests/tests_pytorch/loggers/test_csv.py b/tests/tests_pytorch/loggers/test_csv.py index 4ef856cb634a8..16ca21a7c0916 100644 --- a/tests/tests_pytorch/loggers/test_csv.py +++ b/tests/tests_pytorch/loggers/test_csv.py @@ -14,6 +14,7 @@ import os from unittest.mock import MagicMock +import fsspec import ...
`CSVLogger` fails if `save_dir` is an s3 path ### Bug description Cloud checkpoints are cool! But I also want CSVLogger to periodically write to cloud storage. This doesn't work. Related bug Lightning-AI/pytorch-lightning#16195 . See 'More info' at the bottom of this issue. There are some related issues: http...
Fixed formatting issues in the description. I also have this issue and I noticed an issue that I think is related. When I run my `Trainer` with `default_root_dir=s3:/bucket/path/` I find in my _local_ working directory an `s3:` path! It even has all of the subdirectories added. I happened to have this working in...
2023-02-27T08:16:58Z
2.4.0
2023-03-02T22:17:29Z
[ "tests/tests_pytorch/loggers/test_csv.py::test_csv_logger_remotefs" ]
[ "tests/tests_pytorch/loggers/test_csv.py::test_file_logger_automatic_versioning", "tests/tests_pytorch/loggers/test_csv.py::test_file_logger_manual_versioning", "tests/tests_pytorch/loggers/test_csv.py::test_file_logger_named_version", "tests/tests_pytorch/loggers/test_csv.py::test_file_logger_no_name[]", "...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
16,658
pytorch-lightning__pytorch-lightning-16658
[ "16637" ]
accd2b9e61063ba3c683764043030545ed87c71f
diff --git a/src/lightning/fabric/CHANGELOG.md b/src/lightning/fabric/CHANGELOG.md index 533775bffd632..2c0a9ea43348b 100644 --- a/src/lightning/fabric/CHANGELOG.md +++ b/src/lightning/fabric/CHANGELOG.md @@ -55,6 +55,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed the ba...
diff --git a/tests/tests_fabric/utilities/test_imports.py b/tests/tests_fabric/utilities/test_imports.py index ac3bf4f7e32f5..6f0a3b580a646 100644 --- a/tests/tests_fabric/utilities/test_imports.py +++ b/tests/tests_fabric/utilities/test_imports.py @@ -23,7 +23,14 @@ def test_import_fabric_with_torch_dist_unavailable()...
Cannot import name 'default_pg_timeout' from 'torch.distributed' ### Bug description Hi there, I'm attempting to install PyTorch Lightning on an Apple MacBook Pro with M1 Max Chip. I appeared to successfully install Lightning via: ``` pip install pytorch-lightning ``` However, when I try to actually load t...
Hi @ayushnoori What does `torch.distributed.is_available()` return for you?
2023-02-06T21:51:28Z
2.4.0
2023-02-06T20:54:50Z
[ "tests/tests_fabric/utilities/test_imports.py::test_import_fabric_with_torch_dist_unavailable", "tests/tests_pytorch/utilities/test_imports.py::test_import_pytorch_lightning_with_torch_dist_unavailable" ]
[ "tests/tests_pytorch/utilities/test_imports.py::test_imports", "tests/tests_pytorch/utilities/test_imports.py::test_import_with_unavailable_dependencies[ProcessGroup]", "tests/tests_pytorch/utilities/test_imports.py::test_import_with_unavailable_dependencies[neptune]", "tests/tests_pytorch/utilities/test_impo...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
5,521
pytorch-lightning__pytorch-lightning-5521
[ "5459" ]
a56f745391e64ebeac076529fb79144a54984bc0
diff --git a/CHANGELOG.md b/CHANGELOG.md index 422f2f4385f69..65c086b2b6670 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed a visual bug in the progress bar display initialization ([#4579](https://github.com/PyTorchL...
diff --git a/tests/trainer/optimization/test_multiple_optimizers.py b/tests/trainer/optimization/test_multiple_optimizers.py index 78b6f8f7ff84a..a26accfab106f 100644 --- a/tests/trainer/optimization/test_multiple_optimizers.py +++ b/tests/trainer/optimization/test_multiple_optimizers.py @@ -22,23 +22,18 @@ def test...
[BUG] Logging in a callback does not work with multiple optimizers ## 🐛 Bug #5063 is not solved when logging in callbacks (@tchaton ). Specifically, `self.log` returns the following ```bash File "/usr/local/lib/python3.8/dist-packages/pytorch_lightning/trainer/connectors/logger_connector/epoch_result_store.py"...
@akihironitta please take a look!
2021-01-15T00:57:00Z
1.1.8
2021-01-18T11:05:17Z
[ "tests/trainer/optimization/test_multiple_optimizers.py::test_unbalanced_logging_with_multiple_optimizers" ]
[]
e8c17551291e61972297c12f2491d7b4e87bf511
manhtdd/pytorch-lightning__pytorch-lightning
5,939
pytorch-lightning__pytorch-lightning-5939
[ "5926" ]
fcfa7fabbf75ce6ffb5f23f6a40a184751e87e86
diff --git a/pytorch_lightning/metrics/metric.py b/pytorch_lightning/metrics/metric.py index 2c910edb8e404..ab198356f7279 100644 --- a/pytorch_lightning/metrics/metric.py +++ b/pytorch_lightning/metrics/metric.py @@ -333,7 +333,13 @@ def __hash__(self): hash_vals = [self.__class__.__name__] for key ...
diff --git a/tests/metrics/test_metric.py b/tests/metrics/test_metric.py index 03b79633e3eb7..04c7ce64beed0 100644 --- a/tests/metrics/test_metric.py +++ b/tests/metrics/test_metric.py @@ -154,6 +154,32 @@ def compute(self): assert a.compute() == 5 +def test_hash(): + + class A(Dummy): + pass + + ...
AveragePrecision Broken on Master ## 🐛 Bug On `master` (currently 4857546), the implementation of `__hash__` on PyTorch Lightning metrics causes an exception to be raised for metric implementations which make use of non-hashable state. One such exception is `AveragePrecision`, meaning that any model which uses it i...
2021-02-12T15:09:21Z
2.4.0
2021-02-16T18:01:22Z
[ "tests/metrics/test_metric.py::test_hash" ]
[ "tests/metrics/test_metric.py::test_inherit", "tests/metrics/test_metric.py::test_add_state", "tests/metrics/test_metric.py::test_add_state_persistent", "tests/metrics/test_metric.py::test_reset", "tests/metrics/test_metric.py::test_update", "tests/metrics/test_metric.py::test_compute", "tests/metrics/t...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
9,920
pytorch-lightning__pytorch-lightning-9920
[ "9375" ]
6aeebf1bd301ca81e272193f37ee9c34a88e25bd
diff --git a/CHANGELOG.md b/CHANGELOG.md index efa420bebcd8c..58a8ab471d719 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -195,6 +195,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added `strategy` argument to Trainer ([#8597](https://github.com/PyTorchLightning/pytorch-lightn...
diff --git a/tests/plugins/test_deepspeed_plugin.py b/tests/plugins/test_deepspeed_plugin.py index fad764b896ff3..7c0623323f6f1 100644 --- a/tests/plugins/test_deepspeed_plugin.py +++ b/tests/plugins/test_deepspeed_plugin.py @@ -17,7 +17,8 @@ from pytorch_lightning.plugins import DeepSpeedPlugin, DeepSpeedPrecisionPlu...
[RFC] Simplify sharding API instantiation ## 🚀 Feature <!-- A clear and concise description of the feature proposal --> Currently, the Lightning users working with sharded models and with DeepSpeed or FSDP Plugin needs to know about `configure_sharded_model` as follow: Here is an example. ```py class ...
Hey @ananthsub, @SeanNaren, @yifuwang Any thoughts ? Thanks @tchaton for this! My knowledge around the `meta` device is limited so any additional docs/information/reference PRs would be appreciated. Going off https://pytorch.org/tutorials/prototype/skip_param_init.html#implementation-details I think the goal is ...
2021-10-13T20:33:46Z
2.4.0
2021-10-20T16:21:37Z
[ "tests/plugins/test_deepspeed_plugin.py::test_deepspeed_lightning_module" ]
[]
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
19,771
pytorch-lightning__pytorch-lightning-19771
[ "19772" ]
a611de0c15c4ef0b30d8cc014bbe5f0383b33e27
diff --git a/src/lightning/fabric/CHANGELOG.md b/src/lightning/fabric/CHANGELOG.md index 2ee0243a0d5a5..419b663e55c25 100644 --- a/src/lightning/fabric/CHANGELOG.md +++ b/src/lightning/fabric/CHANGELOG.md @@ -9,6 +9,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Added +- A...
diff --git a/tests/tests_fabric/utilities/test_logger.py b/tests/tests_fabric/utilities/test_logger.py index 33681c65f7fa2..0f6500cb42be1 100644 --- a/tests/tests_fabric/utilities/test_logger.py +++ b/tests/tests_fabric/utilities/test_logger.py @@ -92,7 +92,7 @@ class B: def test_sanitize_callable_params(): - "...
Sanitize object params before they get logged from argument-free classes ### Description & Motivation The motivation for this proposal is as follows: when you store classes (not-yet instantiated, but from the main file) in a module's hyperparameters to instantiate them later, the related entries in the dictionary ar...
2024-04-12T20:05:44Z
2.4.0
2024-06-06T15:02:01Z
[ "tests/tests_fabric/utilities/test_logger.py::test_sanitize_callable_params" ]
[ "tests/tests_fabric/utilities/test_logger.py::test_convert_params", "tests/tests_fabric/utilities/test_logger.py::test_flatten_dict", "tests/tests_fabric/utilities/test_logger.py::test_sanitize_params", "tests/tests_fabric/utilities/test_logger.py::test_add_prefix", "tests/tests_fabric/utilities/test_logger...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
6,024
pytorch-lightning__pytorch-lightning-6024
[ "5932" ]
6cc1a060785448eacd016f6689d592ac822adaaf
diff --git a/pytorch_lightning/utilities/parsing.py b/pytorch_lightning/utilities/parsing.py index 0fba5692b25d1..dd12f34cfe926 100644 --- a/pytorch_lightning/utilities/parsing.py +++ b/pytorch_lightning/utilities/parsing.py @@ -196,9 +196,11 @@ def __repr__(self): return out -def lightning_get_all_attr_ho...
diff --git a/tests/utilities/test_parsing.py b/tests/utilities/test_parsing.py index c07a016eda92d..42edb8e48f336 100644 --- a/tests/utilities/test_parsing.py +++ b/tests/utilities/test_parsing.py @@ -11,6 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the sp...
`lightning_getattr` should raise `AttributeError` ## 🚀 ~Feature~ Enhancement Currently, `lightning_getattr(model, attribute)` raises one of `(ValueError, KeyError, AttributeError` when `attribute` is not found in `model`, but I think it should raise `AttributeError` in all cases since Python built-in `getattr()` only...
makes sense :) same investigation could be done for the setter.
2021-02-17T07:21:18Z
2.4.0
2021-02-18T15:54:12Z
[ "tests/utilities/test_parsing.py::test_lightning_getattr", "tests/utilities/test_parsing.py::test_lightning_setattr" ]
[ "tests/utilities/test_parsing.py::test_lightning_hasattr" ]
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
18,094
pytorch-lightning__pytorch-lightning-18094
[ "17260" ]
7116a9f9bb07193add28bcf15041764575fa5bab
diff --git a/src/lightning/pytorch/CHANGELOG.md b/src/lightning/pytorch/CHANGELOG.md index 9b99be3963663..5d8f9627a2119 100644 --- a/src/lightning/pytorch/CHANGELOG.md +++ b/src/lightning/pytorch/CHANGELOG.md @@ -172,6 +172,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed va...
diff --git a/tests/tests_pytorch/utilities/migration/test_utils.py b/tests/tests_pytorch/utilities/migration/test_utils.py index 9461a348e14c5..730c45f6e8e0e 100644 --- a/tests/tests_pytorch/utilities/migration/test_utils.py +++ b/tests/tests_pytorch/utilities/migration/test_utils.py @@ -42,6 +42,14 @@ def test_patch_l...
AttributeError: module '`pytorch_lightning.utilities.enums`' has no attribute '`_FaultTolerantMode`' ### Bug description The issue occurred when loading the previous checkpoint with `ckpt_path` (`trainer.fit(model, train_dataloaders=data_module.train_dataloader(), val_dataloaders=data_module.val_dataloader(), ckpt_pa...
Correct, this private/protected attribute was removed in 2.0.0 could you pls share full example to reproduce/trace the issue For me, this error occured during loading an older model, which has been trained with earlier version of both `torch` and `pytorch-lightning` (pre 2.0 releases). I have the same issue. has any...
2023-07-17T01:01:41Z
2.4.0
2023-07-17T23:09:38Z
[ "tests/tests_pytorch/utilities/migration/test_utils.py::test_patch_legacy_fault_tolerant_mode" ]
[ "tests/tests_pytorch/utilities/migration/test_utils.py::test_patch_legacy_argparse_utils", "tests/tests_pytorch/utilities/migration/test_utils.py::test_patch_legacy_gpus_arg_default", "tests/tests_pytorch/utilities/migration/test_utils.py::test_migrate_checkpoint", "tests/tests_pytorch/utilities/migration/tes...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
19,639
pytorch-lightning__pytorch-lightning-19639
[ "19710" ]
8947d135d6dd87f170648f9ec90f56b4826b5b11
diff --git a/src/lightning/pytorch/loggers/mlflow.py b/src/lightning/pytorch/loggers/mlflow.py index cf874b6d690bf..4437d5f8a7c76 100644 --- a/src/lightning/pytorch/loggers/mlflow.py +++ b/src/lightning/pytorch/loggers/mlflow.py @@ -42,6 +42,7 @@ log = logging.getLogger(__name__) LOCAL_FILE_URI_PREFIX = "file:" _MLF...
diff --git a/tests/tests_pytorch/loggers/test_mlflow.py b/tests/tests_pytorch/loggers/test_mlflow.py index 372491a34c249..f02cfdb90901a 100644 --- a/tests/tests_pytorch/loggers/test_mlflow.py +++ b/tests/tests_pytorch/loggers/test_mlflow.py @@ -18,7 +18,12 @@ import pytest from lightning.pytorch import Trainer from ...
Expose client argument in `MLFlowLogger` ### Description & Motivation MLflow has an [async autologging client](https://github.com/mlflow/mlflow/blob/2248511d5d86bbd751a0fea4241f78be7bc8f3c8/mlflow/utils/autologging_utils/client.py#L89). It also allows logging metrics asynchronously by passing `synchronous=False` to th...
2024-03-15T20:35:11Z
2.4.0
2024-04-03T21:53:46Z
[ "tests/tests_pytorch/loggers/test_mlflow.py::test_mlflow_logger_exists", "tests/tests_pytorch/loggers/test_mlflow.py::test_mlflow_run_id_setting", "tests/tests_pytorch/loggers/test_mlflow.py::test_mlflow_log_dir", "tests/tests_pytorch/loggers/test_mlflow.py::test_mlflow_experiment_id_retrieved_once", "tests...
[]
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
18,268
pytorch-lightning__pytorch-lightning-18268
[ "18254" ]
70e31b64800a89e91ff46b631670cf8944d10ab9
diff --git a/src/lightning/pytorch/CHANGELOG.md b/src/lightning/pytorch/CHANGELOG.md index fa450ebc6d57f..b5788360ddf5c 100644 --- a/src/lightning/pytorch/CHANGELOG.md +++ b/src/lightning/pytorch/CHANGELOG.md @@ -200,6 +200,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed an...
diff --git a/tests/tests_pytorch/loops/optimization/test_closure.py b/tests/tests_pytorch/loops/optimization/test_closure.py index 5b9e82e47987b..aec77932f85c3 100644 --- a/tests/tests_pytorch/loops/optimization/test_closure.py +++ b/tests/tests_pytorch/loops/optimization/test_closure.py @@ -43,3 +43,31 @@ def step(sel...
"element 0 of tensors does not require grad and does not have a grad_fn" when using AdamW from Hugging Face ### Bug description When attempting to migrate my current model to Lightning, I encountered an error while using the AdamW optimizer provided by Hugging Face's Transformers library during training: "RuntimeError...
maybe related to #18222 Thank you so much for the analysis @0x404, this is very helpful and saves us a lot of time. Your workaround is also good and works in your case, but doesn't support optimizers that require closures. And since it is a feature in Lightning, we can't just remove it. Here is another proposal ...
2023-08-10T01:57:54Z
2.4.0
2023-08-09T21:39:57Z
[ "tests/tests_pytorch/loops/optimization/test_closure.py::test_closure_with_no_grad_optimizer" ]
[ "tests/tests_pytorch/loops/optimization/test_closure.py::test_optimizer_step_no_closure_raises" ]
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
18,122
pytorch-lightning__pytorch-lightning-18122
[ "18008" ]
04e2d800af7afb47ab534290a146514c678f7db6
diff --git a/src/lightning/fabric/CHANGELOG.md b/src/lightning/fabric/CHANGELOG.md index fa9f54410b3b7..46991e1e610c4 100644 --- a/src/lightning/fabric/CHANGELOG.md +++ b/src/lightning/fabric/CHANGELOG.md @@ -40,7 +40,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). * Handles ini...
diff --git a/tests/tests_fabric/strategies/test_fsdp.py b/tests/tests_fabric/strategies/test_fsdp.py index d2838044c36e1..dd782d636f09c 100644 --- a/tests/tests_fabric/strategies/test_fsdp.py +++ b/tests/tests_fabric/strategies/test_fsdp.py @@ -29,7 +29,11 @@ from lightning.fabric import Fabric from lightning.fabric....
Multi-node training with FSDP results in weird behaviour ### Bug description Here is my train script for llama 65b ```import argparse import os import sys import time from functools import partial from pathlib import Path import lightning as L import torch from lightning.fabric.strategies import FSDPStrateg...
I'll take a closer look shortly. Two things to note I see from the code: You are loading the checkpoint directly with torch.load(). If the checkpoint has tensors with cuda device, the tensors will land on the GPU. This could explain why you see GPU 0 memory usage during the setup phase of the script. > When tr...
2023-07-20T01:03:56Z
2.4.0
2023-07-31T20:15:58Z
[ "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_support", "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_custom_mixed_precision", "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_cpu_offload", "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_sharding_strategy", "tests/tests_fabric...
[]
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
5,464
pytorch-lightning__pytorch-lightning-5464
[ "5392" ]
4e7e1dffe8b1284fb93048a499fed0eac2bb12ae
diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f915022be24c..dcc819ff9d04d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,6 +62,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added `PyTorchProfiler` ([#5560](https://github.com/PyTorchLightning/pytorch-lightning/pull/5560))...
diff --git a/tests/metrics/test_composition.py b/tests/metrics/test_composition.py new file mode 100644 index 0000000000000..087dee521d694 --- /dev/null +++ b/tests/metrics/test_composition.py @@ -0,0 +1,485 @@ +from operator import neg, pos + +import pytest +import torch + +from pytorch_lightning.metrics.compositional...
[Metrics] Add Depth Loss ## 🚀 Feature <!-- A clear and concise description of the feature proposal --> Add depth-loss to PT-lighting since image-gradient is being added. As discussed [here](https://github.com/PyTorchLightning/pytorch-lightning/pull/5056#issuecomment-745100976). ### Motivation <!-- Please outli...
@SkafteNicki I am kinda at loss here. The depth loss as defined in the [paper](https://arxiv.org/pdf/1812.11941.pdf), is given as follows, L(y, yˆ) = λL<sub>depth</sub>(y, yˆ) + L<sub>grad</sub>(y, yˆ) + L<sub>SSIM</sub>(y, yˆ) where L<sub>depth</sub> is the L1 pointwise loss between the prediction and the groun...
2021-01-11T16:13:11Z
2.4.0
2021-01-26T13:57:34Z
[ "tests/metrics/test_composition.py::test_metrics_add[second_operand0-expected_result0]", "tests/metrics/test_composition.py::test_metrics_add[2-expected_result1]", "tests/metrics/test_composition.py::test_metrics_add[2.0-expected_result2]", "tests/metrics/test_composition.py::test_metrics_add[second_operand3-...
[]
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
5,670
pytorch-lightning__pytorch-lightning-5670
[ "5506" ]
5d239ccd704c7b639b6e83fdff9460fa9dd5e790
diff --git a/CHANGELOG.md b/CHANGELOG.md index a041defcd0028..f82c6796e808e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -120,6 +120,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Moved accelerators and plugins to its `legacy` pkg ([#5645](https://github.com/PyTorchLightning...
diff --git a/tests/deprecated_api/test_remove_1-4.py b/tests/deprecated_api/test_remove_1-4.py index a4120d77676b5..27af0003beb43 100644 --- a/tests/deprecated_api/test_remove_1-4.py +++ b/tests/deprecated_api/test_remove_1-4.py @@ -18,7 +18,12 @@ import torch from pytorch_lightning import Trainer -from pytorch_lig...
Keeping DP override in sync with upstream torch Same as in #4630, we want to redirect forward to the training_step, validaion_step, test_step methods but without having to copy the DP implementation directly from pytorch codebase. This would also allow users to easily override DP in Lightning. See refactor for DDP h...
2021-01-27T03:34:24Z
2.4.0
2021-01-30T19:55:28Z
[ "tests/deprecated_api/test_remove_1-4.py::test_v1_4_0_deprecated_imports", "tests/deprecated_api/test_remove_1-4.py::test_v1_4_0_deprecated_trainer_device_distrib", "tests/deprecated_api/test_remove_1-4.py::test_v1_4_0_deprecated_metrics", "tests/models/test_restore.py::test_model_properties_resume_from_check...
[]
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
17,005
pytorch-lightning__pytorch-lightning-17005
[ "12736" ]
d7b668eb94b3d224e0e6d1fb396b1f3159d6bcc3
diff --git a/src/lightning/pytorch/CHANGELOG.md b/src/lightning/pytorch/CHANGELOG.md index 4b3aaf256cf88..9d7bda17a0fbe 100644 --- a/src/lightning/pytorch/CHANGELOG.md +++ b/src/lightning/pytorch/CHANGELOG.md @@ -51,6 +51,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added CLI ...
diff --git a/tests/tests_pytorch/utilities/test_model_summary.py b/tests/tests_pytorch/utilities/test_model_summary.py index 2e1f6b33613ee..65b3f8ac8e0ff 100644 --- a/tests/tests_pytorch/utilities/test_model_summary.py +++ b/tests/tests_pytorch/utilities/test_model_summary.py @@ -11,6 +11,7 @@ # WITHOUT WARRANTIES OR ...
ModelSummary ignores nn.Parameter ## 🐛 Bug I don't know if this is a bug of a feature, but currently ModelSummary only reports member `nn.Module`s and ignores `nn.Parameter`s that are directly created. I believe these parameters are an important part (and sometimes, a big part in terms of the number of weights) of ...
Hey @ZhaofengWu Happy to see you find the model summary useful! I looked at this very briefly now. With the following code I get: ```py import torch from pytorch_lightning import LightningModule from pytorch_lightning.utilities.model_summary import ModelSummary class BoringModel(LightningModule): ...
2023-03-09T00:33:18Z
2.4.0
2023-05-08T22:37:30Z
[ "tests/tests_pytorch/utilities/test_model_summary.py::test_invalid_max_depth", "tests/tests_pytorch/utilities/test_model_summary.py::test_empty_model_summary_shapes[-1]", "tests/tests_pytorch/utilities/test_model_summary.py::test_empty_model_summary_shapes[1]", "tests/tests_pytorch/utilities/test_model_summar...
[]
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
5,923
pytorch-lightning__pytorch-lightning-5923
[ "5548" ]
ae19c9723ba2007ea28dd57c4df65eeea41be3ae
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...
diff --git a/tests/trainer/optimization/test_optimizers.py b/tests/trainer/optimization/test_optimizers.py index c9a9250995dd0..7172b2dca76da 100644 --- a/tests/trainer/optimization/test_optimizers.py +++ b/tests/trainer/optimization/test_optimizers.py @@ -459,6 +459,24 @@ def test_unknown_configure_optimizers_raises(t...
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 ...
2021-02-11T15:39:40Z
2.4.0
2021-02-12T17:25:08Z
[ "tests/trainer/optimization/test_optimizers.py::test_lr_scheduler_with_unknown_interval_raises" ]
[ "tests/trainer/optimization/test_optimizers.py::test_reducelronplateau_with_no_monitor_raises", "tests/trainer/optimization/test_optimizers.py::test_reducelronplateau_with_no_monitor_in_lr_scheduler_dict_raises", "tests/trainer/optimization/test_optimizers.py::test_reducelronplateau_scheduling", "tests/traine...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
18,280
pytorch-lightning__pytorch-lightning-18280
[ "18279" ]
b88b8b39370a54785599d7448afcd7f1596f462b
diff --git a/src/lightning/pytorch/CHANGELOG.md b/src/lightning/pytorch/CHANGELOG.md index 9655d7b59ef34..3500fe9303067 100644 --- a/src/lightning/pytorch/CHANGELOG.md +++ b/src/lightning/pytorch/CHANGELOG.md @@ -97,6 +97,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added auto...
diff --git a/tests/tests_pytorch/core/test_lightning_optimizer.py b/tests/tests_pytorch/core/test_lightning_optimizer.py index 3d0ee4d7a9498..f6c2593f3962b 100644 --- a/tests/tests_pytorch/core/test_lightning_optimizer.py +++ b/tests/tests_pytorch/core/test_lightning_optimizer.py @@ -11,6 +11,7 @@ # WITHOUT WARRANTIES...
Trainer's optimizer list and the LightningOptimizers state are not kept in sync when updated ### Bug description We are keeping an inventory of optimizers under the `Trainer.optimizers` list. These are the original optimizers returned by the users in the `configure_optimizers` hook. Internally, we also maintain a list...
2023-08-11T09:53:22Z
2.4.0
2023-08-10T20:58:29Z
[ "tests/tests_pytorch/core/test_lightning_optimizer.py::test_state_mutation" ]
[ "tests/tests_pytorch/core/test_lightning_optimizer.py::test_lightning_optimizer[True]", "tests/tests_pytorch/core/test_lightning_optimizer.py::test_lightning_optimizer[False]", "tests/tests_pytorch/core/test_lightning_optimizer.py::test_lightning_optimizer_manual_optimization_and_accumulated_gradients", "test...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
17,574
pytorch-lightning__pytorch-lightning-17574
[ "13899" ]
76caa81bf24fb8b2dbaa8778f8696253d0b5e399
diff --git a/src/lightning/pytorch/CHANGELOG.md b/src/lightning/pytorch/CHANGELOG.md index cdd2dcd0c4b96..b2e202b9f7309 100644 --- a/src/lightning/pytorch/CHANGELOG.md +++ b/src/lightning/pytorch/CHANGELOG.md @@ -104,6 +104,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed si...
diff --git a/tests/tests_pytorch/loggers/test_wandb.py b/tests/tests_pytorch/loggers/test_wandb.py index bbdae2b0de0df..0446d929a642c 100644 --- a/tests/tests_pytorch/loggers/test_wandb.py +++ b/tests/tests_pytorch/loggers/test_wandb.py @@ -103,10 +103,9 @@ def test_wandb_logger_init(wandb, monkeypatch): wandb.ini...
Avoid duplicate logging of hyperparameters with Wandb ## 🚀 Feature Change the flattening format of the hyperparameter dicts for the WandbLogger, such that it is the same as the one used by wandb for logging its configuration. ### Motivation At the moment, I have the problem that certain hyperparameters are lo...
Hi @remivanbel ! Engineer from W&B here. I think adding a flatten option like this could possibly lead to some unexpected behaviour and might cause changes to other workflows because we would be manually changing the config dict keys. I think for your use case, adding `trainer.logger.experiment.config.update(config)...
2023-05-05T03:25:19Z
2.4.0
2023-05-04T23:21:58Z
[ "tests/tests_pytorch/loggers/test_wandb.py::test_wandb_logger_init" ]
[ "tests/tests_pytorch/loggers/test_wandb.py::test_wandb_project_name", "tests/tests_pytorch/loggers/test_wandb.py::test_wandb_pickle", "tests/tests_pytorch/loggers/test_wandb.py::test_wandb_logger_dirs_creation", "tests/tests_pytorch/loggers/test_wandb.py::test_wandb_log_model", "tests/tests_pytorch/loggers/...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
18,647
pytorch-lightning__pytorch-lightning-18647
[ "18363" ]
ed2c80f517070bfde106503a61c1ee4ad621ccf0
diff --git a/src/lightning/fabric/strategies/fsdp.py b/src/lightning/fabric/strategies/fsdp.py index fc06cad65122f..b4232aa91f23a 100644 --- a/src/lightning/fabric/strategies/fsdp.py +++ b/src/lightning/fabric/strategies/fsdp.py @@ -865,9 +865,13 @@ def _load_raw_module_state_from_path(path: Path, module: Module, world...
diff --git a/tests/tests_fabric/strategies/test_fsdp.py b/tests/tests_fabric/strategies/test_fsdp.py index f9fbd0fdabdc0..030c033d28609 100644 --- a/tests/tests_fabric/strategies/test_fsdp.py +++ b/tests/tests_fabric/strategies/test_fsdp.py @@ -333,6 +333,7 @@ def test_fsdp_load_checkpoint_no_state(tmp_path): @RunIf...
Fabric + FSDP + load_raw before setup edge case ### Bug description A user in an offline discussion demonstrated a PyTorch FSDP key error when calling `fabric.load_raw` before `fabric.setup()` was called on an FSDP model. The key error happened in the `__exit__` of this context manager: https://github.com/Lightni...
```py import lightning as L import torch from lightning.fabric.strategies import FSDPStrategy fabric = L.Fabric(devices=2, strategy="fsdp", precision="bf16-true") fabric.launch() model = torch.nn.Linear(2, 2) torch.save(model.state_dict(), "checkpoint.pt") with fabric.init_module(empty_init=False): ...
2023-09-26T22:27:19Z
2.4.0
2023-09-28T19:26:06Z
[ "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_load_checkpoint_one_fsdp_module_required" ]
[ "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_support", "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_custom_mixed_precision", "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_cpu_offload", "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_sharding_strategy", "tests/tests_fabric...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
20,327
pytorch-lightning__pytorch-lightning-20327
[ "20326" ]
7038b8d41a13bda49b4dd635ad8093032da8518d
diff --git a/src/lightning/pytorch/utilities/data.py b/src/lightning/pytorch/utilities/data.py index 41c5ea86e50fb..b58142b3a4012 100644 --- a/src/lightning/pytorch/utilities/data.py +++ b/src/lightning/pytorch/utilities/data.py @@ -349,7 +349,8 @@ def _is_dataloader_shuffled(dataloader: object) -> bool: if not ha...
diff --git a/tests/tests_pytorch/utilities/test_data.py b/tests/tests_pytorch/utilities/test_data.py index e9c80d95c58a4..d79e9e24383a0 100644 --- a/tests/tests_pytorch/utilities/test_data.py +++ b/tests/tests_pytorch/utilities/test_data.py @@ -12,6 +12,7 @@ from lightning.pytorch.trainer.states import RunningStage f...
Custom Pytorch BatchSampler does not work well with pytorch lightning ### Bug description ## where is the bug❓ **When I use a custom BatchSampler to initialize the DataLoader and use it with pytorch lightning's datamodule**, I find that the shuffle settings don't take effect correctly, as evidenced by the fact that...
2024-10-09T08:46:02Z
2.4.0
2024-11-12T23:24:48Z
[ "tests/tests_pytorch/utilities/test_data.py::test_batch_sampler_shuffle_setting" ]
[ "tests/tests_pytorch/utilities/test_data.py::test_extract_batch_size", "tests/tests_pytorch/utilities/test_data.py::test_has_len_all_rank", "tests/tests_pytorch/utilities/test_data.py::test_update_dataloader_typerror_custom_exception", "tests/tests_pytorch/utilities/test_data.py::test_custom_torch_batch_sampl...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
17,570
pytorch-lightning__pytorch-lightning-17570
[ "17546" ]
e3b5f22e2ebc80a5e2640cc9a30ea6dd2f946d15
diff --git a/src/lightning/fabric/CHANGELOG.md b/src/lightning/fabric/CHANGELOG.md index e51f6d68b1696..4c618a415c42a 100644 --- a/src/lightning/fabric/CHANGELOG.md +++ b/src/lightning/fabric/CHANGELOG.md @@ -42,6 +42,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added support ...
diff --git a/tests/tests_fabric/test_fabric.py b/tests/tests_fabric/test_fabric.py index ce887fbbd0dda..f95f02432ba74 100644 --- a/tests/tests_fabric/test_fabric.py +++ b/tests/tests_fabric/test_fabric.py @@ -76,6 +76,7 @@ def run(self, *args, **kwargs): def test_setup_module(ddp_mock, setup_method): """Test that...
`Fabric` not working with more than 1 GPU device. ### Bug description I'm trying a pretty simple example from `Fabric` on a machine with 8 A100s. I define a `Fabric` object with `devices=2` inside a python session run from a docker container. When I try to set up a model and an optimizer, I get a `RuntimeError: Defaul...
@VolodyaCO For multi-device training, you have to call ```py fabric.launch() ``` to launch and init each process, or use [one of the other ways](https://lightning.ai/docs/fabric/stable/fundamentals/launch.html) to do the same. You can follow the documentation [here](https://lightning.ai/docs/fabric/stable/funda...
2023-05-04T21:47:21Z
2.4.0
2023-05-04T21:11:08Z
[ "tests/tests_fabric/test_fabric.py::test_verify_launch_called" ]
[ "tests/tests_fabric/test_fabric.py::test_run_input_output", "tests/tests_fabric/test_fabric.py::test_setup_module[setup]", "tests/tests_fabric/test_fabric.py::test_setup_module[setup_module]", "tests/tests_fabric/test_fabric.py::test_setup_compiled_module[setup]", "tests/tests_fabric/test_fabric.py::test_se...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
18,092
pytorch-lightning__pytorch-lightning-18092
[ "18074" ]
080eaf38fa9937b2458c4952e8a80ee69abee090
diff --git a/src/lightning/pytorch/CHANGELOG.md b/src/lightning/pytorch/CHANGELOG.md index 86a5dc71989de..0e41b47ba370d 100644 --- a/src/lightning/pytorch/CHANGELOG.md +++ b/src/lightning/pytorch/CHANGELOG.md @@ -163,6 +163,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - `Lightni...
diff --git a/tests/tests_pytorch/trainer/optimization/test_manual_optimization.py b/tests/tests_pytorch/trainer/optimization/test_manual_optimization.py index eac701bf3f4df..9a1e75b5517e6 100644 --- a/tests/tests_pytorch/trainer/optimization/test_manual_optimization.py +++ b/tests/tests_pytorch/trainer/optimization/tes...
Unnecessary scheduler api validation when using manual optimization ### Bug description When using manual optimization, user will take care of calling scheduler. and lightning should not complain if the API is incompatible with PyTorch's `LRScheduler`'s API. However, it currently complains about it. ### What ver...
2023-07-16T23:36:25Z
2.4.0
2023-07-15T16:07:09Z
[ "tests/tests_pytorch/trainer/optimization/test_manual_optimization.py::test_manual_optimization_with_non_pytorch_scheduler[False]" ]
[ "tests/tests_pytorch/trainer/optimization/test_manual_optimization.py::test_multiple_optimizers_manual_call_counts[kwargs0]", "tests/tests_pytorch/trainer/optimization/test_manual_optimization.py::test_multiple_optimizers_manual_log", "tests/tests_pytorch/trainer/optimization/test_manual_optimization.py::test_s...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
5,510
pytorch-lightning__pytorch-lightning-5510
[ "5130" ]
b8d74ef63e30ddcea2397d4671767ce0f47ed95a
diff --git a/CHANGELOG.md b/CHANGELOG.md index 09e99c44dda4f..87943bbbb4ab0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Increased TPU check timeout from 20s to 100s ([#5598](https://github.com/PyTorchLightning/pytorch-...
diff --git a/tests/loggers/test_all.py b/tests/loggers/test_all.py index 4bf15ff8d99a1..5dfb9476011c5 100644 --- a/tests/loggers/test_all.py +++ b/tests/loggers/test_all.py @@ -353,7 +353,7 @@ def test_logger_with_prefix_all(tmpdir, monkeypatch): with mock.patch('pytorch_lightning.loggers.neptune.neptune'): ...
NeptuneObserver raises Neptune.api_exceptions.ChannelsValuesSendBatchError ## 🐛 Bug <!-- A clear and concise description of what the bug is. --> NeptuneObserver throws ``` Failed to send channel value. Traceback (most recent call last): File "/home/wojciech/miniconda3/envs/ml/lib/python3.7/site-packages/ne...
Hi! thanks for your contribution!, great first issue! Any ideas @jakubczakon? Thanks for bringing this up @wjaskowski. @pitercl could you take a look? Hi @wjaskowski! I bumped into a similar issue a while back and from what I remember, PL automatically adds an `epoch` metric with some `global_step` as `x`. From wh...
2021-01-14T09:55:06Z
1.1.8
2021-01-25T12:57:06Z
[ "tests/loggers/test_all.py::test_logger_with_prefix_all", "tests/loggers/test_neptune.py::test_neptune_additional_methods" ]
[ "tests/loggers/test_all.py::test_loggers_fit_test_all", "tests/loggers/test_all.py::test_loggers_save_dir_and_weights_save_path_all", "tests/loggers/test_all.py::test_loggers_pickle_all[TensorBoardLogger]", "tests/loggers/test_all.py::test_logger_reset_correctly[Batch-size-Finder]", "tests/loggers/test_all....
e8c17551291e61972297c12f2491d7b4e87bf511
manhtdd/pytorch-lightning__pytorch-lightning
17,639
pytorch-lightning__pytorch-lightning-17639
[ "17641" ]
cf14d624ae6d6d1770776d108b9ce3fe02e72d78
diff --git a/src/lightning/pytorch/CHANGELOG.md b/src/lightning/pytorch/CHANGELOG.md index 1e3c905b7e1e1..67badc0d4b75b 100644 --- a/src/lightning/pytorch/CHANGELOG.md +++ b/src/lightning/pytorch/CHANGELOG.md @@ -108,6 +108,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Fixe...
diff --git a/tests/tests_pytorch/loops/test_loops.py b/tests/tests_pytorch/loops/test_loops.py index 15efb392a2ba8..e38d4459e2ed3 100644 --- a/tests/tests_pytorch/loops/test_loops.py +++ b/tests/tests_pytorch/loops/test_loops.py @@ -844,8 +844,7 @@ def _get_iterator(self): # iterable check 0, ...
potentially substantial overhead starting all dataloaders in CombinedLoader ### Bug description When training with multiple validation dataloaders, Lightning simultaneously initializes all dataloaders causing each one to initialize a full set of workers and begin prefetching potentially introducing substantial overh...
2023-05-16T00:34:28Z
2.4.0
2023-05-30T00:23:36Z
[ "tests/tests_pytorch/loops/test_loops.py::test_workers_are_shutdown[False-False]", "tests/tests_pytorch/loops/test_loops.py::test_workers_are_shutdown[False-True]", "tests/tests_pytorch/utilities/test_combined_loader.py::test_combined_loader_simultaneous_workers[sequential]" ]
[ "tests/tests_pytorch/loops/test_loops.py::test_restarting_loops_recursive", "tests/tests_pytorch/loops/test_loops.py::test_loop_restore", "tests/tests_pytorch/loops/test_loops.py::test_loop_hierarchy", "tests/tests_pytorch/loops/test_loops.py::test_workers_are_shutdown[True-False]", "tests/tests_pytorch/loo...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
19,601
pytorch-lightning__pytorch-lightning-19601
[ "19594" ]
6cfc590716cbf52e09033ae11ebee10864ef7589
diff --git a/src/lightning/pytorch/CHANGELOG.md b/src/lightning/pytorch/CHANGELOG.md index 4b175d0279567..f400e21536445 100644 --- a/src/lightning/pytorch/CHANGELOG.md +++ b/src/lightning/pytorch/CHANGELOG.md @@ -14,6 +14,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added ro...
diff --git a/tests/tests_pytorch/trainer/test_trainer.py b/tests/tests_pytorch/trainer/test_trainer.py index 612aec11e6d09..565971e1554b1 100644 --- a/tests/tests_pytorch/trainer/test_trainer.py +++ b/tests/tests_pytorch/trainer/test_trainer.py @@ -38,6 +38,7 @@ from lightning.pytorch.callbacks.prediction_writer impor...
Notify LightningDataModule on exception ### Description & Motivation Callbacks have both `teardown` and `on_exception` to gracefully terminate, but `LightningDataModule` does not have `on_exception` and `teardown` is only seem to be called when fit/validate/predict/test finished successfully. ### Pitch Can exception...
Hey @clumsy There are some small inconsistencies in the trainer regarding this yes. This is because the teardown is a very niche hook and not useful for most people, so not much thought has been put there I guess. Since teardown is meant to be roughly the opposite of setup, and in most occasions it is used assum...
2024-03-08T15:14:28Z
2.4.0
2024-03-22T01:56:05Z
[ "tests/tests_pytorch/trainer/test_trainer.py::test_trainer_calls_datamodule_on_exception[KeyboardInterrupt]", "tests/tests_pytorch/trainer/test_trainer.py::test_trainer_calls_datamodule_on_exception[RuntimeError]" ]
[ "tests/tests_pytorch/trainer/test_trainer.py::test_trainer_error_when_input_not_lightning_module", "tests/tests_pytorch/trainer/test_trainer.py::test_gradient_accumulation_scheduling_last_batch[3-1.0]", "tests/tests_pytorch/trainer/test_trainer.py::test_gradient_accumulation_scheduling_last_batch[3-0.8]", "te...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
17,058
pytorch-lightning__pytorch-lightning-17058
[ "11908" ]
c93952cb2cf395d0b805c8249bb457db5f471570
diff --git a/docs/source-pytorch/api_references.rst b/docs/source-pytorch/api_references.rst index 70a42d823600a..58df0cdcef931 100644 --- a/docs/source-pytorch/api_references.rst +++ b/docs/source-pytorch/api_references.rst @@ -42,7 +42,7 @@ callbacks ModelPruning ModelSummary OnExceptionCheckpoint - ...
diff --git a/tests/tests_pytorch/callbacks/progress/test_rich_progress_bar.py b/tests/tests_pytorch/callbacks/progress/test_rich_progress_bar.py index ea87ba508a1ec..27480d6d71865 100644 --- a/tests/tests_pytorch/callbacks/progress/test_rich_progress_bar.py +++ b/tests/tests_pytorch/callbacks/progress/test_rich_progres...
Rename `ProgressBarBase` to `ProgressBar` ## Proposed refactor **Class Names (conform to standard of `Callback`, `Strategy`, `Accelerator`)** * ~~Rename `LightningLoggerBase` to `Logger`~~ * ~~Rename `AbstractProfiler` and `BaseProfiler` to `Profiler`~~ * Rename `ProgressBarBase` to `ProgressBar` **Directory...
I am in favor of this. I propose to go with a longer deprecation than usual as this potentially impacts many import statements in user code. Lightning 2.0? Hi would like to work on this issue. I mean the parts that have not been done yet Hello, I'm a newbie to open source contribution. And I'm interested in this issue....
2023-03-13T13:26:02Z
2.4.0
2023-03-14T01:55:32Z
[ "tests/tests_pytorch/callbacks/progress/test_rich_progress_bar.py::test_rich_progress_bar_callback", "tests/tests_pytorch/callbacks/progress/test_rich_progress_bar.py::test_rich_progress_bar_refresh_rate_enabled", "tests/tests_pytorch/callbacks/progress/test_rich_progress_bar.py::test_rich_progress_bar[dataset0...
[]
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
20,379
pytorch-lightning__pytorch-lightning-20379
[ "14579" ]
61a403a512466d65ebe730b1cc0cf4a909a533f2
diff --git a/src/lightning/pytorch/loops/evaluation_loop.py b/src/lightning/pytorch/loops/evaluation_loop.py index 0ab3901cf072d..78573c45aab76 100644 --- a/src/lightning/pytorch/loops/evaluation_loop.py +++ b/src/lightning/pytorch/loops/evaluation_loop.py @@ -15,6 +15,7 @@ import shutil import sys from collections ...
diff --git a/tests/tests_pytorch/loops/test_loops.py b/tests/tests_pytorch/loops/test_loops.py index ff317cd2e18ba..8d94275b5b245 100644 --- a/tests/tests_pytorch/loops/test_loops.py +++ b/tests/tests_pytorch/loops/test_loops.py @@ -14,7 +14,7 @@ import os from copy import deepcopy from dataclasses import dataclass ...
`TrainingEpochLoop._should_check_val_fx` discrepancy between continued run <> restore from ckpt ## 🐛 Bug Found a discrepancy between a continued run after checkpointing, and restoring from checkpoint ### Observation: **training_batch / val_loop ordering upon checkpoint restoration not the same as original run af...
I'd be happy to help fix if agreed this is a bug, but like the opinion + take on a solution from folks more involved with pytorch lightning. Some simple ideas, but none of them great: - Give the model checkpoint callback a special status compared to others, call it at the end of `training_epoch_loop.on_advance_end` ...
2024-10-31T15:18:18Z
2.4.0
2024-11-12T14:59:08Z
[ "tests/tests_pytorch/loops/test_loops.py::test_loop_state_on_exception[1-1-1]", "tests/tests_pytorch/loops/test_loops.py::test_loop_state_on_exception[1-1-2]", "tests/tests_pytorch/loops/test_loops.py::test_loop_state_on_exception[1-1-3]", "tests/tests_pytorch/loops/test_loops.py::test_loop_state_on_exception...
[ "tests/tests_pytorch/loops/test_loops.py::test_restarting_loops_recursive", "tests/tests_pytorch/loops/test_loops.py::test_loop_restore", "tests/tests_pytorch/loops/test_loops.py::test_loop_hierarchy", "tests/tests_pytorch/loops/test_loops.py::test_loop_restart_progress_multiple_dataloaders[2-0-1-1]", "test...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
17,270
pytorch-lightning__pytorch-lightning-17270
[ "17269" ]
fb775e08550579f931ebcab2fc0cbf9f0d0d6d9c
diff --git a/src/lightning/pytorch/CHANGELOG.md b/src/lightning/pytorch/CHANGELOG.md index 5a9e05ff0c982..a0926a0b565e8 100644 --- a/src/lightning/pytorch/CHANGELOG.md +++ b/src/lightning/pytorch/CHANGELOG.md @@ -27,6 +27,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Disable ...
diff --git a/tests/tests_pytorch/utilities/test_parsing.py b/tests/tests_pytorch/utilities/test_parsing.py index bea31406f97f8..2d165dd29dce7 100644 --- a/tests/tests_pytorch/utilities/test_parsing.py +++ b/tests/tests_pytorch/utilities/test_parsing.py @@ -12,6 +12,7 @@ # See the License for the specific language gove...
TypeError: cannot pickle '_thread.lock' object ### Bug description In PyTorch lightning 1.x, when we are trying to pickle an unpickable object, it will be automatically ignored. However, in lightning 2.0.1, an edge case will trigger `TypeError: cannot pickle '_thread.lock' object` in my use cases. Therefore, adding ...
2023-04-04T00:28:28Z
2.4.0
2023-04-06T20:01:50Z
[ "tests/tests_pytorch/utilities/test_parsing.py::test_is_picklable" ]
[ "tests/tests_pytorch/utilities/test_parsing.py::test_lightning_hasattr", "tests/tests_pytorch/utilities/test_parsing.py::test_lightning_getattr", "tests/tests_pytorch/utilities/test_parsing.py::test_lightning_setattr", "tests/tests_pytorch/utilities/test_parsing.py::test_clean_namespace", "tests/tests_pytor...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
19,513
pytorch-lightning__pytorch-lightning-19513
[ "19454", "19454" ]
0f4522cbde5b65c9f2622973d8e93f1cfab6404c
diff --git a/src/lightning/pytorch/CHANGELOG.md b/src/lightning/pytorch/CHANGELOG.md index b8873f6978a9d..f971b3df00332 100644 --- a/src/lightning/pytorch/CHANGELOG.md +++ b/src/lightning/pytorch/CHANGELOG.md @@ -12,7 +12,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added `l...
diff --git a/tests/tests_pytorch/callbacks/test_timer.py b/tests/tests_pytorch/callbacks/test_timer.py index 98ba3c11eac4b..69f74d1899744 100644 --- a/tests/tests_pytorch/callbacks/test_timer.py +++ b/tests/tests_pytorch/callbacks/test_timer.py @@ -67,6 +67,12 @@ def test_timer_parse_duration(duration, expected): ...
Input validation for Trainer's `min_time` and `max_time` when passed as string ### Description & Motivation The argument to the `Trainer`s min_time is expected to be a string of the form /(\d\d):(\d\d):(\d\d):(\d\d)/. One way in which parsing can fail (simple example: `--min_time 60`) throws an `IndexError` and prov...
@kylebgorman Would you like to contribute this suggestion? > @kylebgorman Would you like to contribute this suggestion? Sure, it seems like a small issue. (I need to clear OSS patches with my employer, but I'll do that now.) @kylebgorman Would you like to contribute this suggestion? > @kylebgorman Would you like to ...
2024-02-22T15:54:41Z
2.4.0
2024-02-23T20:43:41Z
[ "tests/tests_pytorch/callbacks/test_timer.py::test_timer_parse_duration_misconfiguration[6:00:00]", "tests/tests_pytorch/callbacks/test_timer.py::test_timer_parse_duration_misconfiguration[60" ]
[ "tests/tests_pytorch/callbacks/test_timer.py::test_trainer_flag", "tests/tests_pytorch/callbacks/test_timer.py::test_timer_parse_duration[None-None]", "tests/tests_pytorch/callbacks/test_timer.py::test_timer_parse_duration[00:00:00:22-expected1]", "tests/tests_pytorch/callbacks/test_timer.py::test_timer_parse...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
5,983
pytorch-lightning__pytorch-lightning-5983
[ "5723" ]
15d67887515a81de39e224b81fce28ac03cef8c8
diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ab18a66d37f5..3d4eeddb5b6ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -291,6 +291,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed passing wrong strings for scheduler interval doesn't throw an error ([#5923](https://githu...
diff --git a/tests/core/test_lightning_module.py b/tests/core/test_lightning_module.py index a63f4107a63fe..17449b96d7cab 100644 --- a/tests/core/test_lightning_module.py +++ b/tests/core/test_lightning_module.py @@ -385,7 +385,9 @@ def optimizer_step( optimizer.step(closure=closure) def trainin...
Wrong `requires_grad` state after `return None` with multiple optimizers ## 🐛 Bug When I use multiple optimizers, I cannot use `return None` to skip one step, since it would cause error. I found that it was because `requires_grad` property of the corresponding network is not set to `True`. For instance, with tw...
Mind submitting a fix for this?
2021-02-15T14:33:59Z
2.4.0
2021-02-17T19:14:59Z
[ "tests/core/test_lightning_module.py::test_toggle_untoggle_3_optimizers_shared_parameters" ]
[ "tests/core/test_lightning_module.py::test_property_current_epoch", "tests/core/test_lightning_module.py::test_property_global_step", "tests/core/test_lightning_module.py::test_property_global_rank", "tests/core/test_lightning_module.py::test_property_local_rank", "tests/core/test_lightning_module.py::test_...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
18,235
pytorch-lightning__pytorch-lightning-18235
[ "18228" ]
27d9125a5dd714481996c3d37c7874fc6f3f2d74
diff --git a/src/lightning/fabric/CHANGELOG.md b/src/lightning/fabric/CHANGELOG.md index 4465f978887ec..4f2c3e349eca3 100644 --- a/src/lightning/fabric/CHANGELOG.md +++ b/src/lightning/fabric/CHANGELOG.md @@ -192,6 +192,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed an iss...
diff --git a/tests/tests_fabric/utilities/test_distributed.py b/tests/tests_fabric/utilities/test_distributed.py index e6259f5d21dba..49b47bf54407d 100644 --- a/tests/tests_fabric/utilities/test_distributed.py +++ b/tests/tests_fabric/utilities/test_distributed.py @@ -7,7 +7,7 @@ from lightning.fabric.plugins.environm...
`Fabric.all_reduce` modifies the input value inplace on GPU ### Bug description When calling `Fabric.all_reduce` on tensors on GPU, it will modify the input value to the sum of all values across processes.. ### What version are you seeing the problem on? v2.0 ### How to reproduce the bug Run the followin...
Hey @function2-llx This is the default behavior in torch, see here how we call it under the hood: https://github.com/Lightning-AI/lightning/blob/0aeeb60566cc0375df3cf1a4458592651f143717/src/lightning/fabric/utilities/distributed.py#L149 Here are the docs for PyTorch's all_reduce: https://pytorch.org/docs/stabl...
2023-08-05T17:23:56Z
2.4.0
2023-08-09T15:42:55Z
[ "tests/tests_fabric/utilities/test_distributed.py::test_collective_operations[devices1-_test_all_reduce]" ]
[ "tests/tests_fabric/utilities/test_distributed.py::test_collective_operations[devices1-_test_all_gather_uneven_tensors_multidim]", "tests/tests_fabric/utilities/test_distributed.py::test_collective_operations[devices1-_test_all_gather_uneven_tensors]", "tests/tests_pytorch/core/test_metric_result_integration.py...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
17,305
pytorch-lightning__pytorch-lightning-17305
[ "17249" ]
fd4697c62c059fc7b9946e84d91625ecb6efdbe5
diff --git a/src/lightning/fabric/CHANGELOG.md b/src/lightning/fabric/CHANGELOG.md index e4de85c799f41..dbd8193193385 100644 --- a/src/lightning/fabric/CHANGELOG.md +++ b/src/lightning/fabric/CHANGELOG.md @@ -9,7 +9,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Added -- +...
diff --git a/tests/tests_fabric/helpers/models.py b/tests/tests_fabric/helpers/models.py index bc40401d09a6d..b6ea513d95ef2 100644 --- a/tests/tests_fabric/helpers/models.py +++ b/tests/tests_fabric/helpers/models.py @@ -8,7 +8,6 @@ from torch.utils.data import DataLoader, Dataset, IterableDataset from lightning.fa...
Support combined setup of model and optimizer in Fabric for FSDP through `use_orig_params` ### Description & Motivation Currently, Fabric users who need FSDP have to setup their model and optimizer separately like so: ```py model = fabric.setup_module(model) # access params after wrapping optimizer = Adam(model....
2023-04-08T15:20:51Z
2.4.0
2023-04-06T22:20:52Z
[ "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_setup_optimizer_validation[False]", "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_setup_optimizer_validation[True]", "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_setup_use_orig_params" ]
[ "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_support", "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_custom_mixed_precision", "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_cpu_offload", "tests/tests_fabric/strategies/test_fsdp.py::test_fsdp_no_backward_sync", "tests/tests_fabric/...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
18,744
pytorch-lightning__pytorch-lightning-18744
[ "18723" ]
acc0cf02cf0fa5908517eb86bb004bca0e37247d
diff --git a/docs/source-fabric/api/utilities.rst b/docs/source-fabric/api/utilities.rst index 85cb511e86731..c8124e2870586 100644 --- a/docs/source-fabric/api/utilities.rst +++ b/docs/source-fabric/api/utilities.rst @@ -13,3 +13,5 @@ lightning.fabric.utilities .. autofunction:: lightning.fabric.utilities.data.suggest...
diff --git a/tests/tests_fabric/utilities/test_warnings.py b/tests/tests_fabric/utilities/test_warnings.py index a908d9b3c9e60..fcf69be1a46f1 100644 --- a/tests/tests_fabric/utilities/test_warnings.py +++ b/tests/tests_fabric/utilities/test_warnings.py @@ -16,15 +16,26 @@ Needs to be run outside of `pytest` as it capt...
Troublesome recommendation on num_workers ### Bug description I struggle with this warning (multiplied 512 times on 512 gpus): ``` pytorch_lightning/trainer/connectors/data_connector.py:442: PossibleUserWarning: The dataloader, val_dataloader, does not have many workers which may be a bottleneck. Consider in...
Hey @stas00 Does this one #18591 help? If you want, we can think about incorporating the main process as well so that the total number of workers + main processes are no more than CPU cores available. I think it would be a reasonable improvement. I don't think that the situation is as alarming as you word it. M...
2023-10-08T00:18:06Z
2.4.0
2023-10-10T02:17:47Z
[ "tests/tests_fabric/utilities/test_warnings.py::test_is_path_in_lightning", "tests/tests_fabric/utilities/test_warnings.py::test_disable_possible_user_warnings", "tests/tests_fabric/utilities/test_warnings.py::test_disable_possible_user_warnings_from_environment[0]", "tests/tests_fabric/utilities/test_warning...
[]
20d19d2f5728f7049272f2db77a9748ff4cf5ccd
manhtdd/pytorch-lightning__pytorch-lightning
18,191
pytorch-lightning__pytorch-lightning-18191
[ "18106" ]
5694e68befe559a7edbb7cf22c8aeab45ed3e7fe
diff --git a/src/lightning/fabric/CHANGELOG.md b/src/lightning/fabric/CHANGELOG.md index fa9f54410b3b7..155d0dd8521e2 100644 --- a/src/lightning/fabric/CHANGELOG.md +++ b/src/lightning/fabric/CHANGELOG.md @@ -123,6 +123,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Disabled the...
diff --git a/tests/tests_fabric/test_fabric.py b/tests/tests_fabric/test_fabric.py index b08ea071003d0..d8867694e7955 100644 --- a/tests/tests_fabric/test_fabric.py +++ b/tests/tests_fabric/test_fabric.py @@ -336,12 +336,22 @@ def run(_): def test_setup_dataloaders_raises_for_unknown_custom_args(): """Test that a...
Don't re-instantiate the dataloader if the sampler is not changed to distributed sampler ### Description & Motivation I'm trying to use a custom batch sampler. ### Pitch As #18023 discusses, it will fail during the re-instantiation of the dataloader and batch sampler. ### Alternatives When user provides a custo...
@function2-llx Thank you for opening the ticket. The intention here was that the user would have to set `use_distributed_sampler=False` explicitly if they want to have a custom sampler. But even if set to False, we still re-instantiate the dataloader, which shouldn't be necessary. I think the logic should rathe...
2023-07-30T21:32:36Z
2.4.0
2023-08-01T17:57:25Z
[ "tests/tests_fabric/test_fabric.py::test_setup_dataloaders_raises_for_unknown_custom_args", "tests/tests_fabric/test_fabric.py::test_setup_dataloaders_distributed_sampler_not_needed" ]
[ "tests/tests_fabric/test_fabric.py::test_run_input_output", "tests/tests_fabric/test_fabric.py::test_setup_module[setup]", "tests/tests_fabric/test_fabric.py::test_setup_module[setup_module]", "tests/tests_fabric/test_fabric.py::test_setup_compiled_module[setup]", "tests/tests_fabric/test_fabric.py::test_se...
20d19d2f5728f7049272f2db77a9748ff4cf5ccd