I’m afraid this is “expected”. autograd.grad only uses automatic differentiation. And automatic differentiation is not built to compute full Jacobians. It has to construct them row by row.
But since it;s so big in your case, it takes a very long time.
Note as well that even if you manage to compute the Jacobian matrix, since it will take 4GB just to store it, you definitely won’t be able to do any autograd with it. And you won’t be able to do much operations on it before running out of memory I’m afraid.