Repository: pytorch
Issue: Why there’s a line `scheduler.step(0)` in the code of class `SequentialLR`? 
Labels: module: optimizer,triaged,needs research,actionable

### 🐛 Describe the bug

I was using a `SequentialLR` to adjust my learning rate in the training process. However, a warning appeared:
```
UserWarning: The epoch parameter in `scheduler.step()` was not necessary
and is being deprecated where possible. Please use `scheduler.step()` to 
step the scheduler. During the deprecation, if epoch is different from None, 
the closed form is used instead of the new chainable form, where available. 
Please open an issue if you are unable to replicate your use case: 
https://github.com/pytorch/pytorch/issues/new/choose.
warnings.warn(EPOCH_DEPRECATION_WARNING, UserWarning)
```
I checked my code and there was nothing like `scheduler.step(epoch)`. After debugging, I found the problem was in `torch\optim\lr_scheduler.py`. The line `scheduler.step(0)` in `SequentialLR.step` caused the warning.
```
def step(self):
    self.last_epoch += 1
    idx = bisect_right(self._milestones, self.last_epoch)
    scheduler = self._schedulers[idx]
    if idx > 0 and self._milestones[idx - 1] == self.last_epoch:
        scheduler.step(0)
    else:
        scheduler.step()

    self._last_lr = scheduler.get_last_lr()
```
I wonder why there's a line `scheduler.step(0)` in `SequentialLR`. After all, the `epoch` parameter should be deprecated.

### Versions

PyTorch version: 2.1.1+cu118
Is debug build: False
CUDA used to build PyTorch: 11.8
ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.3 LTS (x86_64)
GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Clang version: Could not collect
CMake version: version 3.16.3
Libc version: glibc-2.31

Python version: 3.10.12 (main, Jul  5 2023, 18:54:27) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.4.0-153-generic-x86_64-with-glibc2.31
Is CUDA available: True
CUDA runtime version: 11.8.89
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 4090
Nvidia driver version: 535.98
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.9.0
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                   40 bits physical, 57 bits virtual
CPU(s):                          124
On-line CPU(s) list:             0-123
Thread(s) per core:              1
Core(s) per socket:              124
Socket(s):                       1
NUMA node(s):                    1
Vendor ID:                       GenuineIntel
CPU family:                      6
Model:                           106
Model name:                      Intel(R) Xeon(R) Platinum 8352V CPU @ 2.10GHz
Stepping:                        6
CPU MHz:                         2099.998
BogoMIPS:                        4199.99
Virtualization:                  VT-x
Hypervisor vendor:               Microsoft
Virtualization type:             full
L1d cache:                       3.9 MiB
L1i cache:                       3.9 MiB
L2 cache:                        496 MiB
L3 cache:                        16 MiB
NUMA node0 CPU(s):               0-123
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Mmio stale data:   Vulnerable: Clear CPU buffers attempted, no microcode; SMT Host state unknown
Vulnerability Retbleed:          Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Mitigation; TSX disabled
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl xtopology cpuid tsc_known_freq pni pclmulqdq vmx ssse3 fma cx16 pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves wbnoinvd arat avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid md_clear arch_capabilities

Versions of relevant libraries:
[pip3] numpy==1.25.2
[pip3] torch==2.1.1+cu118
[pip3] torchaudio==2.1.1+cu118
[pip3] torchvision==0.16.1+cu118
[pip3] triton==2.1.0
[conda] numpy                     1.25.2                   pypi_0    pypi
[conda] torch                     2.1.1+cu118              pypi_0    pypi
[conda] torchaudio                2.1.1+cu118              pypi_0    pypi
[conda] torchvision               0.16.1+cu118             pypi_0    pypi
[conda] triton                    2.1.0                    pypi_0    pypi

cc @vincentqb @jbschlosser @albanD @janeyx99 @crcrpar