3 groups with a filter using in_channels=3 would need 9 channels.
The grouped conv section 49 or the docs give you more information on the usage of the groups argument.
If you want to process each input channel separately, use:
input = torch.rand(4, 3, 8, 8)
weight = torch.ones(3, 1, 3, 3)
out = torch.conv2d(input, weight, groups=3)