Skip to content

Commit

Permalink
Merge branch 'main' into enable_extra_information_in_params_converter
Browse files Browse the repository at this point in the history
  • Loading branch information
chesterxgchen authored Dec 20, 2023
2 parents a72375b + 910d2e5 commit cdd01ec
Showing 1 changed file with 82 additions and 2 deletions.
84 changes: 82 additions & 2 deletions examples/tutorials/setup_poc.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@
},
"outputs": [],
"source": [
"! echo 'y' | nvflare poc prepare -c hospital_1 hospital_2 -d 'nvflare/nvflare' -he "
"! echo 'y' | nvflare poc prepare -c hospital_1 hospital_2 -d 'nvflare/nvflare'"
]
},
{
Expand Down Expand Up @@ -621,6 +621,86 @@
"Copy this file and you are ready to go !"
]
},
{
"cell_type": "markdown",
"id": "fb3b39f3-18da-408e-8cb5-f762db52e1e6",
"metadata": {},
"source": [
"### Support Homomorphic Encryption (HE)\n",
"\n",
"To support HE, we need the provision process to generates Tenseal homomorphic encryption context for server and client and writes them to server and client\n",
"participant folders see [provision context](https://nvflare.readthedocs.io/en/main/programming_guide/provisioning_system.html#provision-context). This is achieved by Provision builder, in particular for HE, HEBuilder. Instead of manaully add HEBuilder to project.yml file, one can use ```-he``` in poc command\n",
"\n",
"For example, if we use above command with HE, we can write as\n",
"\n",
"```\n",
"echo 'y' | nvflare poc prepare -c hospital_1 hospital_2 -d 'nvflare/nvflare' -he\n",
"\n",
"```\n",
"But before you run the command, you must have the correct dependency. NVFLARE uses Tenseal library as HE dependency. By default it is optional dependency. \n",
"To use HE, you could install it with \n",
"\n",
"```\n",
" pip install nvflare[HE]\n",
"```\n",
"> Note\n",
" * Tenseal is not avaiable in Mac OS\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "18ab73d0-e52e-45c0-8ccd-887f9eef994a",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"! pip install nvflare[HE]"
]
},
{
"cell_type": "markdown",
"id": "9a161d61-4688-4bd9-90c3-6d60e8e65015",
"metadata": {},
"source": [
"Assuming you installed it successfully, then you can run the command"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "373e048b-3e7f-4605-8583-61f1facf5fda",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"! echo 'y' | nvflare poc prepare -c hospital_1 hospital_2 -d 'nvflare/nvflare' -he"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0be81258-e10c-40dd-81ff-5a881995ee92",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"! cat /tmp/nvflare/poc/project.yml\n"
]
},
{
"cell_type": "markdown",
"id": "99e75eda-f6b9-45ac-a383-52a17b21982a",
"metadata": {
"tags": []
},
"source": [
"Notice: ```path: nvflare.lighter.impl.he.HEBuilder``` is added to the YAML file"
]
},
{
"cell_type": "markdown",
"id": "ea8f1878-7e9d-4e17-ba78-5812fc88b580",
Expand Down Expand Up @@ -682,7 +762,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.2"
"version": "3.8.16"
}
},
"nbformat": 4,
Expand Down

0 comments on commit cdd01ec

Please sign in to comment.