{ "cells": [ { "attachments": {}, "cell_type": "markdown", "id": "7a982d9b", "metadata": {}, "source": [ "# Homo-NN Customize Model" ] }, { "attachments": {}, "cell_type": "markdown", "id": "5040f034", "metadata": {}, "source": [ "# Build a model\n", "\n", "In FATE 1.10, you can use the pipeline to submit a PyTorch Sequential model. However, the Sequential model, in combination with PyTorch's built-in layers, may not be sufficient for representing more complex models. For instance, when constructing a residual module similar to those found in ResNet, the output of some modules needs to be reused, which may not be possible using the Sequential model.\n", "\n", "To address this issue, the model_zoo module was introduced in FATE 1.10, located under [federatedml.nn.model_zoo](../../../../python/federatedml/nn/model_zoo/). This module allows you to customize your own PyTorch model, provided that it is developed based on torch.nn.Module and implements the forward interface. For more information, see the PyTorch documentation [Pytorch Module](https://pytorch.org/docs/stable/notes/modules.html#a-simple-custom-module) on custom modules. To use your custom model in a federated task, simply place it in the federatedml/nn/model_zoo directory and specify the module and model class through the interface when submitting the task. Homo-NN will automatically search and import the model you have implemented.\n", "\n", "As an example, consider the task of MNIST handwriting recognition. We can first write a simple neural network module with residual connections locally, and then use it in a federated task.\n", "\n", "## A Customized Model\n", "\n", "Name the model code image_net.py, you can put it directly under federatedml/nn/model_zoo or use the shortcut interface of jupyter notebook to save it directly to federatedml/nn/model_zoo" ] }, { "cell_type": "code", "execution_count": 21, "id": "a2f1a13f", "metadata": {}, "outputs": [], "source": [ "from pipeline.component.nn import save_to_fate" ] }, { "cell_type": "code", "execution_count": 22, "id": "8b1a1061", "metadata": {}, "outputs": [], "source": [ "%%save_to_fate model image_net.py\n", "import torch as t\n", "from torch import nn\n", "from torch.nn import Module\n", "\n", "# the residual component\n", "class Residual(Module):\n", "\n", " def __init__(self, ch, kernel_size=3, padding=1):\n", " super(Residual, self).__init__()\n", " self.convs = t.nn.ModuleList([nn.Conv2d(ch, ch, kernel_size=kernel_size, padding=padding) for i in range(2)])\n", " self.act = nn.ReLU()\n", "\n", " def forward(self, x):\n", " x = self.act(self.convs[0](x))\n", " x_ = self.convs[1](x)\n", " return self.act(x + x_)\n", "\n", "\n", "# we call it image net\n", "class ImgNet(nn.Module):\n", " def __init__(self, class_num=10):\n", " super(ImgNet, self).__init__()\n", " self.seq = t.nn.Sequential(\n", " nn.Conv2d(in_channels=3, out_channels=12, kernel_size=5),\n", " Residual(12),\n", " nn.MaxPool2d(kernel_size=3),\n", " nn.Conv2d(in_channels=12, out_channels=12, kernel_size=3),\n", " Residual(12),\n", " nn.AvgPool2d(kernel_size=3)\n", " )\n", " \n", " self.fc = t.nn.Sequential(\n", " nn.Linear(48, 32),\n", " nn.ReLU(),\n", " nn.Linear(32, class_num)\n", " )\n", " self.softmax = nn.Softmax(dim=1)\n", "\n", " def forward(self, x):\n", " x = self.seq(x)\n", " x = x.flatten(start_dim=1)\n", " x = self.fc(x)\n", " if self.training:\n", " return x\n", " else:\n", " return self.softmax(x)" ] }, { "cell_type": "code", "execution_count": 23, "id": "081c727b", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "ImgNet(\n", " (seq): Sequential(\n", " (0): Conv2d(3, 12, kernel_size=(5, 5), stride=(1, 1))\n", " (1): Residual(\n", " (convs): ModuleList(\n", " (0): Conv2d(12, 12, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))\n", " (1): Conv2d(12, 12, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))\n", " )\n", " (act): ReLU()\n", " )\n", " (2): MaxPool2d(kernel_size=3, stride=3, padding=0, dilation=1, ceil_mode=False)\n", " (3): Conv2d(12, 12, kernel_size=(3, 3), stride=(1, 1))\n", " (4): Residual(\n", " (convs): ModuleList(\n", " (0): Conv2d(12, 12, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))\n", " (1): Conv2d(12, 12, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))\n", " )\n", " (act): ReLU()\n", " )\n", " (5): AvgPool2d(kernel_size=3, stride=3, padding=0)\n", " )\n", " (fc): Sequential(\n", " (0): Linear(in_features=48, out_features=32, bias=True)\n", " (1): ReLU()\n", " (2): Linear(in_features=32, out_features=10, bias=True)\n", " )\n", " (softmax): Softmax(dim=1)\n", ")" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "img_model = ImgNet(10)\n", "img_model" ] }, { "cell_type": "code", "execution_count": 24, "id": "dd36497e", "metadata": {}, "outputs": [], "source": [ "from federatedml.nn.dataset.image import ImageDataset\n", "\n", "ds = ImageDataset()\n", "ds.load('../../../../examples/data/mnist/')" ] }, { "cell_type": "code", "execution_count": 25, "id": "64b748a3", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "tensor([[ 1.3241e-01, 1.3432e-01, 3.6705e-02, 3.9092e-02, -1.2944e-01,\n", " 5.4261e-02, -1.8467e-01, 1.0478e-01, 1.0396e-03, 4.6396e-02],\n", " [ 1.3575e-01, 1.3287e-01, 3.7010e-02, 3.5438e-02, -1.3169e-01,\n", " 4.9747e-02, -1.8520e-01, 1.0215e-01, 3.3909e-03, 4.6577e-02],\n", " [ 1.3680e-01, 1.3542e-01, 3.6674e-02, 3.4830e-02, -1.3046e-01,\n", " 4.8866e-02, -1.8568e-01, 1.0199e-01, 4.7719e-03, 4.7090e-02],\n", " [ 1.3564e-01, 1.3297e-01, 3.6487e-02, 3.5213e-02, -1.3040e-01,\n", " 5.0300e-02, -1.8406e-01, 1.0286e-01, 3.6997e-03, 4.4414e-02],\n", " [ 1.3091e-01, 1.3101e-01, 3.5820e-02, 3.9637e-02, -1.3302e-01,\n", " 5.2289e-02, -1.8336e-01, 1.0439e-01, 2.8879e-03, 4.4465e-02],\n", " [ 1.3206e-01, 1.3344e-01, 3.7300e-02, 3.8817e-02, -1.3155e-01,\n", " 5.3004e-02, -1.8556e-01, 1.0341e-01, 7.9196e-05, 4.6511e-02],\n", " [ 1.3058e-01, 1.3162e-01, 3.5691e-02, 4.0402e-02, -1.3395e-01,\n", " 5.1268e-02, -1.8198e-01, 1.0670e-01, 3.6078e-03, 4.4348e-02],\n", " [ 1.3416e-01, 1.3208e-01, 3.6845e-02, 3.6941e-02, -1.3210e-01,\n", " 5.2559e-02, -1.8635e-01, 1.0151e-01, 1.1148e-03, 4.7174e-02]],\n", " grad_fn=)" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "img_model(i[0])" ] }, { "cell_type": "markdown", "id": "0311ed01", "metadata": {}, "source": [ "## run a local test\n", "\n", "We can use our dataset, custom model, and Trainer for local debugging to test whether the program can run through.\n", "**In the case of local testing, all federation processes will be skipped, and the model will not perform fed averaging**" ] }, { "cell_type": "code", "execution_count": 31, "id": "c53366f3", "metadata": {}, "outputs": [], "source": [ "import torch as t\n", "from federatedml.nn.homo.trainer.fedavg_trainer import FedAVGTrainer\n", "trainer = FedAVGTrainer(epochs=3, batch_size=256, shuffle=True, data_loader_worker=8, pin_memory=False) \n", "trainer.set_model(img_model) # set model" ] }, { "cell_type": "code", "execution_count": 32, "id": "711ef7fa", "metadata": {}, "outputs": [], "source": [ "trainer.local_mode() # !! use local mode to skip federation process !!" ] }, { "cell_type": "code", "execution_count": 33, "id": "0d65f9b8", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "epoch is 0\n", "100%|██████████| 6/6 [00:00<00:00, 7.00it/s]\n", "epoch loss is 1.732767325125185\n", "epoch is 1\n", "100%|██████████| 6/6 [00:01<00:00, 4.28it/s]\n", "epoch loss is 0.9436628721978848\n", "epoch is 2\n", "100%|██████████| 6/6 [00:00<00:00, 6.72it/s]\n", "epoch loss is 0.6457311573421982\n" ] } ], "source": [ "optimizer = t.optim.Adam(img_model.parameters(), lr=0.01)\n", "loss = t.nn.CrossEntropyLoss()\n", "trainer.train(train_set=ds, optimizer=optimizer, loss=loss)" ] }, { "cell_type": "markdown", "id": "e08ed729", "metadata": {}, "source": [ "It works! Now we can submit a federated task." ] }, { "cell_type": "markdown", "id": "413aefa9", "metadata": {}, "source": [ "## Submit a Homo-NN Task with Custom Model" ] }, { "cell_type": "code", "execution_count": 34, "id": "1518af62", "metadata": {}, "outputs": [], "source": [ "import torch as t\n", "from torch import nn\n", "from pipeline import fate_torch_hook\n", "from pipeline.component import HomoNN\n", "from pipeline.backend.pipeline import PipeLine\n", "from pipeline.component import Reader, Evaluation, DataTransform\n", "from pipeline.interface import Data, Model\n", "\n", "t = fate_torch_hook(t)" ] }, { "cell_type": "code", "execution_count": 36, "id": "d900c35a", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'namespace': 'experiment', 'table_name': 'mnist_host'}" ] }, "execution_count": 36, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import os\n", "# bind data path to name & namespace\n", "fate_project_path = os.path.abspath('../../../../')\n", "host = 10000\n", "guest = 9999\n", "arbiter = 10000\n", "pipeline = PipeLine().set_initiator(role='guest', party_id=guest).set_roles(guest=guest, host=host,\n", " arbiter=arbiter)\n", "\n", "data_0 = {\"name\": \"mnist_guest\", \"namespace\": \"experiment\"}\n", "data_1 = {\"name\": \"mnist_host\", \"namespace\": \"experiment\"}\n", "\n", "data_path_0 = fate_project_path + '/examples/data/mnist'\n", "data_path_1 = fate_project_path + '/examples/data/mnist'\n", "pipeline.bind_table(name=data_0['name'], namespace=data_0['namespace'], path=data_path_0)\n", "pipeline.bind_table(name=data_1['name'], namespace=data_1['namespace'], path=data_path_1)" ] }, { "cell_type": "code", "execution_count": 37, "id": "d3af79ff", "metadata": {}, "outputs": [], "source": [ "# 定义reader\n", "reader_0 = Reader(name=\"reader_0\")\n", "reader_0.get_party_instance(role='guest', party_id=guest).component_param(table=data_0)\n", "reader_0.get_party_instance(role='host', party_id=host).component_param(table=data_1)" ] }, { "attachments": {}, "cell_type": "markdown", "id": "73f39b69", "metadata": {}, "source": [ "### nn.CustModel\n", "\n", "After fate_torch_hook, we can use t.nn.CustModel to specify models. You should specify module name and class name here. Model initialization parameters can also be set here. **The initialization parameter must be JSON-serializable, otherwise, this pipeline can not be submitted.**" ] }, { "cell_type": "code", "execution_count": 38, "id": "de9917a7", "metadata": {}, "outputs": [], "source": [ "from pipeline.component.homo_nn import DatasetParam, TrainerParam\n", "\n", "model = t.nn.Sequential(\n", " # the class_num=10 is the initialzation parameter for your model\n", " t.nn.CustModel(module_name='image_net', class_name='ImgNet', class_num=10) \n", ")\n", "\n", "nn_component = HomoNN(name='nn_0',\n", " model=model, # your cust model\n", " loss=t.nn.CrossEntropyLoss(),\n", " optimizer=t.optim.Adam(model.parameters(), lr=0.01),\n", " dataset=DatasetParam(dataset_name='image'), # use image dataset\n", " trainer=TrainerParam(trainer_name='fedavg_trainer', epochs=3, batch_size=1024, validation_freqs=1),\n", " torch_seed=100 # global random seed\n", " )" ] }, { "cell_type": "code", "execution_count": 39, "id": "62361f34", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 39, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pipeline.add_component(reader_0)\n", "pipeline.add_component(nn_component, data=Data(train_data=reader_0.output.data))\n", "pipeline.add_component(Evaluation(name='eval_0', eval_type='multi'), data=Data(data=nn_component.output.data))" ] }, { "cell_type": "code", "execution_count": 40, "id": "1fa46219", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "\u001b[32m2022-12-19 22:07:14.965\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m83\u001b[0m - \u001b[1mJob id is 202212192207123770130\n", "\u001b[0m\n", "\u001b[32m2022-12-19 22:07:14.974\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m98\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KJob is still waiting, time elapse: 0:00:00\u001b[0m\n", "\u001b[32m2022-12-19 22:07:15.990\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m98\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KJob is still waiting, time elapse: 0:00:01\u001b[0m\n", "\u001b[0mm2022-12-19 22:07:17.016\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m125\u001b[0m - \u001b[1m\n", "\u001b[32m2022-12-19 22:07:17.019\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component reader_0, time elapse: 0:00:02\u001b[0m\n", "\u001b[32m2022-12-19 22:07:18.047\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component reader_0, time elapse: 0:00:03\u001b[0m\n", "\u001b[32m2022-12-19 22:07:19.066\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component reader_0, time elapse: 0:00:04\u001b[0m\n", "\u001b[32m2022-12-19 22:07:20.085\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component reader_0, time elapse: 0:00:05\u001b[0m\n", "\u001b[32m2022-12-19 22:07:21.117\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component reader_0, time elapse: 0:00:06\u001b[0m\n", "\u001b[32m2022-12-19 22:07:22.145\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component reader_0, time elapse: 0:00:07\u001b[0m\n", "\u001b[0mm2022-12-19 22:07:24.547\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m125\u001b[0m - \u001b[1m\n", "\u001b[32m2022-12-19 22:07:24.552\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:09\u001b[0m\n", "\u001b[32m2022-12-19 22:07:25.598\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:10\u001b[0m\n", "\u001b[32m2022-12-19 22:07:26.654\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:11\u001b[0m\n", "\u001b[32m2022-12-19 22:07:27.679\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:12\u001b[0m\n", "\u001b[32m2022-12-19 22:07:28.736\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:13\u001b[0m\n", "\u001b[32m2022-12-19 22:07:29.762\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:14\u001b[0m\n", "\u001b[32m2022-12-19 22:07:30.795\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:15\u001b[0m\n", "\u001b[32m2022-12-19 22:07:31.877\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:16\u001b[0m\n", "\u001b[32m2022-12-19 22:07:33.008\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:18\u001b[0m\n", "\u001b[32m2022-12-19 22:07:34.045\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:19\u001b[0m\n", "\u001b[32m2022-12-19 22:07:35.074\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:20\u001b[0m\n", "\u001b[32m2022-12-19 22:07:36.170\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:21\u001b[0m\n", "\u001b[32m2022-12-19 22:07:37.332\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:22\u001b[0m\n", "\u001b[32m2022-12-19 22:07:38.620\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:23\u001b[0m\n", "\u001b[32m2022-12-19 22:07:39.759\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:24\u001b[0m\n", "\u001b[32m2022-12-19 22:07:40.844\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:25\u001b[0m\n", "\u001b[32m2022-12-19 22:07:41.969\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:27\u001b[0m\n", "\u001b[32m2022-12-19 22:07:42.992\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:28\u001b[0m\n", "\u001b[32m2022-12-19 22:07:44.132\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:29\u001b[0m\n", "\u001b[32m2022-12-19 22:07:45.206\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:30\u001b[0m\n", "\u001b[32m2022-12-19 22:07:46.239\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:31\u001b[0m\n", "\u001b[32m2022-12-19 22:07:47.350\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:32\u001b[0m\n", "\u001b[32m2022-12-19 22:07:48.424\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:33\u001b[0m\n", "\u001b[32m2022-12-19 22:07:49.509\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:34\u001b[0m\n", "\u001b[32m2022-12-19 22:07:50.618\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:35\u001b[0m\n", "\u001b[32m2022-12-19 22:07:51.685\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:36\u001b[0m\n", "\u001b[32m2022-12-19 22:07:52.744\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:37\u001b[0m\n", "\u001b[32m2022-12-19 22:07:53.842\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:38\u001b[0m\n", "\u001b[32m2022-12-19 22:07:54.920\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:39\u001b[0m\n", "\u001b[32m2022-12-19 22:07:56.194\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:41\u001b[0m\n", "\u001b[32m2022-12-19 22:07:57.318\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:42\u001b[0m\n", "\u001b[32m2022-12-19 22:07:58.388\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:43\u001b[0m\n", "\u001b[32m2022-12-19 22:07:59.449\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:44\u001b[0m\n", "\u001b[32m2022-12-19 22:08:00.494\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:45\u001b[0m\n", "\u001b[32m2022-12-19 22:08:01.567\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:46\u001b[0m\n", "\u001b[32m2022-12-19 22:08:02.670\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:47\u001b[0m\n", "\u001b[32m2022-12-19 22:08:03.754\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:48\u001b[0m\n", "\u001b[32m2022-12-19 22:08:04.836\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:49\u001b[0m\n", "\u001b[32m2022-12-19 22:08:05.866\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:50\u001b[0m\n", "\u001b[32m2022-12-19 22:08:06.887\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component nn_0, time elapse: 0:00:51\u001b[0m\n", "\u001b[0mm2022-12-19 22:08:07.954\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m125\u001b[0m - \u001b[1m\n", "\u001b[32m2022-12-19 22:08:07.956\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component eval_0, time elapse: 0:00:52\u001b[0m\n", "\u001b[32m2022-12-19 22:08:09.001\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component eval_0, time elapse: 0:00:54\u001b[0m\n", "\u001b[32m2022-12-19 22:08:10.025\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component eval_0, time elapse: 0:00:55\u001b[0m\n", "\u001b[32m2022-12-19 22:08:11.050\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component eval_0, time elapse: 0:00:56\u001b[0m\n", "\u001b[32m2022-12-19 22:08:12.074\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component eval_0, time elapse: 0:00:57\u001b[0m\n", "\u001b[32m2022-12-19 22:08:13.124\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component eval_0, time elapse: 0:00:58\u001b[0m\n", "\u001b[32m2022-12-19 22:08:14.149\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component eval_0, time elapse: 0:00:59\u001b[0m\n", "\u001b[32m2022-12-19 22:08:15.190\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component eval_0, time elapse: 0:01:00\u001b[0m\n", "\u001b[32m2022-12-19 22:08:16.211\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component eval_0, time elapse: 0:01:01\u001b[0m\n", "\u001b[32m2022-12-19 22:08:18.281\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m89\u001b[0m - \u001b[1mJob is success!!! Job id is 202212192207123770130\u001b[0m\n", "\u001b[32m2022-12-19 22:08:18.282\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m90\u001b[0m - \u001b[1mTotal time: 0:01:03\u001b[0m\n" ] } ], "source": [ "pipeline.compile()\n", "pipeline.fit()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.13 (default, Mar 28 2022, 11:38:47) \n[GCC 7.5.0]" }, "vscode": { "interpreter": { "hash": "d29574a2ab71ec988cdcd4d29c58400bd2037cad632b9528d973466f7fb6f853" } } }, "nbformat": 4, "nbformat_minor": 5 }