Can the data type of Grad and Hess be np.float64?

It seems internally the Grad and Hess are converted to float32 which causes the some gradient in my application becomes Inf.

In my application, I do need grad to be quite large value at the beginning. Is there any possible way to change the underly C code to support float64 in xgboost?

I am customizing the objective function using

def gradient(truth, predt)
def hessian(truth, predt)
def my_loss(truth, predt)

Another questions: Is the output of the hess should be a vector or a matrix is also possible?

No, we (XGBoost developers) will not make this change. Using float64 would increase memory usage. However, since XGBoost is an open-source project, you are free to make the change on your own fork.

The hess should be a vector.

Thank you. Tried a workaround of my loss function to make it work with float32.