Skip to content

Commit

Permalink
Torchoptim, wrap pytorch optimizer to bigdl's optimmethod (intel-anal…
Browse files Browse the repository at this point in the history
…ytics#2869)

* TorchOptim

* add python api

* add scala test

* add python test

* add python test

* add python test

* fix on yarn

* clean up

* add test

* fix style check
  • Loading branch information
qiuxin2012 committed Sep 15, 2020
1 parent 9639a1c commit c6c6453
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pyspark/bigdl/common/zooUtils/nncontext.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

from bigdl.util.common import *
from zoo.common.utils import callZooFunc
from zoo.util.utils import set_python_home
import warnings
import multiprocessing
import os
Expand All @@ -45,6 +46,7 @@ def init_spark_on_local(cores=2, conf=None, python_location=None, spark_log_leve
from zoo.util.spark import SparkRunner
runner = SparkRunner(spark_log_level=spark_log_level,
redirect_spark_log=redirect_spark_log)
set_python_home()
return runner.init_spark_on_local(cores=cores, conf=conf,
python_location=python_location)

Expand Down Expand Up @@ -118,6 +120,7 @@ def init_spark_on_yarn(hadoop_conf,
spark_yarn_archive=spark_yarn_archive,
jars=jars,
conf=conf)
set_python_home()
return sc


Expand Down Expand Up @@ -185,6 +188,7 @@ def init_spark_standalone(num_executors,
jars=jars,
python_location=python_location,
enable_numa_binding=enable_numa_binding)
set_python_home()
return sc


Expand Down Expand Up @@ -378,6 +382,7 @@ def Popen(*args, **kwargs):
redire_spark_logs()
show_bigdl_info_logs()
init_engine()
set_python_home()
return sc


Expand Down

0 comments on commit c6c6453

Please sign in to comment.