0

I am processing my model on a very large data set (of size about 1TB) by breaking it into chunks and then run a prediction on each chunks and then append the result in a file.

After running on each chunk I have to free the memory of GPU so that the other chunk can be processed and predicted.

Instead of running "Restart Kernel" again and again, I can run the loop if some command to clear the GPU memory exist.

  • Please mention what are you actually using (xgboost via h2o-3, some algorithms in h2o4gpu) and how (code samples). – Mateusz Dymczyk Jun 08 '18 at 13:06
  • Yes I am using xgboost.Random_forest_classifier of h2o4gpu – Anshul Gupta Jun 08 '18 at 13:21
  • Each time i am running prediction memory is filled up , so my doubt is how to free that memory without restarting the kernel manually. @MateuszDymczyk – Anshul Gupta Jun 08 '18 at 13:30
  • please provide a code sample and which version of h2o4gpu are you using. I just tried a simple test case and the memory seems to be automatically freed after predict. – Mateusz Dymczyk Jun 08 '18 at 13:53
  • Please can u share the code. – Anshul Gupta Jun 08 '18 at 16:50
  • params = {'max_depth': 8, 'n_estimators': 100, 'tree_method': 'gpu_hist', 'n_gpus':1, 'backend':'h2o4gpu', 'random_state': 123 , 'n_jobs': -1, 'predictor': 'gpu_predictor', 'verbose':1} modelRF = h2o4gpu.solvers.xgboost.RandomForestClassifier( **params) !sleep 5 modelRF.fit(X = (trainData[featureNames]), y = (trainData[dependentVar])) t3=time.time() a=modelRF.predict_proba(trainData[featureNames]) t4=time.time() This is my code and the memory is not getting freed up automatically – Anshul Gupta Jun 08 '18 at 16:51
  • by code I meant please provide an MVCE https://stackoverflow.com/help/mcve we can run. Also if possible please provide output of `nvidia-smi` between predictions to show that the memory is actually increasing and not being freed. – Mateusz Dymczyk Jun 08 '18 at 17:23
  • @MateuszDymczyk https://stackoverflow.com/questions/50810039/how-to-run-a-prediction-on-gpu here is my code – Anshul Gupta Jun 12 '18 at 06:34

0 Answers0