Sure, I understand.
Then digging a bit in the doc shows why it acts like this: check the source code for DataParallel here 1.
What happens when you call model(images) is that you call the DataParallel module’s forward method, which handles all the parallelism. Inside the forward method, the submodules (your model split in the number of GPUs you specified) are called with return self.module(*inputs[0], **kwargs[0]), which in turn calls the forward method of the module itself… Which is not forward1 or forward2 in your case, and it doesn’t split it on multiple GPUs.
Hence my recommendations of keeping the original forward method or having two nested modules.
One solution I can imagine is inheriting the DataParallel class, and overriding the forward method with your own looping behaviour, but doing it without breaking anything will probably be a bit complex…