You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@madlib.apache.org by GitBox <gi...@apache.org> on 2019/04/24 23:31:39 UTC

[GitHub] [madlib] njayaram2 commented on a change in pull request #375: DL: Add GPU support for evaluate

njayaram2 commented on a change in pull request #375: DL: Add GPU support for evaluate
URL: https://github.com/apache/madlib/pull/375#discussion_r278344489
 
 

 ##########
 File path: src/ports/postgres/modules/deep_learning/madlib_keras.py_in
 ##########
 @@ -84,6 +80,18 @@ def fit(schema_madlib, source_table, model, dependent_varname,
         fit_validator.validate_input_shapes(validation_table, input_shape, 1)
     model_weights_serialized = query_result[Format.MODEL_WEIGHTS]
 
+    #TODO: Refactor the pg related logic in a future PR when we think
+    # about making the fit function easier to read and maintain.
+    if is_platform_pg():
+        set_keras_session(use_gpu)
+    else:
+        # Disable GPU on master for gpdb
+        os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
+    gp_segment_id_col =  -1 if is_platform_pg() else 'gp_segment_id'
 
 Review comment:
   I'd rather move this to the `if-else` above just for better readability, and it'll also save us an extra if check.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services