Repository: intel/ipex-llm
Pull request: del bigdl engine in orca pytorch estimator
## Description
del bigdl engine in orca pytorch estimator

### 1. Why the change?
del bigdl engine in orca pytorch estimator, as bigdl to hard to deploy.
fixed #7954 

### 2. User API changes

del bigdl engine in orca pytorch estimator， user couldm't use bigdl backend in  orca pytorch estimator

### 3. Summary of the change 

del bigdl engine in orca pytorch estimator

### 4. How to test?
- [ ] N/A
- [ ] Unit test
- [ ] Application test
- [ ] Document test
- [ ] ...


Problem statement:
Remove jep backend in orca pytorch estmator
As jep's environment is hard to use and deprecated. And ray and spark backend are better choice, we will remove jep backend.
Tasks:
- [ ] 1. remove jep UT and example tests using orca pytorch estimator.
- [ ] 2. remove related code in orca pytorch estimator.

Hints from issue discussion:

Commit message: update

Patch to review:
diff --git a/.github/actions/colab/colab-python-py37-pytorch/action.yml b/.github/actions/colab/colab-python-py37-pytorch/action.yml
index e4d210cd4d4..1e4abde4a8a 100644
--- a/.github/actions/colab/colab-python-py37-pytorch/action.yml
+++ b/.github/actions/colab/colab-python-py37-pytorch/action.yml
@@ -52,7 +52,7 @@ runs:
         pip install -i https://pypi.org/simple --pre bigdl
         pip install -i ${GONDOLIN_PIP_MIRROR} --trusted-host ${GONDOLIN_TRUSTED_HOST} torch==1.7.1 torchvision==0.8.2
         pip install -i ${GONDOLIN_PIP_MIRROR} --trusted-host ${GONDOLIN_TRUSTED_HOST} six cloudpickle
-        pip install -i ${GONDOLIN_PIP_MIRROR} --trusted-host ${GONDOLIN_TRUSTED_HOST} jep==3.9.0 xgboost
+        pip install -i ${GONDOLIN_PIP_MIRROR} --trusted-host ${GONDOLIN_TRUSTED_HOST} xgboost
         pip install -i https://pypi.org/simple --pre --upgrade bigdl-chronos[pytorch,distributed]
         pip uninstall -y torchtext 
         if [ -f python/chronos/dev/colab-notebook/run-notebook-pytorch.sh ]
diff --git a/.github/actions/orca/orca-exampletest-jep-py37-spark3-action/nightly-test/action.yml b/.github/actions/orca/orca-exampletest-jep-py37-spark3-action/nightly-test/action.yml
index 9a87456d98d..ab0937f97d1 100644
--- a/.github/actions/orca/orca-exampletest-jep-py37-spark3-action/nightly-test/action.yml
+++ b/.github/actions/orca/orca-exampletest-jep-py37-spark3-action/nightly-test/action.yml
@@ -13,7 +13,7 @@ runs:
 
         pip install -i ${GONDOLIN_PIP_MIRROR} --trusted-host ${GONDOLIN_TRUSTED_HOST} torch==1.7.1
         pip install -i ${GONDOLIN_PIP_MIRROR} --trusted-host ${GONDOLIN_TRUSTED_HOST} torchvision==0.8.2
-        pip install -i ${GONDOLIN_PIP_MIRROR} --trusted-host ${GONDOLIN_TRUSTED_HOST} jep==3.9.0
+        pip install -i ${GONDOLIN_PIP_MIRROR} --trusted-host ${GONDOLIN_TRUSTED_HOST} jep==3.9.1
         pip install -i ${GONDOLIN_PIP_MIRROR} --trusted-host ${GONDOLIN_TRUSTED_HOST} cloudpickle
         pip install -i ${GONDOLIN_PIP_MIRROR} --trusted-host ${GONDOLIN_TRUSTED_HOST} pandas
         pip install -i ${GONDOLIN_PIP_MIRROR} --trusted-host ${GONDOLIN_TRUSTED_HOST} matplotlib
diff --git a/apps/pytorch/README.md b/apps/pytorch/README.md
index f273cea7660..cd35f0a8d1f 100644
--- a/apps/pytorch/README.md
+++ b/apps/pytorch/README.md
@@ -1,4 +1,5 @@
 # Distributed Face Generation on Spark
+# Deprecated, please go to new API and example orca/example/learn/pytorch
 
 This example is migrated from [PROGRESSIVE GROWING OF GANS](https://pytorch.org/hub/facebookresearch_pytorch-gan-zoo_pgan/), and demonstrates how to run distributed inference using a pre-trained Pytorch Model.
 
diff --git a/python/orca/dev/example/run-example-tests-jep.sh b/python/orca/dev/example/run-example-tests-jep.sh
index ac52dc0b94d..06399ada4fc 100644
--- a/python/orca/dev/example/run-example-tests-jep.sh
+++ b/python/orca/dev/example/run-example-tests-jep.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-
+# TODO: remove jep
 set -e
 
 echo "#1 start example for MNIST"
diff --git a/python/orca/dev/test/run-pytests-jep.sh b/python/orca/dev/test/run-pytests-jep.sh
index 101d2e01903..cc064194a4a 100755
--- a/python/orca/dev/test/run-pytests-jep.sh
+++ b/python/orca/dev/test/run-pytests-jep.sh
@@ -16,6 +16,7 @@
 # limitations under the License.
 #
 
+# TODO: remove jep
 cd "`dirname $0`"
 
 echo "Running Jep tests"
diff --git a/python/orca/example/learn/pytorch/brainMRI/brainMRI.py b/python/orca/example/learn/pytorch/brainMRI/brainMRI.py
index 027c3bc7159..0049399d514 100644
--- a/python/orca/example/learn/pytorch/brainMRI/brainMRI.py
+++ b/python/orca/example/learn/pytorch/brainMRI/brainMRI.py
@@ -203,19 +203,7 @@ def denormalize(images):
 # plot some random training images.
 # You should use jupyter notebook to show the images.
 show_batch(train_loader)
-if args.backend == "bigdl":
-    net = model_creator()
-    optimizer = optim_creator(model=net, config={"lr": 0.001})
-    orca_estimator = Estimator.from_torch(model=net,
-                                          optimizer=optimizer,
-                                          loss=bce_dice_loss,
-                                          config=config,
-                                          backend=args.backend)
-
-    orca_estimator.fit(data=train_loader, epochs=args.epochs)
-
-
-elif args.backend in ["ray", "spark"]:
+if args.backend in ["ray", "spark"]:
     orca_estimator = Estimator.from_torch(model=model_creator,
                                           optimizer=optim_creator,
                                           loss=loss_creator,
@@ -232,7 +220,7 @@ def denormalize(images):
     for r, value in res.items():
         print(r, ":", value)
 else:
-    invalidInputError(False, "Only bigdl, ray, and spark are supported as the backend,"
+    invalidInputError(False, "Only ray, and spark are supported as the backend,"
                              " but got {}".format(args.backend))
 
 stop_orca_context()
diff --git a/python/orca/example/learn/pytorch/cifar10/README.md b/python/orca/example/learn/pytorch/cifar10/README.md
index bd46cef6985..66776c930db 100644
--- a/python/orca/example/learn/pytorch/cifar10/README.md
+++ b/python/orca/example/learn/pytorch/cifar10/README.md
@@ -19,11 +19,6 @@ pip install tqdm  # progress bar
 # For ray backend
 pip install bigdl-orca[ray]
 pip install tqdm  # progress bar
-
-# For bigdl backend
-pip install bigdl-orca
-pip install jep==3.9.0
-pip install six cloudpickle
 ```
 
 ## Run on local after pip install
@@ -40,12 +35,6 @@ You can run with `ray` backend via:
 python cifar10.py --backend ray
 ```
 
-You can run with `bigdl` backend via:
-
-```
-python cifar10.py --backend bigdl
-```
-
 ## Run on yarn cluster for yarn-client mode after pip install
 
 ```
@@ -66,15 +55,3 @@ Accuracy : tensor(0.5378)
 val_loss : 1.3078322240829467
 ```
 
-**For "bigdl" backend**
-
-You can find the logs for training as follows:
-```
-2020-12-03 15:25:30 INFO  DistriOptimizer$:426 - [Epoch 2 47680/50000][Iteration 24420][Wall Clock 497.634203315s] Trained 4 records in 0.022554577 seconds. Throughput is 177.3476 records/second. Loss is 0.82751834.
-```
-
-Final test results will be printed at the end:
-```
-Accuracy of the network on the test images: {'Top1Accuracy': 0.541100025177002}
-```
-
diff --git a/python/orca/example/learn/pytorch/cifar10/cifar10.py b/python/orca/example/learn/pytorch/cifar10/cifar10.py
index f72d0beb937..f14252a98b9 100644
--- a/python/orca/example/learn/pytorch/cifar10/cifar10.py
+++ b/python/orca/example/learn/pytorch/cifar10/cifar10.py
@@ -165,21 +165,7 @@ def optim_creator(model, config):
 imshow(torchvision.utils.make_grid(images), one_channel=False)
 print('GroundTruth: ', ' '.join('%5s' % classes[labels[j]] for j in range(batch_size)))
 
-if args.backend == "bigdl":
-    net = model_creator(config={})
-    optimizer = optim_creator(model=net, config={"lr": 0.001})
-    orca_estimator = Estimator.from_torch(model=net,
-                                          optimizer=optimizer,
-                                          loss=criterion,
-                                          metrics=[Accuracy()],
-                                          backend="bigdl")
-
-    orca_estimator.fit(data=train_loader, epochs=args.epochs, validation_data=test_loader,
-                       checkpoint_trigger=EveryEpoch())
-
-    res = orca_estimator.evaluate(data=test_loader)
-    print("Accuracy of the network on the test images: %s" % res)
-elif args.backend in ["ray", "spark"]:
+if args.backend in ["ray", "spark"]:
     orca_estimator = Estimator.from_torch(model=model_creator,
                                           optimizer=optim_creator,
                                           loss=criterion,
@@ -202,7 +188,7 @@ def optim_creator(model, config):
     for r in res:
         print(r, ":", res[r])
 else:
-    invalidInputError(False, "Only bigdl, ray, and spark are supported as the backend,"
+    invalidInputError(False, "Only ray, and spark are supported as the backend,"
                       " but got {}".format(args.backend))
 
 stop_orca_context()
diff --git a/python/orca/example/learn/pytorch/fashion_mnist/README.md b/python/orca/example/learn/pytorch/fashion_mnist/README.md
index fbfbc4524f6..2738722d985 100644
--- a/python/orca/example/learn/pytorch/fashion_mnist/README.md
+++ b/python/orca/example/learn/pytorch/fashion_mnist/README.md
@@ -20,11 +20,6 @@ pip install tqdm  # progress bar
 # For ray backend
 pip install bigdl-orca[ray]
 pip install tqdm  # progress bar
-
-# For bigdl backend
-pip install bigdl-orca
-pip install jep==3.9.0
-pip install six cloudpickle
 ```
 
 ## Run on local after pip install
@@ -41,12 +36,6 @@ You can run with `ray` backend via:
 python fashion_mnist.py --backend ray
 ```
 
-You can run with `bigdl` backend via:
-
-```
-python fashion_mnist.py --backend bigdl
-```
-
 To see the result figures after it finishes:
 
 ```
@@ -77,18 +66,4 @@ You can find the results of training and validation as follows:
 Train stats: [{'num_samples': 60000, 'epoch': 1, 'batch_count': 15000, 'train_loss': 0.6387080065780457, 'last_train_loss': 0.17801283299922943}, {'num_samples': 60000, 'epoch': 2, 'batch_count': 15000, 'train_loss': 0.372230169281755, 'last_train_loss': 0.19179978966712952}, {'num_samples': 60000, 'epoch': 3, 'batch_count': 15000, 'train_loss': 0.32247564417196833, 'last_train_loss': 0.30726122856140137}, {'num_samples': 60000, 'epoch': 4, 'batch_count': 15000, 'train_loss': 0.2959285915141232, 'last_train_loss': 0.2786743640899658}, {'num_samples': 60000, 'epoch': 5, 'batch_count': 15000, 'train_loss': 0.27712880933261197, 'last_train_loss': 0.2697388529777527}]
 
 Validation stats: {'num_samples': 10000, 'Accuracy': tensor(0.8788), 'val_loss': 0.34675604103680596}
-```
-
-**For "bigdl" backend**
-
-You can find the logs for training as follows:
-
-```
-2021-03-24 14:33:36 INFO  DistriOptimizer$:427 - [Epoch 4 52876/60000][Iteration 58219][Wall Clock 1230.685682812s] Trained 4.0 records in 0.016452279 seconds. Throughput is 243.12741 records/second. Loss is 0.0136261955.
-```
-
-Final test results will be printed at the end:
-
-```
-2021-03-24 14:39:43 INFO  DistriOptimizer$:1759 - Top1Accuracy is Accuracy(correct: 8851, count: 10000, accuracy: 0.8851)
-```
+```
\ No newline at end of file
diff --git a/python/orca/example/learn/pytorch/fashion_mnist/fashion_mnist.py b/python/orca/example/learn/pytorch/fashion_mnist/fashion_mnist.py
index 2423ae362c9..26ef1b9aa66 100644
--- a/python/orca/example/learn/pytorch/fashion_mnist/fashion_mnist.py
+++ b/python/orca/example/learn/pytorch/fashion_mnist/fashion_mnist.py
@@ -163,28 +163,7 @@ def main():
     criterion = nn.CrossEntropyLoss()
     batch_size = args.batch_size
     epochs = args.epochs
-    if args.backend == "bigdl":
-        train_loader = train_data_creator(config={}, batch_size=4,
-                                          download=args.download, data_dir=args.data_dir)
-        test_loader = validation_data_creator(config={}, batch_size=4,
-                                              download=args.download, data_dir=args.data_dir)
-
-        net = model_creator(config={})
-        optimizer = optimizer_creator(model=net, config={"lr": 0.001})
-        orca_estimator = Estimator.from_torch(model=net,
-                                              optimizer=optimizer,
-                                              loss=criterion,
-                                              metrics=[Accuracy()],
-                                              backend="bigdl")
-
-        orca_estimator.set_tensorboard(tensorboard_dir, "bigdl")
-
-        orca_estimator.fit(data=train_loader, epochs=epochs, validation_data=test_loader,
-                           checkpoint_trigger=EveryEpoch())
-
-        res = orca_estimator.evaluate(data=test_loader)
-        print("Accuracy of the network on the test images: %s" % res)
-    elif args.backend in ["ray", "spark"]:
+    if args.backend in ["ray", "spark"]:
         orca_estimator = Estimator.from_torch(model=model_creator,
                                               optimizer=optimizer_creator,
                                               loss=criterion,
@@ -201,7 +180,7 @@ def main():
         print("Validation stats: {}".format(val_stats))
         orca_estimator.shutdown()
     else:
-        invalidInputError(False, "Only bigdl, ray, and spark are supported "
+        invalidInputError(False, "Only ray, and spark are supported "
                           "as the backend, but got {}".format(args.backend))
 
     stop_orca_context()
diff --git a/python/orca/example/learn/pytorch/super_resolution/README.md b/python/orca/example/learn/pytorch/super_resolution/README.md
index cc48b5bc62a..c1ffef38c1f 100644
--- a/python/orca/example/learn/pytorch/super_resolution/README.md
+++ b/python/orca/example/learn/pytorch/super_resolution/README.md
@@ -18,11 +18,6 @@ pip install tqdm  # progress bar
 # For ray backend
 pip install bigdl-orca[ray]
 pip install tqdm  # progress bar
-
-# For bigdl backend
-pip install bigdl-orca
-pip install jep==3.9.0
-pip install six cloudpickle
 ```
 
 ## Prepare Dataset
@@ -58,12 +53,6 @@ python super_resolution.py --backend spark
 python super_resolution.py --backend ray
 ```
 
-- Run with bigdl backend:
-```bash
-python super_resolution.py --backend bigdl
-```
-
-
 **Options**
 * `--upscale_factor` The upscale factor of super resolution. Default is 3.
 * `--batch_size` The number of samples per gradient update. Default is 64.
@@ -85,16 +74,4 @@ You can find the result for training as follows:
 You can find the result for validation as follows:
 ```
 ===> Validation Complete: Avg. PSNR: 11.8249 dB, Avg. Loss: 0.0657
-```
-
-**For "bigdl" backend**
-
-You can find the result for training as follows:
-```
-2021-03-31 18:02:23 INFO  DistriOptimizer$:427 - [Epoch 1 64/256][Iteration 1][Wall Clock 3.255740525s] Trained 64.0 records in 3.255740525 seconds. Throughput is 19.657585 records/second. Loss is 0.44492772.
-```
-You can find the result for validation as follows:
-```
-2021-03-31 18:02:45 INFO  DistriOptimizer$:1759 - MSE is (Loss: 0.1174012, count: 2, Average Loss: 0.0587006)
-===> Validation Complete: Avg. PSNR: 12.3136 dB, Avg. Loss: 0.0587
-```
+```
\ No newline at end of file
diff --git a/python/orca/example/learn/pytorch/super_resolution/super_resolution.py b/python/orca/example/learn/pytorch/super_resolution/super_resolution.py
index 9b17397ab6b..1b580af754f 100644
--- a/python/orca/example/learn/pytorch/super_resolution/super_resolution.py
+++ b/python/orca/example/learn/pytorch/super_resolution/super_resolution.py
@@ -246,46 +246,7 @@ def optim_creator(model, config):
 criterion = nn.MSELoss()
 model_dir = opt.data_dir+"/models"
 
-if opt.backend == "bigdl":
-    model = model_creator(
-        config={
-            "upscale_factor": opt.upscale_factor,
-            "seed": opt.seed
-        }
-    )
-    optimizer = optim_creator(model, config={"lr": opt.lr})
-    estimator = Estimator.from_torch(
-        model=model,
-        optimizer=optimizer,
-        loss=criterion,
-        metrics=[MSE()],
-        model_dir=model_dir,
-        backend="bigdl"
-    )
-
-    train_loader = train_data_creator(
-        config={
-            "upscale_factor": opt.upscale_factor,
-            "threads": opt.threads
-        },
-        batch_size=opt.batch_size
-    )
-    test_loader = validation_data_creator(
-        config={
-            "upscale_factor": opt.upscale_factor,
-            "threads": opt.threads
-        },
-        batch_size=opt.batch_size
-    )
-
-    estimator.fit(data=train_loader, epochs=opt.epochs, validation_data=test_loader,
-                  checkpoint_trigger=EveryEpoch())
-
-    val_stats = estimator.evaluate(data=test_loader)
-    print("===> Validation Complete: Avg. PSNR: {:.4f} dB, Avg. Loss: {:.4f}"
-          .format(10 * log10(1. / val_stats["MSE"]), val_stats["MSE"]))
-
-elif opt.backend in ["ray", "spark"]:
+if opt.backend in ["ray", "spark"]:
     estimator = Estimator.from_torch(
         model=model_creator,
         optimizer=optim_creator,
@@ -325,7 +286,7 @@ def optim_creator(model, config):
     estimator.save(last_model_path)
     print("Checkpoint saved to {}".format(last_model_path))
 else:
-    invalidInputError(False, "Only bigdl, ray, and spark are supported as the backend, "
+    invalidInputError(False, "Only ray, and spark are supported as the backend, "
                       "but got {}".format(opt.backend))
 
 stop_orca_context()
diff --git a/python/orca/example/torchmodel/train/README.md b/python/orca/example/torchmodel/train/README.md
index 206331a0940..f1c6254cfdf 100644
--- a/python/orca/example/torchmodel/train/README.md
+++ b/python/orca/example/torchmodel/train/README.md
@@ -1,5 +1,7 @@
 # Distributed pytorch
 
+# Deprecated, please go to new API and example orca/example/learn/pytorch
+
 There are some examples to show you how to use analytics-zoo to distribute pytorch on Spark.
 1. [MNIST](./train/mnist)
 2. [Imagenet](./train/imagenet)
diff --git a/python/orca/example/torchmodel/train/imagenet/README.md b/python/orca/example/torchmodel/train/imagenet/README.md
index 98baa91ac07..e90c2c16d96 100644
--- a/python/orca/example/torchmodel/train/imagenet/README.md
+++ b/python/orca/example/torchmodel/train/imagenet/README.md
@@ -1,5 +1,7 @@
 # Distributed pytorch on ImageNet dataset
 
+# Deprecated, please go to new API and example orca/example/learn/pytorch
+
 This is an example to show you how to use analytics-zoo to train a pytorch model on Spark. 
 
 # Requirements
diff --git a/python/orca/example/torchmodel/train/imagenet/main.py b/python/orca/example/torchmodel/train/imagenet/main.py
index 1ff0568ea82..319c622faf8 100644
--- a/python/orca/example/torchmodel/train/imagenet/main.py
+++ b/python/orca/example/torchmodel/train/imagenet/main.py
@@ -35,6 +35,7 @@
                      and callable(torchvision.models.__dict__[name]))
 
 
+# TODO(change to other engine in 2.2.0)
 def main():
     parser = argparse.ArgumentParser(description='PyTorch ImageNet Training')
     parser.add_argument('data', metavar='DIR',
diff --git a/python/orca/example/torchmodel/train/mnist/README.md b/python/orca/example/torchmodel/train/mnist/README.md
index 355e93ad990..7ef1fb63c82 100644
--- a/python/orca/example/torchmodel/train/mnist/README.md
+++ b/python/orca/example/torchmodel/train/mnist/README.md
@@ -1,5 +1,7 @@
 # Distributed pytorch on MNIST dataset
 
+# Deprecated, please go to new API and example orca/example/learn/pytorch
+
 This is an example to show you how to use analytics-zoo to train a pytorch model on Spark. 
 
 # Requirements
diff --git a/python/orca/example/torchmodel/train/mnist/main.py b/python/orca/example/torchmodel/train/mnist/main.py
index c414109d2da..81ca244d46b 100644
--- a/python/orca/example/torchmodel/train/mnist/main.py
+++ b/python/orca/example/torchmodel/train/mnist/main.py
@@ -51,6 +51,7 @@ def forward(self, x):
         return F.log_softmax(x, dim=1)
 
 
+# TODO(change to other engine in 2.2.0)
 def main():
     # Training settings
     parser = argparse.ArgumentParser(description='PyTorch MNIST Example')
diff --git a/python/orca/example/torchmodel/train/resnet_finetune/README.md b/python/orca/example/torchmodel/train/resnet_finetune/README.md
index 782f4b814a7..ffd2de685bc 100644
--- a/python/orca/example/torchmodel/train/resnet_finetune/README.md
+++ b/python/orca/example/torchmodel/train/resnet_finetune/README.md
@@ -1,5 +1,7 @@
 # Summary
 
+# Deprecated, please go to new API and example orca/example/learn/pytorch
+
 In this example we use a pre-trained ResNet model, adding an extra layer to the end, to train
 a dog-vs-cat image classification model.
 
diff --git a/python/orca/example/torchmodel/train/resnet_finetune/resnet_finetune.py b/python/orca/example/torchmodel/train/resnet_finetune/resnet_finetune.py
index ef50d52c2ce..236a3d85e8d 100644
--- a/python/orca/example/torchmodel/train/resnet_finetune/resnet_finetune.py
+++ b/python/orca/example/torchmodel/train/resnet_finetune/resnet_finetune.py
@@ -47,6 +47,7 @@ def forward(self, x):
         return x
 
 
+# TODO(change to pytorch in 2.2.0)
 if __name__ == '__main__':
 
     parser = OptionParser()
diff --git a/python/orca/src/bigdl/orca/learn/pytorch/estimator.py b/python/orca/src/bigdl/orca/learn/pytorch/estimator.py
index 8d3d5a5b51e..cdcc3fb5d25 100644
--- a/python/orca/src/bigdl/orca/learn/pytorch/estimator.py
+++ b/python/orca/src/bigdl/orca/learn/pytorch/estimator.py
@@ -24,7 +24,6 @@
     from torch.optim.lr_scheduler import _LRScheduler as LRScheduler
     from bigdl.orca.learn.metrics import Metric
     from bigdl.orca.learn.pytorch.pytorch_ray_estimator import PyTorchRayEstimator
-    from bigdl.orca.learn.pytorch.pytorch_spark_estimator import PyTorchSparkEstimator
     from bigdl.orca.learn.pytorch.pytorch_pyspark_estimator import PyTorchPySparkEstimator
     from bigdl.orca.learn.pytorch.experimential.mmcv.mmcv_ray_estimator import MMCVRayEstimator
 
@@ -48,7 +47,6 @@ def from_torch(*,
                    log_level: int=logging.INFO,
                    log_to_driver: bool=True,
                    ) -> Union['PyTorchRayEstimator',
-                              'PyTorchSparkEstimator',
                               'PyTorchPySparkEstimator',
                               None]:
         """
@@ -64,8 +62,8 @@ def from_torch(*,
         :param metrics: One or a list of Orca validation metrics. Function(s) that computes the
                metrics between the output and target tensors are also supported.
                Default: None if no validation is involved.
-        :param backend: The distributed backend for the Estimator. One of "spark",  "ray",
-               "bigdl" or "horovod".
+        :param backend: The distributed backend for the Estimator. One of "spark",  "ray"
+               or "horovod".
                Default: "spark".
         :param config: A parameter config dict, CfgNode or any class instance that plays a role of
                configuration to create model, loss, optimizer, scheduler and data.
@@ -104,15 +102,6 @@ def from_torch(*,
                                        backend=backend,
                                        sync_stats=sync_stats,
                                        log_level=log_level)
-        elif backend == "bigdl":
-            from bigdl.orca.learn.pytorch.pytorch_spark_estimator import PyTorchSparkEstimator
-            return PyTorchSparkEstimator(model=model,
-                                         loss=loss,
-                                         optimizer=optimizer,
-                                         config=config,
-                                         metrics=metrics,
-                                         model_dir=model_dir,
-                                         bigdl_type="float")
         elif backend == "spark":
             from bigdl.orca.learn.pytorch.pytorch_pyspark_estimator import PyTorchPySparkEstimator
             return PyTorchPySparkEstimator(model_creator=model,
@@ -131,7 +120,7 @@ def from_torch(*,
         else:
             from bigdl.dllib.utils.log4Error import invalidInputError
             invalidInputError(False,
-                              "Only horovod, ray, bigdl and spark backends are "
+                              "Only horovod, ray and spark backends are "
                               f"supported for now, got backend: {backend}")
             return None
 
diff --git a/python/orca/src/bigdl/orca/learn/pytorch/pytorch_spark_estimator.py b/python/orca/src/bigdl/orca/learn/pytorch/pytorch_spark_estimator.py
deleted file mode 100644
index 5303c545531..00000000000
--- a/python/orca/src/bigdl/orca/learn/pytorch/pytorch_spark_estimator.py
+++ /dev/null
@@ -1,455 +0,0 @@
-#
-# Copyright 2016 The BigDL Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-from bigdl.dllib.utils.file_utils import enable_multi_fs_load, enable_multi_fs_save
-from bigdl.orca.data.utils import row_to_sample, xshard_to_sample
-from bigdl.orca.learn.utils import convert_predict_rdd_to_dataframe, bigdl_metric_results_to_dict, \
-    process_xshards_of_pandas_dataframe
-from bigdl.dllib.estimator.estimator import Estimator as SparkEstimator
-from bigdl.orca.learn.spark_estimator import Estimator as OrcaSparkEstimator
-from bigdl.orca.learn.optimizers import Optimizer as OrcaOptimizer, SGD
-from bigdl.orca.data import SparkXShards
-from bigdl.dllib.optim.optimizer import MaxEpoch, OptimMethod
-from bigdl.dllib.feature.common import FeatureSet
-from torch.optim.optimizer import Optimizer as TorchOptimizer
-from torch.utils.data import DataLoader
-from pyspark.sql import DataFrame
-import torch
-import types
-from bigdl.dllib.utils.log4Error import *
-
-
-class PyTorchSparkEstimator(OrcaSparkEstimator):
-    def __init__(self, model, loss, optimizer, config=None, metrics=None, model_dir=None,
-                 bigdl_type="float"):
-        from bigdl.orca.torch import TorchModel, TorchLoss, TorchOptim
-        self.loss = loss
-        self.optimizer = optimizer
-        self.config = {} if config is None else config
-
-        if self.loss is None:
-            self.loss = TorchLoss()
-        else:
-            self.loss = TorchLoss.from_pytorch(loss)
-        if isinstance(model, types.FunctionType):
-            def model_creator(self):
-                return model(self.config)
-            model = model_creator(self)
-        if self.optimizer is None:
-            from bigdl.orca.learn.optimizers.schedule import Default
-            self.optimizer = SGD(learningrate_schedule=Default()).get_optimizer()
-        elif isinstance(self.optimizer, TorchOptimizer):
-            self.optimizer = TorchOptim.from_pytorch(self.optimizer)
-        elif isinstance(self.optimizer, OrcaOptimizer):
-            self.optimizer = self.optimizer.get_optimizer()
-        else:
-            invalidInputError(False,
-                              "Only PyTorch optimizer and orca optimizer are supported")
-        from bigdl.orca.learn.metrics import Metric
-        self.metrics = Metric.convert_metrics_list(metrics)
-        self.log_dir = None
-        self.app_name = None
-        self.model_dir = model_dir
-        self.model = TorchModel.from_pytorch(model)
-        self.estimator = SparkEstimator(self.model, self.optimizer, model_dir,
-                                        bigdl_type=bigdl_type)
-
-    def _handle_dataframe(self, data, validation_data, feature_cols, label_cols):
-        schema = data.schema
-        train_rdd = data.rdd.map(lambda row: row_to_sample(row, schema, feature_cols, label_cols))
-        train_feature_set = FeatureSet.sample_rdd(train_rdd)
-        if validation_data is None:
-            val_feature_set = None
-        else:
-            invalidInputError(isinstance(validation_data, DataFrame),
-                              "validation_data should also be a DataFrame")
-            val_feature_set = FeatureSet.sample_rdd(validation_data.rdd.map(
-                lambda row: row_to_sample(row, schema, feature_cols, label_cols)))
-
-        return train_feature_set, val_feature_set
-
-    def _handle_xshards(self, data, validation_data):
-        train_rdd = data.rdd.flatMap(xshard_to_sample)
-        train_feature_set = FeatureSet.sample_rdd(train_rdd)
-        if validation_data is None:
-            val_feature_set = None
-        else:
-            invalidInputError(isinstance(validation_data, SparkXShards),
-                              "validation_data should be a SparkXShards")
-            val_feature_set = FeatureSet.sample_rdd(validation_data.rdd.flatMap(xshard_to_sample))
-        return train_feature_set, val_feature_set
-
-    def _handle_data_loader(self, data, validation_data):
-        train_feature_set = FeatureSet.pytorch_dataloader(data, "", "")
-        if validation_data is None:
-            val_feature_set = None
-        else:
-            invalidInputError(isinstance(validation_data, DataLoader) or callable(data),
-                              "validation_data should be a pytorch DataLoader or a"
-                              " callable data_creator")
-            val_feature_set = FeatureSet.pytorch_dataloader(validation_data)
-
-        return train_feature_set, val_feature_set
-
-    def fit(self, data, epochs=1, batch_size=None, feature_cols=None, label_cols=None,
-            validation_data=None, checkpoint_trigger=None):
-        """
-        Train this torch model with train data.
-
-        :param data: train data. It can be a XShards, Spark Dataframe, PyTorch DataLoader and
-               PyTorch DataLoader creator function that takes config and batch_size as argument and
-               returns a PyTorch DataLoader for training.
-               If data is an XShards, each partition can be a Pandas DataFrame or a dictionary of
-               {'x': feature, 'y': label}, where feature(label) is a numpy array or
-               a list of numpy arrays.
-        :param epochs: Number of epochs to train the model. Default: 1.
-        :param batch_size: Batch size used for training. Only used when data is an XShards.
-               Default: 32.
-        :param feature_cols: Feature column name(s) of data. Only used when data
-               is a Spark DataFrame or an XShards of Pandas DataFrame. Default: None.
-        :param label_cols: Label column name(s) of data. Only used when data is
-               a Spark DataFrame or an XShards of Pandas DataFrame. Default: None.
-        :param validation_data: Validation data. XShards, PyTorch DataLoader and PyTorch DataLoader
-               creator function are supported.
-               If data is XShards, each partition can be a Pandas DataFrame or a dictionary of
-               {'x': feature, 'y': label}, where feature(label) is a numpy array or a list of
-               numpy arrays.
-        :param checkpoint_trigger: Orca Trigger to set a checkpoint.
-        :return: The trained estimator object.
-        """
-        from bigdl.orca.learn.trigger import Trigger
-
-        end_trigger = MaxEpoch(epochs)
-        if isinstance(data, DataLoader):
-            invalidInputError(batch_size is None and data.batch_size > 0,
-                              "When using PyTorch Dataloader as input, you need to specify"
-                              " the batch size in DataLoader and don't specify batch_size"
-                              " in the fit method.")
-        else:
-            invalidInputError(batch_size is not None and batch_size > 0,
-                              "batch_size should be greater than 0")
-        checkpoint_trigger = Trigger.convert_trigger(checkpoint_trigger)
-
-        if self.log_dir is not None and self.app_name is not None:
-            self.estimator.set_tensorboard(self.log_dir, self.app_name)
-
-        if validation_data:
-            invalidInputError(self.metrics is not None,
-                              "You should provide metrics when creating this estimator"
-                              " if you provide validation_data.")
-
-        if isinstance(data, SparkXShards):
-            if data._get_class_name() == 'pandas.core.frame.DataFrame':
-                data, validation_data = process_xshards_of_pandas_dataframe(data, feature_cols,
-                                                                            label_cols,
-                                                                            validation_data,
-                                                                            mode="fit")
-            train_fset, val_fset = self._handle_xshards(data, validation_data)
-            self.estimator.train(train_fset, self.loss, end_trigger, checkpoint_trigger,
-                                 val_fset, self.metrics, batch_size)
-        elif isinstance(data, DataFrame):
-            train_fset, val_fset = self._handle_dataframe(data, validation_data,
-                                                          feature_cols, label_cols)
-            self.estimator.train(train_fset, self.loss, end_trigger, checkpoint_trigger,
-                                 val_fset, self.metrics, batch_size)
-        elif isinstance(data, DataLoader) or callable(data) or isinstance(data, types.FunctionType):
-            if isinstance(data, types.FunctionType):
-                data, validation_data = data(self.config, batch_size), validation_data(self.config,
-                                                                                       batch_size)
-            train_fset, val_fset = self._handle_data_loader(data, validation_data)
-            self.estimator.train_minibatch(train_fset, self.loss, end_trigger,
-                                           checkpoint_trigger, val_fset, self.metrics)
-        else:
-            invalidInputError(False,
-                              "Data and validation data should be SparkXShards, DataLoaders or "
-                              "callable data_creators but get " + data.__class__.__name__)
-
-        return self
-
-    def predict(self, data, batch_size=4, feature_cols=None):
-        """
-        Predict input data.
-
-        :param data: data to be predicted. It can be an XShards or a Spark Dataframe.
-               If it is an XShards, each partition can be a Pandas DataFrame or a dictionary of
-               {'x': feature}, where feature is a numpy array or a list of numpy arrays.
-        :param batch_size: batch size used for inference.
-        :param feature_cols: Feature column name(s) of data. Only used when data
-               is a Spark DataFrame or an XShards of Pandas DataFrame. Default: None.
-        :return: predicted result. The predict result is a XShards, each partition of the XShards
-                 is a dictionary of {'prediction': result}, where result is a numpy array or a list
-                 of numpy arrays.
-        """
-        from bigdl.orca.learn.utils import convert_predict_rdd_to_xshard
-        if isinstance(data, SparkXShards):
-            if data._get_class_name() == 'pandas.core.frame.DataFrame':
-                data = process_xshards_of_pandas_dataframe(data, feature_cols)
-            from bigdl.orca.data.utils import xshard_to_sample
-            data_rdd = data.rdd.flatMap(xshard_to_sample)
-
-        elif isinstance(data, DataFrame):
-            schema = data.schema
-            data_rdd = data.rdd.map(lambda row: row_to_sample(row, schema,
-                                                              feature_cols, None))
-        else:
-            invalidInputError(False,
-                              "Data should be XShards, each element needs to be {'x': a feature "
-                              "numpy array}.")
-        predicted_rdd = self.model.predict(data_rdd, batch_size=batch_size)
-
-        if isinstance(data, SparkXShards):
-            result = convert_predict_rdd_to_xshard(data, predicted_rdd)
-        else:
-            result = convert_predict_rdd_to_dataframe(data, predicted_rdd)
-        return result
-
-    def evaluate(self, data, batch_size=None, feature_cols=None, label_cols=None,
-                 validation_metrics=None):
-        """
-        Evaluate model.
-
-        :param data: data: evaluation data. It can be an XShards, Spark Dataframe,
-               PyTorch DataLoader and PyTorch DataLoader creator function.
-               If data is an XShards, each partition can be a Pandas DataFrame or a dictionary of
-               {'x': feature, 'y': label}, where feature(label) is a numpy array or a list of
-               numpy arrays.
-        :param batch_size: Batch size used for evaluation. Only used when data is a SparkXShard.
-        :param feature_cols: Feature column name(s) of data. Only used when data
-               is a Spark DataFrame or an XShards of Pandas DataFrame. Default: None.
-        :param label_cols: Label column name(s) of data. Only used when data is
-               a Spark DataFrame or an XShards of Pandas DataFrame. Default: None.
-        :param validation_metrics: Orca validation metrics to be computed on validation_data.
-        :return: validation results.
-        """
-        from bigdl.orca.data.utils import xshard_to_sample
-
-        invalidInputError(data is not None, "validation data shouldn't be None")
-        invalidInputError(self.metrics is not None,
-                          "metrics shouldn't be None, please specify the metrics argument"
-                          " when creating this estimator.")
-        if isinstance(data, DataLoader):
-            invalidInputError(batch_size is None and data.batch_size > 0,
-                              "When using PyTorch Dataloader as input, you need to specify"
-                              " the batch size in DataLoader and don't specify batch_size"
-                              " in the fit method.")
-        else:
-            invalidInputError(batch_size is not None and batch_size > 0,
-                              "batch_size should be greater than 0")
-
-        if isinstance(data, SparkXShards):
-            if data._get_class_name() == 'pandas.core.frame.DataFrame':
-                data = process_xshards_of_pandas_dataframe(data, feature_cols, label_cols)
-            val_feature_set = FeatureSet.sample_rdd(data.rdd.flatMap(xshard_to_sample))
-            result = self.estimator.evaluate(val_feature_set, self.metrics, batch_size)
-        elif isinstance(data, DataFrame):
-            schema = data.schema
-            val_feature_set = FeatureSet.sample_rdd(data.rdd.map(
-                lambda row: row_to_sample(row, schema, feature_cols, label_cols)))
-            result = self.estimator.evaluate(val_feature_set, self.metrics, batch_size)
-        elif isinstance(data, DataLoader) or callable(data) or isinstance(data, types.FunctionType):
-            if isinstance(data, types.FunctionType):
-                data = data(self.config, batch_size)
-            val_feature_set = FeatureSet.pytorch_dataloader(data)
-            result = self.estimator.evaluate_minibatch(val_feature_set, self.metrics)
-        else:
-            invalidInputError(False,
-                              "Data should be a SparkXShards, a DataLoader or a callable "
-                              "data_creator, but get " + data.__class__.__name__)
-        return bigdl_metric_results_to_dict(result)
-
-    def get_model(self):
-        """
-        Get the trained PyTorch model.
-
-        :return: The trained PyTorch model.
-        """
-        return self.model.to_pytorch()
-
-    def _get_optimizer_path(self, model_path):
-        if "." in model_path:
-            path_split = model_path.rsplit('.', 1)
-            return path_split[0] + "_optim." + path_split[1]
-        else:
-            return model_path + "_optim"
-
-    @enable_multi_fs_save
-    def save(self, model_path):
-        """
-        Saves the Estimator state (including model and optimizer) to the provided model_path.
-
-        :param model_path: path to save the model.
-        :return: model_path
-        """
-
-        optim_path = self._get_optimizer_path(model_path)
-        torch.save(self.get_model().state_dict(), model_path)
-        if self.optimizer is not None:
-            self.optimizer.save(path=optim_path, overWrite=True)
-
-        return model_path
-
-    @enable_multi_fs_load
-    def load(self, model_path):
-        """
-        Load the Estimator state (model and possibly with optimizer) from provided model_path.
-        The model file should be generated by the save method of this estimator, or by
-        ``torch.save(state_dict, model_path)``, where `state_dict` can be obtained by
-        the ``state_dict()`` method of a pytorch model.
-
-        :param model_path: path to the saved model.
-        :return:
-        """
-
-        from bigdl.orca.torch import TorchModel
-        import os
-
-        try:
-            pytorch_model = self.get_model()
-            pytorch_model.load_state_dict(torch.load(model_path))
-            self.model = TorchModel.from_pytorch(pytorch_model)
-        except Exception:
-            invalidInputError(False,
-                              "Cannot load the PyTorch model. Please check your model path.")
-
-        optim_path = self._get_optimizer_path(model_path)
-        if os.path.isfile(optim_path):
-            try:
-                self.optimizer = OptimMethod.load(optim_path)
-            except Exception:
-                invalidInputError(False,
-                                  "Cannot load the optimizer. Only `bigdl.dllib.optim.optimizer."
-                                  "OptimMethod` is supported for loading.")
-        else:
-            self.optimizer = None
-
-        self.estimator = SparkEstimator(self.model, self.optimizer, self.model_dir)
-
-    def __load_bigdl_model(self, path, bigdl_type="float"):
-        from bigdl.dllib.utils.common import callBigDlFunc
-        from bigdl.dllib.nn.layer import Layer
-        jmodel = callBigDlFunc(bigdl_type, "loadBigDL", path)
-        return Layer.of(jmodel)
-
-    def load_orca_checkpoint(self, path, version=None, prefix=None):
-        """
-        Load existing checkpoint. To load a specific checkpoint, please provide both `version` and
-        `perfix`. If `version` is None, then the latest checkpoint will be loaded.
-
-        :param path: Path to the existing checkpoint (or directory containing Orca checkpoint
-               files).
-        :param version: checkpoint version, which is the suffix of model.* file, i.e., for
-               modle.4 file, the version is 4. If it is None, then load the latest checkpoint.
-        :param prefix: optimMethod prefix, for example 'optimMethod-TorchModelf53bddcc'.
-        :return:
-        """
-        import os
-        from bigdl.dllib.nn.layer import Model
-        from bigdl.dllib.optim.optimizer import OptimMethod
-        from bigdl.orca.learn.utils import find_latest_checkpoint
-        from bigdl.orca.torch import TorchModel
-
-        if version is None:
-            path, prefix, version = find_latest_checkpoint(path, model_type="pytorch")
-            if path is None:
-                invalidInputError(False,
-                                  "Cannot find PyTorch checkpoint, please check your checkpoint"
-                                  " path.")
-        else:
-            invalidInputError(prefix is not None,
-                              "You should provide optimMethod prefix,"
-                              " for example 'optimMethod-TorchModelf53bddcc'")
-
-        try:
-            loaded_model = self.__load_bigdl_model(os.path.join(path, "model.{}".format(version)))
-            self.model = TorchModel.from_value(loaded_model.value)
-            self.optimizer = OptimMethod.load(os.path.join(path, "{}.{}".format(prefix, version)))
-        except Exception as e:
-            invalidInputError(False,
-                              "Cannot load PyTorch checkpoint, please check your checkpoint path "
-                              "and checkpoint type." + str(e))
-        self.estimator = SparkEstimator(self.model, self.optimizer, self.model_dir)
-
-    def get_train_summary(self, tag=None):
-        """
-        Get the scalar from model train summary.
-
-        This method will return a list of summary data of
-        [iteration_number, scalar_value, timestamp].
-
-        :param tag: The string variable represents the scalar wanted
-        """
-        return self.estimator.get_train_summary(tag=tag)
-
-    def get_validation_summary(self, tag=None):
-        """
-        Get the scalar from model validation summary.
-
-        This method will return a list of summary data of
-        [iteration_number, scalar_value, timestamp].
-        Note that the metric and tag may not be consistent.
-        Please look up following form to pass tag parameter.
-        Left side is your metric during compile.
-        Right side is the tag you should pass.
-
-        >>> 'Accuracy'                  |   'Top1Accuracy'
-        >>> 'BinaryAccuracy'            |   'Top1Accuracy'
-        >>> 'CategoricalAccuracy'       |   'Top1Accuracy'
-        >>> 'SparseCategoricalAccuracy' |   'Top1Accuracy'
-        >>> 'AUC'                       |   'AucScore'
-        >>> 'HitRatio'                  |   'HitRate@k' (k is Top-k)
-        >>> 'Loss'                      |   'Loss'
-        >>> 'MAE'                       |   'MAE'
-        >>> 'NDCG'                      |   'NDCG'
-        >>> 'TFValidationMethod'        |   '${name + " " + valMethod.toString()}'
-        >>> 'Top5Accuracy'              |   'Top5Accuracy'
-        >>> 'TreeNNAccuracy'            |   'TreeNNAccuracy()'
-        >>> 'MeanAveragePrecision'      |   'MAP@k' (k is Top-k) (BigDL)
-        >>> 'MeanAveragePrecision'      |   'PascalMeanAveragePrecision' (Zoo)
-        >>> 'StatelessMetric'           |   '${name}'
-
-        :param tag: The string variable represents the scalar wanted
-        """
-        return self.estimator.get_validation_summary(tag=tag)
-
-    def clear_gradient_clipping(self):
-        """
-        Clear gradient clipping parameters. In this case, gradient clipping will not be applied.
-        In order to take effect, it needs to be called before fit.
-
-        :return:
-        """
-        self.estimator.clear_gradient_clipping()
-
-    def set_constant_gradient_clipping(self, min, max):
-        """
-        Set constant gradient clipping during the training process.
-        In order to take effect, it needs to be called before fit.
-
-        :param min: The minimum value to clip by.
-        :param max: The maximum value to clip by.
-        :return:
-        """
-        self.estimator.set_constant_gradient_clipping(min=min, max=max)
-
-    def set_l2_norm_gradient_clipping(self, clip_norm):
-        """
-        Clip gradient to a maximum L2-Norm during the training process.
-        In order to take effect, it needs to be called before fit.
-
-        :param clip_norm: Gradient L2-Norm threshold.
-        :return:
-        """
-        self.estimator.set_l2_norm_gradient_clipping(clip_norm=clip_norm)
diff --git a/python/orca/src/bigdl/orca/torch/__init__.py b/python/orca/src/bigdl/orca/torch/__init__.py
index 7a2c54eec96..b705daec28e 100644
--- a/python/orca/src/bigdl/orca/torch/__init__.py
+++ b/python/orca/src/bigdl/orca/torch/__init__.py
@@ -14,6 +14,7 @@
 # limitations under the License.
 #
 
+# TODO(will delete in 2.2.0)
 from .torch_loss import TorchLoss
 from .torch_model import TorchModel
 from .torch_optim import TorchOptim
diff --git a/python/orca/src/bigdl/orca/torch/torch_loss.py b/python/orca/src/bigdl/orca/torch/torch_loss.py
index c563e521701..b50501d6a5a 100644
--- a/python/orca/src/bigdl/orca/torch/torch_loss.py
+++ b/python/orca/src/bigdl/orca/torch/torch_loss.py
@@ -18,6 +18,7 @@
 from pyspark.serializers import CloudPickleSerializer
 from importlib.util import find_spec
 from bigdl.dllib.utils.log4Error import invalidInputError
+from deprecated import deprecated
 
 if sys.version < '3.7':
     print("WARN: detect python < 3.7, if you meet zlib not available " +
@@ -27,6 +28,7 @@
     invalidInputError(False, "jep not found, please install jep first.")
 
 
+@deprecated(version='2.3.0', reason="Please use spark engine and ray engine.")
 class TorchLoss(Criterion):
     """
     TorchLoss wraps a loss function for distributed inference or training.
diff --git a/python/orca/src/bigdl/orca/torch/torch_model.py b/python/orca/src/bigdl/orca/torch/torch_model.py
index 551ac50d318..9cca997d572 100644
--- a/python/orca/src/bigdl/orca/torch/torch_model.py
+++ b/python/orca/src/bigdl/orca/torch/torch_model.py
@@ -25,6 +25,7 @@
 from bigdl.orca.torch import zoo_pickle_module
 from importlib.util import find_spec
 from bigdl.dllib.utils.log4Error import *
+from deprecated import deprecated
 
 if sys.version < '3.7':
     print("WARN: detect python < 3.7, if you meet zlib not available " +
@@ -34,6 +35,7 @@
     invalidInputError(False, "jep not found, please install jep first.")
 
 
+@deprecated(version='2.3.0', reason="Please use spark engine and ray engine.")
 class TorchModel(Layer):
     """
     TorchModel wraps a PyTorch model as a single layer, thus the PyTorch model can be used for
diff --git a/python/orca/src/bigdl/orca/torch/torch_optim.py b/python/orca/src/bigdl/orca/torch/torch_optim.py
index 22498416456..0b922b706b4 100644
--- a/python/orca/src/bigdl/orca/torch/torch_optim.py
+++ b/python/orca/src/bigdl/orca/torch/torch_optim.py
@@ -20,12 +20,14 @@
 from bigdl.orca.torch import zoo_pickle_module
 from bigdl.dllib.optim.optimizer import OptimMethod
 from bigdl.dllib.utils.log4Error import invalidInputError
+from deprecated import deprecated
 
 
 if find_spec('jep') is None:
     invalidInputError(False, "jep not found, please install jep first.")
 
 
+@deprecated(version='2.3.0', reason="Please use spark engine and ray engine.")
 class TorchOptim(OptimMethod):
     """
     TorchOptim wraps a torch optimizer for distributed inference or training.
diff --git a/python/orca/src/bigdl/orca/torch/utils.py b/python/orca/src/bigdl/orca/torch/utils.py
index ba84b29de5d..4e971761851 100644
--- a/python/orca/src/bigdl/orca/torch/utils.py
+++ b/python/orca/src/bigdl/orca/torch/utils.py
@@ -16,8 +16,10 @@
 from torch.utils.data.sampler import Sampler
 import math
 from bigdl.dllib.utils.log4Error import *
+from deprecated import deprecated
 
 
+@deprecated(version='2.3.0', reason="Please use spark engine and ray engine.")
 def trainable_param(model):
     training = []
     for p in model.parameters():
@@ -26,6 +28,7 @@ def trainable_param(model):
     return training
 
 
+@deprecated(version='2.3.0', reason="Please use spark engine and ray engine.")
 class DistributedSequentialSampler(Sampler):
     """
     A sequential sampler used in FeatureSet when get (train=false) iterator .
diff --git a/python/orca/src/bigdl/orca/torch/zoo_pickle_module.py b/python/orca/src/bigdl/orca/torch/zoo_pickle_module.py
index 7045161a20d..65f774b28b4 100644
--- a/python/orca/src/bigdl/orca/torch/zoo_pickle_module.py
+++ b/python/orca/src/bigdl/orca/torch/zoo_pickle_module.py
@@ -19,6 +19,7 @@
 ``pickle_module`` parameter of PyTorch's model persistence function: ``torch.save``
 and ``torch.load``.
 TODO: remove this when PyTorch have compatible pickling APIs.
+TODO(will delete in future)
 """
 from cloudpickle import *
 from cloudpickle import CloudPickler as Pickler
diff --git a/scala/orca/pom.xml b/scala/orca/pom.xml
index 1bf8b120a21..374f38d2e0a 100644
--- a/scala/orca/pom.xml
+++ b/scala/orca/pom.xml
@@ -222,7 +222,7 @@
         <dependency>
             <groupId>black.ninia</groupId>
             <artifactId>jep</artifactId>
-            <version>3.9.0</version>
+            <version>3.9.1</version>
         </dependency>
         <dependency>
             <groupId>org.reflections</groupId>
diff --git a/scala/orca/src/main/scala/com/intel/analytics/bigdl/orca/net/PythonFeatureSet.scala b/scala/orca/src/main/scala/com/intel/analytics/bigdl/orca/net/PythonFeatureSet.scala
index 6b886ea3747..bd9c222b235 100644
--- a/scala/orca/src/main/scala/com/intel/analytics/bigdl/orca/net/PythonFeatureSet.scala
+++ b/scala/orca/src/main/scala/com/intel/analytics/bigdl/orca/net/PythonFeatureSet.scala
@@ -46,6 +46,7 @@ import org.apache.spark.storage.StorageLevel
 
 import scala.reflect.ClassTag
 
+@deprecated("don't use this, will be remove in the future")
 object PythonFeatureSet{
 
   private[bigdl] def python[T: ClassTag](
@@ -152,6 +153,7 @@ object PythonFeatureSet{
   }
 }
 
+@deprecated("don't use this, will be remove in the future")
 class PythonFeatureSet[T: ClassTag](
                                      dataset: Array[Byte],
                                      getLoader: (Int, Int, String) => String,
diff --git a/scala/orca/src/main/scala/com/intel/analytics/bigdl/orca/net/TorchLoss.scala b/scala/orca/src/main/scala/com/intel/analytics/bigdl/orca/net/TorchLoss.scala
index 36fea171f8c..37c403f415a 100644
--- a/scala/orca/src/main/scala/com/intel/analytics/bigdl/orca/net/TorchLoss.scala
+++ b/scala/orca/src/main/scala/com/intel/analytics/bigdl/orca/net/TorchLoss.scala
@@ -24,6 +24,7 @@ import jep.NDArray
 import org.apache.spark.TaskContext
 import com.intel.analytics.bigdl.dllib.utils.Log4Error
 
+@deprecated("don't use this, will be remove in the future")
 class TorchLoss(private val criterionHolder: Array[Byte])
   extends AbstractCriterion[Activity, Activity, Float]() {
   import TorchLoss._
diff --git a/scala/orca/src/main/scala/com/intel/analytics/bigdl/orca/net/TorchModel.scala b/scala/orca/src/main/scala/com/intel/analytics/bigdl/orca/net/TorchModel.scala
index 1f74f76d786..e1a20de11d7 100644
--- a/scala/orca/src/main/scala/com/intel/analytics/bigdl/orca/net/TorchModel.scala
+++ b/scala/orca/src/main/scala/com/intel/analytics/bigdl/orca/net/TorchModel.scala
@@ -32,6 +32,7 @@ import jep.{Jep, NDArray}
 import org.apache.spark.TaskContext
 import com.intel.analytics.bigdl.dllib.nn.Utils._
 
+@deprecated("don't use this, will be remove in the future")
 class TorchModel (
     private[bigdl] val modelHolder: TorchModel2Holder,
     init_weights: Array[Float])
diff --git a/scala/orca/src/main/scala/com/intel/analytics/bigdl/orca/net/TorchOptim.scala b/scala/orca/src/main/scala/com/intel/analytics/bigdl/orca/net/TorchOptim.scala
index 8087f2bed58..909ad145319 100644
--- a/scala/orca/src/main/scala/com/intel/analytics/bigdl/orca/net/TorchOptim.scala
+++ b/scala/orca/src/main/scala/com/intel/analytics/bigdl/orca/net/TorchOptim.scala
@@ -28,6 +28,7 @@ import com.intel.analytics.bigdl.dllib.keras.models.InternalOptimizerUtil
 import com.intel.analytics.bigdl.orca.net.TorchOptim.DecayType
 import com.intel.analytics.bigdl.dllib.utils.Log4Error
 
+@deprecated("don't use this, will be remove in the future")
 class TorchOptim[@specialized(Float, Double) T: ClassTag](
     torchOptim: Array[Byte],
     decayType: DecayType)(implicit ev: TensorNumeric[T]) extends OptimMethod[T] {
diff --git a/scala/orca/src/main/scala/com/intel/analytics/bigdl/orca/net/python/PythonZooNet.scala b/scala/orca/src/main/scala/com/intel/analytics/bigdl/orca/net/python/PythonZooNet.scala
index 8a8d41c8e23..915c54ec595 100644
--- a/scala/orca/src/main/scala/com/intel/analytics/bigdl/orca/net/python/PythonZooNet.scala
+++ b/scala/orca/src/main/scala/com/intel/analytics/bigdl/orca/net/python/PythonZooNet.scala
@@ -142,22 +142,27 @@ class PythonZooNet[T: ClassTag](implicit ev: TensorNumeric[T]) extends PythonZoo
     model.getExtraParameter().map(toJTensor)
   }
 
+  @deprecated("don't use this, will be remove in the future")
   def createTorchModel(model: Array[Byte], weights: JTensor): TorchModel = {
     TorchModel(model, weights.storage)
   }
 
+  @deprecated("don't use this, will be remove in the future")
   def getTorchModelBytes(torchModel: TorchModel): Array[Byte] = {
     torchModel.modelHolder.torchBytes
   }
 
+  @deprecated("don't use this, will be remove in the future")
   def createTorchLoss(criterion: Array[Byte]): TorchLoss = {
     TorchLoss(criterion)
   }
 
+  @deprecated("don't use this, will be remove in the future")
   def createTorchOptim(optim: Array[Byte], decayType: String): TorchOptim[T] = {
     TorchOptim(optim, decayType)
   }
 
+  @deprecated("don't use this, will be remove in the future")
   def createFeatureSetFromTfDataset(
        dataset: Array[Byte],
        totalSize: Int): PythonFeatureSet[MiniBatch[Float]] = {
@@ -192,6 +197,7 @@ class PythonZooNet[T: ClassTag](implicit ev: TensorNumeric[T]) extends PythonZoo
       "data", "", totalSize, imports)
   }
 
+  @deprecated("don't use this, will be remove in the future")
   def createFeatureSetFromPyTorch(
        dataloader: Array[Byte],
        creator: Boolean,
diff --git a/scala/orca/src/main/scala/com/intel/analytics/bigdl/orca/utils/PythonInterpreter.scala b/scala/orca/src/main/scala/com/intel/analytics/bigdl/orca/utils/PythonInterpreter.scala
index accdfce4bfb..4d23c650c96 100644
--- a/scala/orca/src/main/scala/com/intel/analytics/bigdl/orca/utils/PythonInterpreter.scala
+++ b/scala/orca/src/main/scala/com/intel/analytics/bigdl/orca/utils/PythonInterpreter.scala
@@ -23,6 +23,7 @@ import org.apache.logging.log4j.LogManager
 import scala.concurrent.{Await, ExecutionContext, Future}
 import scala.concurrent.duration.Duration
 
+@deprecated("don't use this, will be remove in the future")
 object PythonInterpreter {
   protected val logger = LogManager.getLogger(this.getClass)
 


Code review comments:
diff_hunk: @@ -52,7 +52,7 @@ runs:
         pip install -i https://pypi.org/simple --pre bigdl
         pip install -i ${GONDOLIN_PIP_MIRROR} --trusted-host ${GONDOLIN_TRUSTED_HOST} torch==1.7.1 torchvision==0.8.2
         pip install -i ${GONDOLIN_PIP_MIRROR} --trusted-host ${GONDOLIN_TRUSTED_HOST} six cloudpickle
path: .github/actions/colab/colab-python-py37-pytorch/action.yml
text: @user1:
can we also delete these two dependencies?

@author:
removed

diff_hunk: @@ -14,6 +14,7 @@
 # limitations under the License.
 #
 
+# TODO(will delete in 2.2.0)
path: python/orca/src/bigdl/orca/torch/__init__.py
text: @user1:
is 2.2.0 correct? Next version is 2.3.0

diff_hunk: @@ -46,6 +46,7 @@ import org.apache.spark.storage.StorageLevel
 
 import scala.reflect.ClassTag
 
+@deprecated("don't use this, will be remove in the future")
path: scala/orca/src/main/scala/com/intel/analytics/bigdl/orca/net/PythonFeatureSet.scala
text: @user1:
remove -> removed