Returning None in training_step generates an error
🐛 Bug
When returning None in training_step I get an error.  I need to skip some batches, as I do some processing in the collate function, and sometimes I need to ignore the entire batch. Thus, from the collator I return None, and in my training_step i have :
    def training_step(self, batch, batch_idx):
        if batch is None:
            return None

however, as soon as this fires, I get KeyError: 'training_step_output_for_epoch_end':
Epoch 0:  45%|█████████████████████████████████████████████████████████████████████▌                                                                                      | 1084/2431 [05:59<07:26,  3.02it/s, loss=0.0128, v_num=77]
Traceback (most recent call last):
  File "/home/echo/p3.8-test/lib/python3.8/site-packages/pytorch_lightning/utilities/parsing.py", line 182, in __getattr__
    return self[key]
KeyError: 'training_step_output_for_epoch_end'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "mpj/trainer.py", line 279, in <module>
    trainer_object.fit()
  File "mpj/trainer.py", line 237, in fit
    trainer.fit(model, train_loader, val_loader)
  File "/home/echo/p3.8-test/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 499, in fit
    self.dispatch()
  File "/home/echo/p3.8-test/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 546, in dispatch
    self.accelerator.start_training(self)
  File "/home/echo/p3.8-test/lib/python3.8/site-packages/pytorch_lightning/accelerators/accelerator.py", line 73, in start_training
    self.training_type_plugin.start_training(trainer)
  File "/home/echo/p3.8-test/lib/python3.8/site-packages/pytorch_lightning/plugins/training_type/training_type_plugin.py", line 114, in start_training
    self._results = trainer.run_train()
  File "/home/echo/p3.8-test/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 637, in run_train
    self.train_loop.run_training_epoch()
  File "/home/echo/p3.8-test/lib/python3.8/site-packages/pytorch_lightning/trainer/training_loop.py", line 499, in run_training_epoch
    batch_output.training_step_output_for_epoch_end,
  File "/home/echo/p3.8-test/lib/python3.8/site-packages/pytorch_lightning/utilities/parsing.py", line 184, in __getattr__
    raise AttributeError(f'Missing attribute "{key}"') from exp
AttributeError: Missing attribute "training_step_output_for_epoch_end"

I looked at issue 3323 and others, and I am returning None, and accelerator is None (so, not dp or ddp). In case it matters, I do not have an training_epoch_end, and it fails consistently whenever I return None.
Thanks for the help!
Expected behavior
Skip the batch/step when returning None.
Environment

CUDA:

GPU:

GeForce RTX 2080 Ti


available:         True
version:           11.1


Packages:

numpy:             1.18.3
pyTorch_debug:     False
pyTorch_version:   1.8.0+cu111
pytorch-lightning: 1.2.6
tqdm:              4.56.0


System:

OS:                Linux
architecture:

64bit
ELF


processor:         x86_64
python:            3.8.2
version:           #140-Ubuntu SMP Thu Jan 28 05:20:47 UTC 2021