tgravescs opened a new pull request #24615: [SPARK-27488] Driver interface to 
support GPU resources
URL: https://github.com/apache/spark/pull/24615
 
 
   ## What changes were proposed in this pull request?
   
   Added the driver functionality to get the resources. 
   
   The user interface is: SparkContext.resources  - I called it this to match 
the TaskContext.resources api proposed in the other PR. Originally it was going 
to be called SparkContext.getResources but changed to be consistent, if people 
have strong feelings I can change it. 
   
   There are 2 ways the driver can discover what resources it has. 
     1) user specifies a discoveryScript, this is similar to the executors and 
is meant for yarn and k8s where they don't tell you what you were allocated but 
you are running in isolated environment.
     2) read the config spark.driver.resource.resourceName.addresses.  The 
config is meant to be used with standalone mode where the Worker will have to 
assign what GPU addresses the Driver is allowed to use by setting that config.
   
   When the user runs a spark application, if they want the driver to have 
GPU's they would specify the conf spark.driver.resource.gpu.count=X  where x is 
the number they want.  If they are running on yarn or k8s they will also have 
to specify the discoveryScript as specified above, if they are on standalone 
mode and cluster is setup properly they wouldn't have to specify anything else. 
 We could potentially get rid of the spark.driver.resources.gpu.addresses 
config which is really meant to be an internal config for worker to set if the 
standalone mode Worker wanted to write a discoveryScript out and set that for 
the user.  I'll wait for the jira that implements that to decide if we can 
remove.
   
   - This PR also has changes to be consistent about using resourceName 
everywhere.
   - Moved the config checks around a bit since now used by both executor and 
driver. Note those might overlap a bit with 
https://github.com/apache/spark/pull/24374 so we will have to figure out which 
one should go in first.
   
   ## How was this patch tested?
   
   Unit tests and manually test the interface.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to