Hi!
I’m used to the idea that backpropagation takes roughly a couple of times more than the forward prediction to run (please tell me if this is an unrealistic assumption).
Currently, I’m doing a simple linear regression where an unknown vector x is multiplied by a known  matrix A to get a prediction y'. Then I’m minimizing the MSE loss between the true y and the predicted y'.
The matrix A is quite large but sparse, and therefore is saved in a torch.sparse.FloatTensor() in the CPU.
The training steps are
start_time = time.time()
y_pred = torch.matmul(A, x)
print('Matrix product done in ' + str(time.time() - start_time))

loss = loss_fn(RF.mask*RF.x_data, RF.mask*RF_pred)

start_time = time.time()
self.optimizer.zero_grad()
loss.backward()
print('Back propagation done in ' + str(time.time() - start_time))

The output I get is
Matrix product done in 0.36480283737182617
Back propagation done in 25.860530376434326

Is it actually possible that backpropagation takes so long to compute? Is there anything I can try to speed up, bearing in mind that A won’t fit the GPU memory?