Skip to content

Commit

Permalink
chore: update cifar finetuning
Browse files Browse the repository at this point in the history
  • Loading branch information
kcelia committed Sep 23, 2024
1 parent 9b1c77f commit e57809c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@
"bit = 5\n",
"seed = 42\n",
"\n",
"use_gpu_if_available = False\n",
"device = \"cuda\" if use_gpu_if_available and check_gpu_available() else \"cpu\"\n",
"# To use the CUDA backend for the Concrete compiler, install the GPU-supported version.\n",
"# Refer to the official guide:\n",
"# https://github.com/zama-ai/concrete-ml/blob/main/docs/guides/using_gpu.md\n",
"device = \"cuda\" if check_gpu_available() else \"cpu\"\n",
"\n",
"print(f\"Device Type: {device}\")"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@
"seed = 42\n",
"rounding_thresholds_bits = [8, 7, 6, 5, 3]\n",
"\n",
"use_gpu_if_available = False\n",
"device = \"cuda\" if use_gpu_if_available and check_gpu_available() else \"cpu\""
"# To use the CUDA backend for the Concrete compiler, install the GPU-supported version.\n",
"# Refer to the official guide:\n",
"# https://github.com/zama-ai/concrete-ml/blob/main/docs/guides/using_gpu.md\n",
"device = \"cuda\" if check_gpu_available() else \"cpu\""
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@
"source": [
"bit = 5\n",
"\n",
"use_gpu_if_available = False\n",
"device = \"cuda\" if use_gpu_if_available and check_gpu_available() else \"cpu\"\n",
"# To use the CUDA backend for the Concrete compiler, install the GPU-supported version.\n",
"# Refer to the official guide:\n",
"# https://github.com/zama-ai/concrete-ml/blob/main/docs/guides/using_gpu.md\n",
"device = \"cuda\" if check_gpu_available() else \"cpu\"\n",
"\n",
"print(f\"Device Type: {device}\")"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@
"source": [
"dataset_name = \"CIFAR_100\"\n",
"\n",
"use_gpu_if_available = False\n",
"device = \"cuda\" if use_gpu_if_available and check_gpu_available() else \"cpu\"\n",
"# To use the CUDA backend for the Concrete compiler, install the GPU-supported version.\n",
"# Refer to the official guide:\n",
"# https://github.com/zama-ai/concrete-ml/blob/main/docs/guides/using_gpu.md#usage-preqreuisites\n",
"device = \"cuda\" if check_gpu_available() else \"cpu\"\n",
"\n",
"param_c10 = {\n",
" \"output_size\": 10,\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ def fhe_compatibility(model: Callable, data: DataLoader, device: str) -> Callabl
torch_inputset=data,
show_mlir=False,
output_onnx_file="test.onnx",
configuration=Configuration(use_gpu=(device == "cuda")),
device=device,
)

return qmodel
Expand Down

0 comments on commit e57809c

Please sign in to comment.