romanbredehoft-zama commited on
Commit
fe8d446
β€’
1 Parent(s): 68c9ed6

Compile deployment files on python 3.10

Browse files
SentimentClassification.ipynb CHANGED
@@ -21,7 +21,7 @@
21
  },
22
  {
23
  "cell_type": "code",
24
- "execution_count": 31,
25
  "metadata": {},
26
  "outputs": [],
27
  "source": [
@@ -312,8 +312,8 @@
312
  "name": "stdout",
313
  "output_type": "stream",
314
  "text": [
315
- "Compilation time: 5.4779 seconds\n",
316
- "FHE inference time: 1.1039 seconds\n"
317
  ]
318
  }
319
  ],
@@ -390,7 +390,7 @@
390
  "name": "stderr",
391
  "output_type": "stream",
392
  "text": [
393
- "Some weights of the model checkpoint at cardiffnlp/twitter-roberta-base-sentiment-latest were not used when initializing RobertaForSequenceClassification: ['roberta.pooler.dense.bias', 'roberta.pooler.dense.weight']\n",
394
  "- This IS expected if you are initializing RobertaForSequenceClassification from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).\n",
395
  "- This IS NOT expected if you are initializing RobertaForSequenceClassification from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).\n"
396
  ]
@@ -426,7 +426,7 @@
426
  "\t- Avoid using `tokenizers` before the fork if possible\n",
427
  "\t- Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false)\n",
428
  " 0%| | 0/30 [00:00<?, ?it/s]We strongly recommend passing in an `attention_mask` since your input_ids may be padded. See https://huggingface.co/docs/transformers/troubleshooting#incorrect-output-when-padding-tokens-arent-masked.\n",
429
- "100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 30/30 [00:20<00:00, 1.46it/s]\n"
430
  ]
431
  }
432
  ],
@@ -529,8 +529,8 @@
529
  "name": "stderr",
530
  "output_type": "stream",
531
  "text": [
532
- "100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 13176/13176 [08:10<00:00, 26.88it/s]\n",
533
- "100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1464/1464 [00:54<00:00, 26.90it/s]\n"
534
  ]
535
  }
536
  ],
@@ -791,21 +791,21 @@
791
  "name": "stdout",
792
  "output_type": "stream",
793
  "text": [
794
- "Compilation time: 5.9232 seconds\n"
795
  ]
796
  },
797
  {
798
  "name": "stderr",
799
  "output_type": "stream",
800
  "text": [
801
- "100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:00<00:00, 17.83it/s]"
802
  ]
803
  },
804
  {
805
  "name": "stdout",
806
  "output_type": "stream",
807
  "text": [
808
- "FHE inference time: 0.8374 seconds\n"
809
  ]
810
  },
811
  {
@@ -859,7 +859,7 @@
859
  },
860
  {
861
  "cell_type": "code",
862
- "execution_count": 40,
863
  "metadata": {},
864
  "outputs": [],
865
  "source": [
@@ -890,7 +890,7 @@
890
  },
891
  {
892
  "cell_type": "code",
893
- "execution_count": null,
894
  "metadata": {},
895
  "outputs": [
896
  {
@@ -973,7 +973,7 @@
973
  "Transformer + XGBoost 0.74489 "
974
  ]
975
  },
976
- "execution_count": 33,
977
  "metadata": {},
978
  "output_type": "execute_result"
979
  }
 
21
  },
22
  {
23
  "cell_type": "code",
24
+ "execution_count": 1,
25
  "metadata": {},
26
  "outputs": [],
27
  "source": [
 
312
  "name": "stdout",
313
  "output_type": "stream",
314
  "text": [
315
+ "Compilation time: 5.3550 seconds\n",
316
+ "FHE inference time: 1.1162 seconds\n"
317
  ]
318
  }
319
  ],
 
390
  "name": "stderr",
391
  "output_type": "stream",
392
  "text": [
393
+ "Some weights of the model checkpoint at cardiffnlp/twitter-roberta-base-sentiment-latest were not used when initializing RobertaForSequenceClassification: ['roberta.pooler.dense.weight', 'roberta.pooler.dense.bias']\n",
394
  "- This IS expected if you are initializing RobertaForSequenceClassification from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).\n",
395
  "- This IS NOT expected if you are initializing RobertaForSequenceClassification from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).\n"
396
  ]
 
426
  "\t- Avoid using `tokenizers` before the fork if possible\n",
427
  "\t- Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false)\n",
428
  " 0%| | 0/30 [00:00<?, ?it/s]We strongly recommend passing in an `attention_mask` since your input_ids may be padded. See https://huggingface.co/docs/transformers/troubleshooting#incorrect-output-when-padding-tokens-arent-masked.\n",
429
+ "100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 30/30 [00:20<00:00, 1.45it/s]\n"
430
  ]
431
  }
432
  ],
 
529
  "name": "stderr",
530
  "output_type": "stream",
531
  "text": [
532
+ "100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 13176/13176 [09:24<00:00, 23.36it/s]\n",
533
+ "100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1464/1464 [01:00<00:00, 24.12it/s]\n"
534
  ]
535
  }
536
  ],
 
791
  "name": "stdout",
792
  "output_type": "stream",
793
  "text": [
794
+ "Compilation time: 5.8594 seconds\n"
795
  ]
796
  },
797
  {
798
  "name": "stderr",
799
  "output_type": "stream",
800
  "text": [
801
+ "100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:00<00:00, 17.16it/s]"
802
  ]
803
  },
804
  {
805
  "name": "stdout",
806
  "output_type": "stream",
807
  "text": [
808
+ "FHE inference time: 0.9319 seconds\n"
809
  ]
810
  },
811
  {
 
859
  },
860
  {
861
  "cell_type": "code",
862
+ "execution_count": 26,
863
  "metadata": {},
864
  "outputs": [],
865
  "source": [
 
890
  },
891
  {
892
  "cell_type": "code",
893
+ "execution_count": 27,
894
  "metadata": {},
895
  "outputs": [
896
  {
 
973
  "Transformer + XGBoost 0.74489 "
974
  ]
975
  },
976
+ "execution_count": 27,
977
  "metadata": {},
978
  "output_type": "execute_result"
979
  }
compile.py CHANGED
@@ -1,10 +1,6 @@
1
- import onnx
2
  import pandas as pd
3
- from concrete.ml.deployment import FHEModelDev, FHEModelClient
4
  from concrete.ml.common.serialization.loaders import load
5
- from concrete.ml.onnx.convert import get_equivalent_numpy_forward_from_onnx_tree
6
- import json
7
- import os
8
  import shutil
9
  from pathlib import Path
10
 
 
 
1
  import pandas as pd
2
+ from concrete.ml.deployment import FHEModelDev
3
  from concrete.ml.common.serialization.loaders import load
 
 
 
4
  import shutil
5
  from pathlib import Path
6
 
deployment/sentiment_fhe_model/client.zip CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:972f0c7d83f12e3a43e8f923fc422cdb443b9f64bb6f74c1abf912836ba27e60
3
  size 3887326
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fbde0af1d92d5c2b2e42d8d439ae75328773dac591826559fbc2043356c22388
3
  size 3887326
deployment/sentiment_fhe_model/server.zip CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:216d2a78d7ec47ec2a478d5f32ed34cee8a9c45700325e5d8de4e087b7ed8dfc
3
  size 3004
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e6ab63f4cae95dd9c418df05b0041d567f485ae16ae84f02068165b3df659baf
3
  size 3004
deployment/serialized_model CHANGED
The diff for this file is too large to render. See raw diff
 
sentiment_fhe_model/deployment/client.zip DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:3f8beae6d9bb5b3ec454dd868a644fb90ea09efefa42f1c016d82ae92f8ab732
3
- size 128047
 
 
 
 
sentiment_fhe_model/deployment/server.zip DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:9d1d588333062510d6f7075419228a940c4b6a0005e0f9345ef599cb3b6d0748
3
- size 9550
 
 
 
 
sentiment_fhe_model/deployment/versions.json DELETED
@@ -1 +0,0 @@
1
- {"concrete-ml": "1.1.0", "concrete-python": "1.1.0rc1", "python": "3.9.16"}
 
 
sentiment_fhe_model/server_model.onnx DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:3c1835d9467bfdf77c48d3492cb7f6adaa20f6f9c106d22eecd4c4ca39f3256f
3
- size 932509