Could you check your input for all unique values?
If you are passing all valid embedding indices, you’ll get valid gradients in the complete weight parameter of self.embedding:

num_embeddings = 10
embedding_dim = 100
model = FeedForwardModel(num_embeddings, embedding_dim)

x = torch.arange(num_embeddings)
offsets = torch.tensor([0, 5])

output = model(x, offsets)
output.mean().backward()

print(model.embedding.weight.grad)

However, if you pass e.g. only zeros as input, only weight.grad[0] will be filled with non-zero values.