The application master used for yarn-client mode is different from the application master used for standalone mode (the latter runs the driver and the former is only used to request resources). They both use org.apache.spark.deploy.yarn.Client to submit the app to YARN, but each uses a different AM class.