[jvm-packages] Unable to run XGBoost with spark on yarn
For bugs or installation issues, please provide the following information. The more information you provide, the more easily we will be able to offer help and advice.
Environment info
Operating System: Distributor ID: Ubuntu Description: Ubuntu 12.04.5 LTS
Compiler:
Package used (python/R/jvm/C++): xgboost4j-spark
xgboost version used:
If installing from source, please provide
- The commit hash (
git rev-parse HEAD): ac41845d4bff1d57533334029463171131debfc0 - Logs will be helpful (If logs are large, please upload as attachment). *** buffer overflow detected ***: /usr/lib/jvm/java-8-openjdk-amd64/bin/java terminated ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7f04c8982e37] /lib/x86_64-linux-gnu/libc.so.6(+0x108d30)[0x7f04c8981d30] /lib/x86_64-linux-gnu/libc.so.6(+0x109dee)[0x7f04c8982dee] /data03/yarn/nm/usercache/michelangelo/appcache/application_1478538147495_255716/container_e466_1478538147495_255716_01_000004/tmp/libxgboost4j3418827670249566637.so(_ZN5rabit6engine13AllreduceBase16TryAllreduceTreeEPvmmPFvPKvS2_iRKN3MPI8DatatypeEE+0x279)[0x7f04750f2ea9] /data03/yarn/nm/usercache/michelangelo/appcache/application_1478538147495_255716/container_e466_1478538147495_255716_01_000004/tmp/libxgboost4j3418827670249566637.so(_ZN5rabit6engine13AllreduceBase12TryAllreduceEPvmmPFvPKvS2_iRKN3MPI8DatatypeEE+0x12)[0x7f04750f3702] /data03/yarn/nm/usercache/michelangelo/appcache/application_1478538147495_255716/container_e466_1478538147495_255716_01_000004/tmp/libxgboost4j3418827670249566637.so(_ZN5rabit6engine15AllreduceRobust11RecoverExecEPvmii+0x8e)[0x7f04750fb23e] /data03/yarn/nm/usercache/michelangelo/appcache/application_1478538147495_255716/container_e466_1478538147495_255716_01_000004/tmp/libxgboost4j3418827670249566637.so(ZN5rabit6engine15AllreduceRobust14LoadCheckPointEPN4dmlc12SerializableES4+0x70)[0x7f04750fb870] /data03/yarn/nm/usercache/michelangelo/appcache/application_1478538147495_255716/container_e466_1478538147495_255716_01_000004/tmp/libxgboost4j3418827670249566637.so(XGBoosterLoadRabitCheckpoint+0x30)[0x7f0474fc2210] /data03/yarn/nm/usercache/michelangelo/appcache/application_1478538147495_255716/container_e466_1478538147495_255716_01_000004/tmp/libxgboost4j3418827670249566637.so(Java_ml_dmlc_xgboost4j_java_XGBoostJNI_XGBoosterLoadRabitCheckpoint+0x26)[0x7f0474faa096] [0x7f04b1017774] ======= Memory map: ========
Steps to reproduce
-
Compile the xgboost library, make the xgboost-spark jar with dependencies. Include that jar within the jars passed to spark.
-
Created a simple training example: import ml.dmlc.xgboost4j.scala.spark.XGBoost import org.apache.spark.sql.SparkSession
object XGBoostSample { def run(spark: SparkSession) { // read trainining data, available at xgboost/demo/data println("Trying to load a xgboost example") val data = spark.read.format("libsvm").load("/user/nikunj/agaricus.txt.train") // define parameters val paramMap = List( "eta" -> 0.1, "max_depth" -> 2, "objective" -> "binary:logistic").toMap // number of iterations val round = 2 // train the model val model = XGBoost.trainWithDataFrame(data, paramMap, round, nWorkers = 6) model.booster.getModelDump().foreach(println) println("Xgboost example completed") } }
- Start spark cluster on yarn and run the above example.
What have you tried?
- Ensured that # executors is greater than nWorkers. The spark cluster had 10 executors.
- Multiple different configurations for the spark cluster.
it seems not related to XGBoost4J/Spark/YARN,
Since JDK7 is still the default support version in Spark, we didn't test XGBoost4J-Spark in JDK8, you may want to try whether JDK7 works
If JDK7 still does not work, the incompatibility of gcc environment between the server where you compile the library and the Spark worker servers might be the cause
I can run XGBoost4J-Spark in a cluster with JDK7 successfully
I was able to run XGBoost on a spark-shell within the same spark worker where the failure happened. Also, our environment is JDK8 for everything else so it might be hard to move to JDK 7. Will it be possible for you to test out JDK 8 ?
I doubt its something to do with the Java version since I can run the XGBoost example on spark shell with JDK8. Probably something to do with the way XGBoost works in distributed mode within yarn containers.
How did you launch your spark-shell? Did you run spark-shell in local mode, or in yarn-client mode? And when submitting your task to Spark, did you run in yarn-client or `yarn-cluster' mode?
It could be that the worker nodes in your Yarn cluster have different versions of GLIBC than your driver node. Are the Yarn cluster nodes also running Ubuntu 12.04?
Actually, I figured out the problem. Our class path was huge and somehow that was crashing XGBoost. The reason class path was huge was due to oozie adding a lot of libraries to the spark context which it needs to invoke the spark cluster.
I overwrote "spark.yarn.dist.jars" with a smaller set of jars and now I can launch XGBoost successfully! Can you take a look why a huge classpath will cause buffer overflow ?
Closing it since my issue got resolved as noted above