pytorch/test
Antonio Kim 765b6a8fab Fix SequentialLR initialization (#72856)
What was happening is that when we have multiple learning rate schedulers, the order in which they are being initialized is not being taken into account. This is a problem if they were being initialized in sequential order (as one might intuitively do).

Each scheduler calls `step()` on initialization and sets the `lr` in its optimizer's `params_groups`. However, this means that step 0 will be using the `lr` that was set by the very last scheduler (in the case of initializing schedulers sequentially) instead of the first scheduler.

The fix in this PR, addresses the above bug by performing a call to the appropriate scheduler on initialization after decrementing the `last_epoch` values in order to keep them the same post-step. This will ensure that the correct scheduler is the one setting the `lr` values for the optimizer's `param_groups`
Pull Request resolved: https://github.com/pytorch/pytorch/pull/72856
Approved by: https://github.com/jbschlosser
2022-06-21 20:21:13 +00:00
..
ao/sparsity Fixing AO tests 2022-06-20 16:35:49 +00:00
autograd Fix autograd.functional tests to not fail with logging tensor 2022-04-20 20:32:40 +00:00
benchmark_utils
bottleneck_test
cpp Revert "Revert "Put symint overloads on a different name"" (#79680) 2022-06-21 07:06:33 +00:00
cpp_api_parity
cpp_extensions Allow relocatable device code linking in pytorch CUDA extensions (#78225) 2022-06-02 21:35:56 +00:00
custom_backend [ROCM] Enable custom tests on rocm 2022-04-26 14:22:14 +00:00
custom_operator set data permits requires_grad=True on integer tensor 2022-06-01 15:56:32 +00:00
distributed [CheckpointWrapper] Replace generic mod prefix (#79830) 2022-06-21 16:01:59 +00:00
distributions Add mode property to distributions. (#76690) 2022-05-11 18:26:56 +00:00
error_messages
expect Fix sparse BSR tensor validation. 2022-05-27 13:26:35 +00:00
forward_backward_compatibility Make l1_loss composite 2022-06-20 19:10:54 +00:00
fx Back out "Back out "[const_fold] Set requires_grad based on the folded tensor; add device_for_folding option"" (#79696) 2022-06-18 19:13:49 +00:00
jit [JIT] Add basic aliasing checks for tensor inputs 2022-06-17 19:51:51 +00:00
jit_hooks [ROCM] Enable custom tests on rocm 2022-04-26 14:22:14 +00:00
lazy Wconstab/reland pysymint (#79795) 2022-06-20 22:55:06 +00:00
mobile [ci] don't explicitly set CUSTOM_TEST_ARTIFACT_BUILD_DIR 2022-06-13 16:09:50 +00:00
onnx [onnx] have all classes that call setUp inherit from common_utils.setUp (#79543) 2022-06-20 22:29:25 +00:00
package [codemod][usort] apply import merging for fbcode (1 of 11) (#78973) 2022-06-06 23:44:28 +00:00
quantization [ao] Adding model report detector base class and implemented detectors 2022-06-21 00:21:50 +00:00
scripts
test_img
typing
allowlist_for_publicAPI.json [Quant][fx][bc-breaking] Replace *custom_config_dict with config objects 2022-06-16 17:50:07 +00:00
create_dummy_torchscript_model.py Add test for FC/BC for torchscript file. 2022-04-13 23:23:13 +00:00
defs.bzl Add all bzl files per D36874458 2022-06-06 09:40:19 -07:00
delete.py
HowToWriteTestsUsingFileCheck.md
linear.py
load_torchscript_model.py Add test for FC/BC for torchscript file. 2022-04-13 23:23:13 +00:00
run_test.py Fix code that triggers BytesWarning (#79868) 2022-06-21 01:12:21 +00:00
simulate_nccl_errors.py
test_ao_sparsity.py [ao][sparsity] L1 norm based block data sparsifier 2022-06-16 17:43:22 +00:00
test_autocast.py Update operator list for AutocastCPU (#68725) 2022-05-11 17:28:35 +00:00
test_autograd.py Fix forward AD copy_ into same-sized tensor without fw grad 2022-06-17 18:55:32 +00:00
test_binary_ufuncs.py Don't check overflow for scalar arg in comparison ops (#78881) 2022-06-05 01:43:51 +00:00
test_bundled_images.py
test_bundled_inputs.py
test_complex.py
test_cpp_api_parity.py
test_cpp_extensions_aot.py Allow relocatable device code linking in pytorch CUDA extensions (#78225) 2022-06-02 21:35:56 +00:00
test_cpp_extensions_jit.py Remove breakpad dependency 2022-05-03 20:21:55 +00:00
test_cuda.py increase sleep for TestCuda.test_caching_pinned_memory_multi_gpu (#76601) 2022-06-14 21:10:35 +00:00
test_cuda_primary_ctx.py
test_dataloader.py Support percentages in random_split (#78877) 2022-06-16 02:00:25 +00:00
test_datapipe.py [DataPipe] Adding functional API for FileLister (#78419) 2022-06-06 17:26:19 +00:00
test_decomp.py Reference implementations for rsqrt and native_layer_norm (#79413) 2022-06-17 07:24:02 +00:00
test_deploy.py
test_determination.py
test_dispatch.py Make string serialization of C++ FunctionSchema consistent with torchgen.model.FunctionSchema 2022-05-24 19:39:26 +00:00
test_dynamic_shapes.py Wconstab/reland pysymint (#79795) 2022-06-20 22:55:06 +00:00
test_expanded_weights.py expanded weights: instance norm faster rule 2022-04-19 19:40:09 +00:00
test_fake_tensor.py Add support for a couple ops 2022-06-20 22:25:39 +00:00
test_foreach.py
test_function_schema.py Expose is_out to python 2022-06-01 07:39:24 +00:00
test_functional_autograd_benchmark.py
test_functional_optim.py
test_functionalization.py add a new alias key for functional to view op decompositions 2022-06-15 23:18:09 +00:00
test_futures.py
test_fx.py Add Dropout1d module 2022-06-15 14:39:07 +00:00
test_fx_experimental.py Ported proxy tensor tests over to core (#78890) 2022-06-07 00:28:53 +00:00
test_hub.py torch.hub security improvement: add new trust_repo parameter 2022-04-05 09:29:25 +00:00
test_import_stats.py Revert "Revert "[ci] remove remaining RDS dependency"" 2022-06-15 10:04:13 -07:00
test_indexing.py fix set item to scalar tensor missing gradient info 2022-05-25 21:22:44 +00:00
test_jit.py Revert "Enable dim=None for torch.sum (#75845)" 2022-06-16 22:01:41 +00:00
test_jit_autocast.py Conv BN folding data type issue when conv has no bias (#78241) 2022-05-26 18:42:17 +00:00
test_jit_cuda_fuser.py Add OpInfo for torch.equal and fix support for non-standard bools 2022-06-20 23:48:39 +00:00
test_jit_disabled.py
test_jit_fuser.py
test_jit_fuser_legacy.py
test_jit_fuser_te.py Add OpInfo for torch.equal and fix support for non-standard bools 2022-06-20 23:48:39 +00:00
test_jit_legacy.py Remove mentions of non-existing test_jit_py3 (#78977) 2022-06-07 02:28:45 +00:00
test_jit_llga_fuser.py [Reland take-2] Add JIT graph fuser for oneDNN Graph API (v0.5) 2022-05-05 16:57:03 +00:00
test_jit_profiling.py Remove mentions of non-existing test_jit_py3 (#78977) 2022-06-07 02:28:45 +00:00
test_jit_simple.py Remove mentions of non-existing test_jit_py3 (#78977) 2022-06-07 02:28:45 +00:00
test_jit_string.py
test_jiterator.py Python Jiterator supports multiple outputs (#78139) 2022-05-24 21:52:56 +00:00
test_kernel_launch_checks.py
test_license.py
test_linalg.py Port linalg_eigh and linalg_eigvalsh to structured 2022-06-14 20:17:01 +00:00
test_logging.py
test_masked.py Use scatter_reduce to support masked reductions on sparse COO tensors (sum, prod, amin, amax) 2022-05-06 15:40:22 +00:00
test_meta.py fix logical_not reland issues 2022-06-21 03:41:18 +00:00
test_metal.py
test_mkldnn.py Enable fp32/bf16 PRelu forward and backward in MkldnnCPU path (#60427) 2022-05-10 17:29:11 +00:00
test_mobile_optimizer.py
test_model_dump.py
test_module_init.py Add Dropout1d module 2022-06-15 14:39:07 +00:00
test_modules.py Support both train / eval modes for ModuleInfo 2022-06-09 20:57:17 +00:00
test_monitor.py
test_mps.py MPS: Add amax and amin Ops with tests (#79682) 2022-06-18 00:14:05 +00:00
test_multiprocessing.py Fix MPS interaction with autograd engine 2022-05-17 21:26:16 +00:00
test_multiprocessing_spawn.py
test_namedtensor.py Revert "Enable dim=None for torch.sum (#75845)" 2022-06-16 22:01:41 +00:00
test_namedtuple_return_api.py Port linalg_eigh and linalg_eigvalsh to structured 2022-06-14 20:17:01 +00:00
test_native_functions.py
test_native_mha.py [PyTorch] Round T up to next multiple of 8 in NestedTensor case 2022-05-25 20:34:19 +00:00
test_nestedtensor.py Add factory function derivatives (#79872) 2022-06-21 00:53:11 +00:00
test_nn.py Fix code that triggers BytesWarning (#79868) 2022-06-21 01:12:21 +00:00
test_nnapi.py
test_numba_integration.py
test_numpy_interop.py ENH: Add a force argument to numpy() (#78564) 2022-06-06 14:14:17 +00:00
test_openmp.py
test_ops.py Add option for allowing non-fake inputs, add deepcopy impl 2022-06-17 19:36:26 +00:00
test_ops_gradients.py Various OpInfo architecture improvements 2022-04-18 21:55:32 +00:00
test_ops_jit.py Minor fix in jit tests to pass TorchDynamo (#79903) 2022-06-21 00:42:02 +00:00
test_optim.py Fix SequentialLR initialization (#72856) 2022-06-21 20:21:13 +00:00
test_overrides.py add utils for checking that all modes are in the same scope and finding the outermost mode 2022-06-10 19:31:05 +00:00
test_package.py
test_per_overload_api.py
test_prims.py make refs executor handle kwargs (#79858) 2022-06-21 18:53:15 +00:00
test_profiler.py [PyTorch] Record Sequence Number to Match Forward and Backward Operators (2nd try) (#79753) 2022-06-20 16:30:16 +00:00
test_profiler_tree.py move tree tests to the start of test_profiler.py 2022-06-12 04:24:30 +00:00
test_proxy_tensor.py Add OpInfo for torch.equal and fix support for non-standard bools 2022-06-20 23:48:39 +00:00
test_pruning_op.py
test_public_bindings.py Wconstab/reland pysymint (#79795) 2022-06-20 22:55:06 +00:00
test_python_dispatch.py disable modes during constructor 2022-06-17 22:28:27 +00:00
test_pytree.py Register torch.return_types.* as pytree nodes 2022-04-19 13:46:20 +00:00
test_quantization.py [ao] Added function to inform dynamic vs static appropriate 2022-06-15 02:51:27 +00:00
test_reductions.py Add complex_to_float option in ReductionOpInfo 2022-06-01 09:31:45 +00:00
test_scatter_gather_ops.py fix gather sparse_grad backward crash with empty index tensor 2022-06-04 02:25:05 +00:00
test_segment_reductions.py reland Add offsets-based reduction to segment_reduce (CPU, CUDA) 2022-06-17 15:49:31 +00:00
test_serialization.py Make sure requires_grad is propagated for all backend 2022-04-25 19:31:24 +00:00
test_set_default_mobile_cpu_allocator.py
test_shape_ops.py
test_show_pickle.py
test_sort_and_select.py MAINT: Harmonize argsort params with array_api (#75162) 2022-06-09 12:32:01 +00:00
test_sparse.py index_select for COO CUDA tensors. (#77551) 2022-06-01 17:39:03 +00:00
test_sparse_csr.py optimize to_dense for CSC (#79635) 2022-06-21 16:52:16 +00:00
test_spectral_ops.py [complex32] fft support (cuda only) (#74857) 2022-05-12 04:28:55 +00:00
test_stateless.py Added setattr to functional_call. (#77137) 2022-05-17 05:40:46 +00:00
test_static_runtime.py [Static Runtime] Added nested prim::fork and aten::wait test case (#79746) 2022-06-20 16:32:17 +00:00
test_subclass.py Throw a nice error when SubTensor.__torch_dispatch__() returns the wrong type for detach() 2022-05-18 20:00:42 +00:00
test_tensor_creation_ops.py Add BFloat16 support for GLU, and randperm operators on CPU (#61944) 2022-05-12 17:41:57 +00:00
test_tensorboard.py [tensorboard] update assertion error for scalar() and fix docs (#76859) 2022-06-16 05:24:20 +00:00
test_tensorexpr.py [NNC] channels last propagation within NNC fusion group (#76948) 2022-05-30 18:31:49 +00:00
test_tensorexpr_pybind.py [NNC] Lowering function generates the output buffer with the specified stride (#76529) 2022-05-04 20:04:22 +00:00
test_testing.py [ci] remove IN_CI env var 2022-06-11 17:16:30 +00:00
test_throughput_benchmark.py
test_torch.py Fix code that triggers BytesWarning (#79868) 2022-06-21 01:12:21 +00:00
test_transformers.py Add test for torchscripting nn.TransformerEncoder, including fast path (#79796) 2022-06-17 22:00:49 +00:00
test_type_hints.py
test_type_info.py ENH: Convert finfo.tiny to finfo.smallest_normal (#76292) 2022-05-20 00:59:48 +00:00
test_type_promotion.py [fix] complex type promotion (#77524) 2022-05-20 10:23:56 +00:00
test_typing.py
test_unary_ufuncs.py update signbit docs and add -0. to reference testing for unary and binary functions. (#78349) 2022-06-06 13:48:08 +00:00
test_utils.py To add hipify_torch as a submodule in pytorch/third_party (#74704) 2022-06-21 18:56:49 +00:00
test_view_ops.py [primTorch] Adds broadcast_shapes reference (#78612) 2022-06-02 08:56:37 +00:00
test_vmap.py
test_vulkan.py
test_xnnpack_integration.py