Basically, m3 will also have gradients after your loss.backward().
You can try the following code that I try to simulate your situation and you will got gradients on m3:
m1 = torch.tensor(1.).requires_grad_()
m1 = torch.nn.Parameter(m1)
m2 = torch.tensor(2.).requires_grad_()
m2 = torch.nn.Parameter(m2)
m3 = torch.tensor(3.).requires_grad_()
m3 = torch.nn.Parameter(m3)
i = torch.tensor(4.)
o1 = m1 * i
o2 = m2 * o1
o3 = m3 * o1
t1 = 5.
t2 = 6.
loss = (o2 - t1) + (o3 - t2)
loss.backward()
print (m2.grad, m3.grad)

>>> tensor(4.) tensor(4.)

But I can provide some opinion that might cause your zero gradient:

you forget to use optimizer.step() or other way to update your weights.
your learning rate is zero
The gradient of m3 is really calculated to be zero in your algorithm (maybe it’s the problem of loss2 you use that produce a zero gradient).