This repository has been archived by the owner on Feb 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: TensorflowOnSpark python plugin (#525)
* initial commit * update * update * add gpu support * remove comment * change class to function * fix merge issue * add some docs
- Loading branch information
Showing
7 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .configuration import * |
17 changes: 17 additions & 0 deletions
17
aztk/spark/models/plugins/tensorflow_on_spark/configuration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import os | ||
from aztk.models.plugins.plugin_configuration import PluginConfiguration, PluginPort, PluginTargetRole | ||
from aztk.models.plugins.plugin_file import PluginFile | ||
from aztk.utils import constants | ||
|
||
dir_path = os.path.dirname(os.path.realpath(__file__)) | ||
|
||
|
||
def TensorflowOnSparkPlugin(): | ||
return PluginConfiguration( | ||
name="tensorflow_on_spark", | ||
target_role=PluginTargetRole.Master, | ||
execute="tensorflow_on_spark.sh", | ||
files=[ | ||
PluginFile("tensorflow_on_spark.sh", os.path.join(dir_path, "tensorflow_on_spark.sh")), | ||
], | ||
) |
20 changes: 20 additions & 0 deletions
20
aztk/spark/models/plugins/tensorflow_on_spark/tensorflow_on_spark.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
# This plugin requires HDFS to be enabled and on the path | ||
|
||
# setup TensorFlowOnSpark | ||
git clone https://github.com/yahoo/TensorFlowOnSpark.git | ||
cd TensorFlowOnSpark | ||
export TFoS_HOME=$(pwd) | ||
export TFoS_HOME=~/TensorFlowOnSpark >> ~/.bashrc | ||
|
||
if [ "$AZTK_GPU_ENABLED" = "true" ]; then | ||
pip install tensorflow-gpu | ||
pip install tensorflowonspark | ||
else | ||
pip install tensorflow-cpu | ||
pip install tensorflowonspark | ||
fi | ||
|
||
# add libhdfs.so to path | ||
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HADOOP_HOME/lib/native/libhdfs.so" >> ~/.bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters