From f64211dbce7eb03dd8e394eeaed86065130d7a99 Mon Sep 17 00:00:00 2001 From: rnyak Date: Mon, 12 Apr 2021 18:47:56 -0400 Subject: [PATCH] update hugectr nbs (#728) --- .../Training-with-HugeCTR.ipynb | 208 +++++++++--------- .../Triton-Inference-with-HugeCTR.ipynb | 117 ++++++---- 2 files changed, 186 insertions(+), 139 deletions(-) diff --git a/examples/getting-started-movielens/inference-HugeCTR/Training-with-HugeCTR.ipynb b/examples/getting-started-movielens/inference-HugeCTR/Training-with-HugeCTR.ipynb index 824f2fd8ad3..0c64c56d2e7 100644 --- a/examples/getting-started-movielens/inference-HugeCTR/Training-with-HugeCTR.ipynb +++ b/examples/getting-started-movielens/inference-HugeCTR/Training-with-HugeCTR.ipynb @@ -114,7 +114,9 @@ "import numpy as np\n", "\n", "from os import path\n", - "from sklearn.model_selection import train_test_split" + "from sklearn.model_selection import train_test_split\n", + "\n", + "from nvtabular.utils import download_file" ] }, { @@ -149,13 +151,19 @@ "execution_count": 4, "id": "mounted-temple", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "downloading ml-25m.zip: 262MB [00:43, 6.09MB/s] \n", + "unzipping files: 100%|██████████| 8/8 [00:09<00:00, 1.19s/files]\n" + ] + } + ], "source": [ - "if not path.exists(BASE_DIR + 'ml-25m'):\n", - " if not path.exists(BASE_DIR + 'ml-25m.zip'):\n", - " os.system(\"wget http://files.grouplens.org/datasets/movielens/ml-25m.zip\")\n", - " os.system(\"mv ml-25m.zip \" + BASE_DIR)\n", - " os.system(\"unzip \" + BASE_DIR + \"ml-25m.zip -d \" + BASE_DIR)" + "download_file(\"http://files.grouplens.org/datasets/movielens/ml-25m.zip\", \n", + " os.path.join(BASE_DIR, \"ml-25m.zip\"))" ] }, { @@ -400,7 +408,7 @@ { "data": { "text/plain": [ - "34" + "60" ] }, "execution_count": 9, @@ -500,74 +508,74 @@ "\n", "\n", "0\n", - "\n", - "+\n", - "\n", - "\n", - "\n", - "5\n", - "\n", - "output cols=[userId, movieId, rating]\n", - "\n", - "\n", - "\n", - "0->5\n", - "\n", - "\n", + "\n", + "input cols=[userId, movieId]\n", "\n", - "\n", - "\n", - "3\n", + "\n", + "\n", + "4\n", "\n", "Categorify\n", "\n", - "\n", - "\n", - "3->0\n", - "\n", - "\n", + "\n", + "\n", + "0->4\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "1\n", "\n", "LambdaOp\n", "\n", - "\n", - "\n", - "1->0\n", + "\n", + "\n", + "3\n", + "\n", + "+\n", + "\n", + "\n", + "\n", + "1->3\n", "\n", "\n", "\n", "\n", - "\n", + "\n", "2\n", "\n", "input cols=[rating]\n", "\n", "\n", - "\n", + "\n", "2->1\n", "\n", "\n", "\n", - "\n", - "\n", - "4\n", - "\n", - "input cols=[userId, movieId]\n", + "\n", + "\n", + "5\n", + "\n", + "output cols=[userId, movieId, rating]\n", + "\n", + "\n", + "\n", + "3->5\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "4->3\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 13, @@ -635,8 +643,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "CPU times: user 8.28 s, sys: 431 ms, total: 8.71 s\n", - "Wall time: 8.76 s\n" + "CPU times: user 884 ms, sys: 333 ms, total: 1.22 s\n", + "Wall time: 1.32 s\n" ] } ], @@ -1068,16 +1076,16 @@ "output_type": "stream", "text": [ "===================================Model Init====================================\n", - "[11d22h07m20s][HUGECTR][INFO]: Global seed is 1182778607\n", - "[11d22h07m22s][HUGECTR][INFO]: Peer-to-peer access cannot be fully enabled.\n", + "[12d22h09m04s][HUGECTR][INFO]: Global seed is 2523917653\n", + "[12d22h09m06s][HUGECTR][INFO]: Peer-to-peer access cannot be fully enabled.\n", "Device 0: Tesla V100-DGXS-16GB\n", - "[11d22h07m22s][HUGECTR][INFO]: num of DataReader workers: 1\n", - "[11d22h07m22s][HUGECTR][INFO]: num_internal_buffers 1\n", - "[11d22h07m22s][HUGECTR][INFO]: num_internal_buffers 1\n", - "[11d22h07m22s][HUGECTR][INFO]: Vocabulary size: 219128\n", - "[11d22h07m22s][HUGECTR][INFO]: max_vocabulary_size_per_gpu_=219128\n", - "[11d22h07m23s][HUGECTR][INFO]: gpu0 start to init embedding\n", - "[11d22h07m23s][HUGECTR][INFO]: gpu0 init embedding done\n", + "[12d22h09m06s][HUGECTR][INFO]: num of DataReader workers: 1\n", + "[12d22h09m06s][HUGECTR][INFO]: num_internal_buffers 1\n", + "[12d22h09m06s][HUGECTR][INFO]: num_internal_buffers 1\n", + "[12d22h09m06s][HUGECTR][INFO]: Vocabulary size: 219128\n", + "[12d22h09m06s][HUGECTR][INFO]: max_vocabulary_size_per_gpu_=219128\n", + "[12d22h09m07s][HUGECTR][INFO]: gpu0 start to init embedding\n", + "[12d22h09m07s][HUGECTR][INFO]: gpu0 init embedding done\n", "==================================Model Summary==================================\n", "Label Name Dense Name Sparse Name \n", "label dense data1 \n", @@ -1094,49 +1102,49 @@ "BinaryCrossEntropyLoss fc3, label loss \n", "--------------------------------------------------------------------------------\n", "=====================================Model Fit====================================\n", - "[11d22h70m23s][HUGECTR][INFO]: Use non-epoch mode with number of iterations: 2000\n", - "[11d22h70m23s][HUGECTR][INFO]: Training batchsize: 2048, evaluation batchsize: 2048\n", - "[11d22h70m23s][HUGECTR][INFO]: Evaluation interval: 200, snapshot interval: 1900\n", - "[11d22h70m23s][HUGECTR][INFO]: Iter: 100 Time(100 iters): 0.056858s Loss: 0.591121 lr:0.001000\n", - "[11d22h70m23s][HUGECTR][INFO]: Iter: 200 Time(100 iters): 0.053634s Loss: 0.564416 lr:0.001000\n", - "[11d22h70m23s][HUGECTR][INFO]: Evaluation, AUC: 0.743987\n", - "[11d22h70m23s][HUGECTR][INFO]: Eval Time for 160 iters: 0.038483s\n", - "[11d22h70m23s][HUGECTR][INFO]: Iter: 300 Time(100 iters): 0.102818s Loss: 0.566298 lr:0.001000\n", - "[11d22h70m23s][HUGECTR][INFO]: Iter: 400 Time(100 iters): 0.053446s Loss: 0.539269 lr:0.001000\n", - "[11d22h70m23s][HUGECTR][INFO]: Evaluation, AUC: 0.763787\n", - "[11d22h70m23s][HUGECTR][INFO]: Eval Time for 160 iters: 0.034829s\n", - "[11d22h70m23s][HUGECTR][INFO]: Iter: 500 Time(100 iters): 0.100928s Loss: 0.554708 lr:0.001000\n", - "[11d22h70m23s][HUGECTR][INFO]: Iter: 600 Time(100 iters): 0.053452s Loss: 0.539525 lr:0.001000\n", - "[11d22h70m23s][HUGECTR][INFO]: Evaluation, AUC: 0.772562\n", - "[11d22h70m23s][HUGECTR][INFO]: Eval Time for 160 iters: 0.034294s\n", - "[11d22h70m23s][HUGECTR][INFO]: Iter: 700 Time(100 iters): 0.089169s Loss: 0.533822 lr:0.001000\n", - "[11d22h70m23s][HUGECTR][INFO]: Iter: 800 Time(100 iters): 0.053729s Loss: 0.547485 lr:0.001000\n", - "[11d22h70m24s][HUGECTR][INFO]: Evaluation, AUC: 0.779771\n", - "[11d22h70m24s][HUGECTR][INFO]: Eval Time for 160 iters: 0.045291s\n", - "[11d22h70m24s][HUGECTR][INFO]: Iter: 900 Time(100 iters): 0.099816s Loss: 0.521559 lr:0.001000\n", - "[11d22h70m24s][HUGECTR][INFO]: Iter: 1000 Time(100 iters): 0.064345s Loss: 0.524825 lr:0.001000\n", - "[11d22h70m24s][HUGECTR][INFO]: Evaluation, AUC: 0.783923\n", - "[11d22h70m24s][HUGECTR][INFO]: Eval Time for 160 iters: 0.034748s\n", - "[11d22h70m24s][HUGECTR][INFO]: Iter: 1100 Time(100 iters): 0.089246s Loss: 0.541518 lr:0.001000\n", - "[11d22h70m24s][HUGECTR][INFO]: Iter: 1200 Time(100 iters): 0.053427s Loss: 0.517627 lr:0.001000\n", - "[11d22h70m24s][HUGECTR][INFO]: Evaluation, AUC: 0.785172\n", - "[11d22h70m24s][HUGECTR][INFO]: Eval Time for 160 iters: 0.035040s\n", - "[11d22h70m24s][HUGECTR][INFO]: Iter: 1300 Time(100 iters): 0.089587s Loss: 0.532193 lr:0.001000\n", - "[11d22h70m24s][HUGECTR][INFO]: Iter: 1400 Time(100 iters): 0.053467s Loss: 0.546165 lr:0.001000\n", - "[11d22h70m24s][HUGECTR][INFO]: Evaluation, AUC: 0.790062\n", - "[11d22h70m24s][HUGECTR][INFO]: Eval Time for 160 iters: 0.046366s\n", - "[11d22h70m24s][HUGECTR][INFO]: Iter: 1500 Time(100 iters): 0.112205s Loss: 0.528746 lr:0.001000\n", - "[11d22h70m24s][HUGECTR][INFO]: Iter: 1600 Time(100 iters): 0.053563s Loss: 0.518219 lr:0.001000\n", - "[11d22h70m24s][HUGECTR][INFO]: Evaluation, AUC: 0.792964\n", - "[11d22h70m24s][HUGECTR][INFO]: Eval Time for 160 iters: 0.035604s\n", - "[11d22h70m24s][HUGECTR][INFO]: Iter: 1700 Time(100 iters): 0.090292s Loss: 0.513209 lr:0.001000\n", - "[11d22h70m24s][HUGECTR][INFO]: Iter: 1800 Time(100 iters): 0.053419s Loss: 0.536347 lr:0.001000\n", - "[11d22h70m24s][HUGECTR][INFO]: Evaluation, AUC: 0.793697\n", - "[11d22h70m24s][HUGECTR][INFO]: Eval Time for 160 iters: 0.034481s\n", - "[11d22h70m24s][HUGECTR][INFO]: Iter: 1900 Time(100 iters): 0.089039s Loss: 0.501846 lr:0.001000\n", - "[11d22h70m24s][HUGECTR][INFO]: Rank0: Dump hash table from GPU0\n", - "[11d22h70m24s][HUGECTR][INFO]: Rank0: Write hash table pairs to file\n", - "[11d22h70m24s][HUGECTR][INFO]: Done\n" + "[12d22h90m70s][HUGECTR][INFO]: Use non-epoch mode with number of iterations: 2000\n", + "[12d22h90m70s][HUGECTR][INFO]: Training batchsize: 2048, evaluation batchsize: 2048\n", + "[12d22h90m70s][HUGECTR][INFO]: Evaluation interval: 200, snapshot interval: 1900\n", + "[12d22h90m70s][HUGECTR][INFO]: Iter: 100 Time(100 iters): 0.052433s Loss: 0.584569 lr:0.001000\n", + "[12d22h90m70s][HUGECTR][INFO]: Iter: 200 Time(100 iters): 0.050910s Loss: 0.574016 lr:0.001000\n", + "[12d22h90m70s][HUGECTR][INFO]: Evaluation, AUC: 0.742104\n", + "[12d22h90m70s][HUGECTR][INFO]: Eval Time for 160 iters: 0.037350s\n", + "[12d22h90m70s][HUGECTR][INFO]: Iter: 300 Time(100 iters): 0.097618s Loss: 0.567825 lr:0.001000\n", + "[12d22h90m70s][HUGECTR][INFO]: Iter: 400 Time(100 iters): 0.050943s Loss: 0.537596 lr:0.001000\n", + "[12d22h90m80s][HUGECTR][INFO]: Evaluation, AUC: 0.759488\n", + "[12d22h90m80s][HUGECTR][INFO]: Eval Time for 160 iters: 0.032945s\n", + "[12d22h90m80s][HUGECTR][INFO]: Iter: 500 Time(100 iters): 0.096795s Loss: 0.542408 lr:0.001000\n", + "[12d22h90m80s][HUGECTR][INFO]: Iter: 600 Time(100 iters): 0.050967s Loss: 0.542498 lr:0.001000\n", + "[12d22h90m80s][HUGECTR][INFO]: Evaluation, AUC: 0.773175\n", + "[12d22h90m80s][HUGECTR][INFO]: Eval Time for 160 iters: 0.032986s\n", + "[12d22h90m80s][HUGECTR][INFO]: Iter: 700 Time(100 iters): 0.085280s Loss: 0.537160 lr:0.001000\n", + "[12d22h90m80s][HUGECTR][INFO]: Iter: 800 Time(100 iters): 0.051053s Loss: 0.536568 lr:0.001000\n", + "[12d22h90m80s][HUGECTR][INFO]: Evaluation, AUC: 0.778617\n", + "[12d22h90m80s][HUGECTR][INFO]: Eval Time for 160 iters: 0.044035s\n", + "[12d22h90m80s][HUGECTR][INFO]: Iter: 900 Time(100 iters): 0.096313s Loss: 0.522038 lr:0.001000\n", + "[12d22h90m80s][HUGECTR][INFO]: Iter: 1000 Time(100 iters): 0.061872s Loss: 0.527347 lr:0.001000\n", + "[12d22h90m80s][HUGECTR][INFO]: Evaluation, AUC: 0.784214\n", + "[12d22h90m80s][HUGECTR][INFO]: Eval Time for 160 iters: 0.032451s\n", + "[12d22h90m80s][HUGECTR][INFO]: Iter: 1100 Time(100 iters): 0.084576s Loss: 0.539346 lr:0.001000\n", + "[12d22h90m80s][HUGECTR][INFO]: Iter: 1200 Time(100 iters): 0.050991s Loss: 0.540385 lr:0.001000\n", + "[12d22h90m80s][HUGECTR][INFO]: Evaluation, AUC: 0.785587\n", + "[12d22h90m80s][HUGECTR][INFO]: Eval Time for 160 iters: 0.033604s\n", + "[12d22h90m80s][HUGECTR][INFO]: Iter: 1300 Time(100 iters): 0.085920s Loss: 0.526508 lr:0.001000\n", + "[12d22h90m80s][HUGECTR][INFO]: Iter: 1400 Time(100 iters): 0.050974s Loss: 0.529692 lr:0.001000\n", + "[12d22h90m80s][HUGECTR][INFO]: Evaluation, AUC: 0.790832\n", + "[12d22h90m80s][HUGECTR][INFO]: Eval Time for 160 iters: 0.044729s\n", + "[12d22h90m80s][HUGECTR][INFO]: Iter: 1500 Time(100 iters): 0.108554s Loss: 0.512485 lr:0.001000\n", + "[12d22h90m80s][HUGECTR][INFO]: Iter: 1600 Time(100 iters): 0.050959s Loss: 0.553773 lr:0.001000\n", + "[12d22h90m80s][HUGECTR][INFO]: Evaluation, AUC: 0.792876\n", + "[12d22h90m80s][HUGECTR][INFO]: Eval Time for 160 iters: 0.034639s\n", + "[12d22h90m80s][HUGECTR][INFO]: Iter: 1700 Time(100 iters): 0.086896s Loss: 0.511820 lr:0.001000\n", + "[12d22h90m80s][HUGECTR][INFO]: Iter: 1800 Time(100 iters): 0.050913s Loss: 0.529587 lr:0.001000\n", + "[12d22h90m90s][HUGECTR][INFO]: Evaluation, AUC: 0.794456\n", + "[12d22h90m90s][HUGECTR][INFO]: Eval Time for 160 iters: 0.034695s\n", + "[12d22h90m90s][HUGECTR][INFO]: Iter: 1900 Time(100 iters): 0.086743s Loss: 0.520362 lr:0.001000\n", + "[12d22h90m90s][HUGECTR][INFO]: Rank0: Dump hash table from GPU0\n", + "[12d22h90m90s][HUGECTR][INFO]: Rank0: Write hash table pairs to file\n", + "[12d22h90m90s][HUGECTR][INFO]: Done\n" ] } ], @@ -1387,7 +1395,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.6" + "version": "3.8.8" } }, "nbformat": 4, diff --git a/examples/getting-started-movielens/inference-HugeCTR/Triton-Inference-with-HugeCTR.ipynb b/examples/getting-started-movielens/inference-HugeCTR/Triton-Inference-with-HugeCTR.ipynb index 5e9727b4e99..22ce101d862 100644 --- a/examples/getting-started-movielens/inference-HugeCTR/Triton-Inference-with-HugeCTR.ipynb +++ b/examples/getting-started-movielens/inference-HugeCTR/Triton-Inference-with-HugeCTR.ipynb @@ -92,7 +92,7 @@ "id": "likely-render", "metadata": {}, "source": [ - "At this staged, you should have already launched the Triton Inference Server docker container with the following script:" + "At this stage, you should launch the Triton Inference Server docker container with the following script:" ] }, { @@ -135,10 +135,19 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 12, "id": "third-ordinance", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/opt/conda/envs/merlin/lib/python3.8/site-packages/ipykernel/ipkernel.py:283: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n", + " and should_run_async(code)\n" + ] + } + ], "source": [ "# disable warnings\n", "import warnings\n", @@ -162,7 +171,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/opt/conda/envs/rapids/lib/python3.8/site-packages/tritonhttpclient/__init__.py:30: DeprecationWarning: The package `tritonhttpclient` is deprecated and will be removed in a future version. Please use instead `tritonclient.http`\n", + "/opt/conda/envs/merlin/lib/python3.8/site-packages/tritonhttpclient/__init__.py:30: DeprecationWarning: The package `tritonhttpclient` is deprecated and will be removed in a future version. Please use instead `tritonclient.http`\n", " warnings.warn(\n" ] } @@ -194,7 +203,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/opt/conda/envs/rapids/lib/python3.8/site-packages/ipykernel/ipkernel.py:283: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n", + "/opt/conda/envs/merlin/lib/python3.8/site-packages/ipykernel/ipkernel.py:283: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n", " and should_run_async(code)\n" ] }, @@ -225,24 +234,22 @@ "text": [ "POST /v2/repository/index, headers None\n", "\n", - "\n", - "bytearray(b'[{\"name\":\"movielens\",\"version\":\"1\",\"state\":\"READY\"},{\"name\":\"movielens_ens\",\"version\":\"1\",\"state\":\"READY\"},{\"name\":\"movielens_nvt\",\"version\":\"1\",\"state\":\"READY\"}]')\n" + "\n", + "bytearray(b'[{\"name\":\"movielens\"},{\"name\":\"movielens_ens\"},{\"name\":\"movielens_nvt\"}]')\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ - "/opt/conda/envs/rapids/lib/python3.8/site-packages/ipykernel/ipkernel.py:283: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n", + "/opt/conda/envs/merlin/lib/python3.8/site-packages/ipykernel/ipkernel.py:283: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n", " and should_run_async(code)\n" ] }, { "data": { "text/plain": [ - "[{'name': 'movielens', 'version': '1', 'state': 'READY'},\n", - " {'name': 'movielens_ens', 'version': '1', 'state': 'READY'},\n", - " {'name': 'movielens_nvt', 'version': '1', 'state': 'READY'}]" + "[{'name': 'movielens'}, {'name': 'movielens_ens'}, {'name': 'movielens_nvt'}]" ] }, "execution_count": 6, @@ -269,23 +276,23 @@ "metadata": {}, "outputs": [ { - "name": "stdout", + "name": "stderr", "output_type": "stream", "text": [ - "POST /v2/repository/models/movielens_nvt/load, headers None\n", - "\n", - "\n", - "Loaded model 'movielens_nvt'\n", - "CPU times: user 784 µs, sys: 597 µs, total: 1.38 ms\n", - "Wall time: 814 µs\n" + "/opt/conda/envs/merlin/lib/python3.8/site-packages/ipykernel/ipkernel.py:283: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n", + " and should_run_async(code)\n" ] }, { - "name": "stderr", + "name": "stdout", "output_type": "stream", "text": [ - "/opt/conda/envs/rapids/lib/python3.8/site-packages/ipykernel/ipkernel.py:283: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n", - " and should_run_async(code)\n" + "POST /v2/repository/models/movielens_nvt/load, headers None\n", + "\n", + "\n", + "Loaded model 'movielens_nvt'\n", + "CPU times: user 2.51 ms, sys: 2.96 ms, total: 5.47 ms\n", + "Wall time: 4.12 s\n" ] } ], @@ -306,20 +313,26 @@ "output_type": "stream", "text": [ "POST /v2/repository/models/movielens/load, headers None\n", - "\n", - "\n", - "Loaded model 'movielens'\n", - "CPU times: user 687 µs, sys: 246 µs, total: 933 µs\n", - "Wall time: 633 µs\n" + "\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ - "/opt/conda/envs/rapids/lib/python3.8/site-packages/ipykernel/ipkernel.py:283: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n", + "/opt/conda/envs/merlin/lib/python3.8/site-packages/ipykernel/ipkernel.py:283: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n", " and should_run_async(code)\n" ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "Loaded model 'movielens'\n", + "CPU times: user 4.64 ms, sys: 450 µs, total: 5.09 ms\n", + "Wall time: 5.06 s\n" + ] } ], "source": [ @@ -347,20 +360,26 @@ "output_type": "stream", "text": [ "POST /v2/repository/models/movielens_ens/load, headers None\n", - "\n", - "\n", - "Loaded model 'movielens_ens'\n", - "CPU times: user 1.05 ms, sys: 799 µs, total: 1.85 ms\n", - "Wall time: 1.21 ms\n" + "\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ - "/opt/conda/envs/rapids/lib/python3.8/site-packages/ipykernel/ipkernel.py:283: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n", + "/opt/conda/envs/merlin/lib/python3.8/site-packages/ipykernel/ipkernel.py:283: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n", " and should_run_async(code)\n" ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "Loaded model 'movielens_ens'\n", + "CPU times: user 4.63 ms, sys: 438 µs, total: 5.07 ms\n", + "Wall time: 4.48 s\n" + ] } ], "source": [ @@ -379,7 +398,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 13, "id": "tamil-purse", "metadata": {}, "outputs": [ @@ -390,10 +409,30 @@ " movieId userId\n", "15347762 104374 99476\n", "16647840 2634 107979\n", - "23915192 1614 155372 \n", + "23915192 1614 155372\n", + "10052313 7153 65225\n", + "12214125 500 79161\n", + "... ... ...\n", + "17138306 1625 111072\n", + "21326655 81591 138575\n", + "5664631 8861 36671\n", + "217658 111759 1535\n", + "11842246 109487 76766\n", + "\n", + "[64 rows x 2 columns] \n", "\n", "predicted sigmoid result:\n", - " [0.55833006 0.621295 0.58070874]\n" + " [0.7573269 0.6642067 0.5219038 0.9162213 0.58373827 0.6324592\n", + " 0.1261984 0.7433809 0.7342346 0.5113202 0.32252765 0.32908657\n", + " 0.73969156 0.81043386 0.9233688 0.63236904 0.4797384 0.75307035\n", + " 0.53202295 0.7541297 0.40705425 0.9277518 0.689459 0.72485703\n", + " 0.8788407 0.83017814 0.88228446 0.93667686 0.8267219 0.6621109\n", + " 0.86495745 0.81340396 0.2001776 0.4336695 0.7589197 0.40920126\n", + " 0.05241419 0.507262 0.86438596 0.64993507 0.8638992 0.8295686\n", + " 0.5768085 0.7233483 0.8432365 0.92196935 0.6212369 0.03016632\n", + " 0.90098035 0.9210639 0.49144918 0.18722329 0.500137 0.73863095\n", + " 0.72936064 0.8874768 0.4512655 0.7404788 0.39557046 0.8321269\n", + " 0.31330508 0.17449784 0.7529682 0.9082047 ]\n" ] } ], @@ -407,11 +446,11 @@ "model_name = 'movielens_ens'\n", "col_names = [\"movieId\", \"userId\"]\n", "# read in a batch of data to get transforms for\n", - "batch = cudf.read_parquet('/model/data/valid.parquet', num_rows=3)[col_names]\n", + "batch = cudf.read_parquet('/model/data/valid.parquet', num_rows=64)[col_names]\n", "print(batch, \"\\n\")\n", "\n", "# convert the batch to a triton inputs\n", - "columns = [(col, batch[col][0:3]) for col in col_names]\n", + "columns = [(col, batch[col]) for col in col_names]\n", "inputs = []\n", "\n", "col_dtypes = [np.int64, np.int64]\n", @@ -447,7 +486,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.10" + "version": "3.8.8" } }, "nbformat": 4,