diff --git a/examples/arm/ethos_u_minimal_example.ipynb b/examples/arm/ethos_u_minimal_example.ipynb index 146a586d0ab..1e8116b3f36 100644 --- a/examples/arm/ethos_u_minimal_example.ipynb +++ b/examples/arm/ethos_u_minimal_example.ipynb @@ -137,6 +137,7 @@ "metadata": {}, "outputs": [], "source": [ + "import os\n", "from executorch.backends.arm.ethosu_partitioner import EthosUPartitioner\n", "from executorch.exir import (\n", " EdgeCompileConfig,\n", @@ -144,7 +145,6 @@ " to_edge_transform_and_lower,\n", ")\n", "from executorch.extension.export_util.utils import save_pte_program\n", - "import platform\n", "\n", "# Create partitioner from compile spec\n", "partitioner = EthosUPartitioner(compile_spec)\n", @@ -158,15 +158,6 @@ " ),\n", " )\n", "\n", - "# Load quantization ops library\n", - "os_aot_lib_names = {\"Darwin\" : \"libquantized_ops_aot_lib.dylib\",\n", - " \"Linux\" : \"libquantized_ops_aot_lib.so\",\n", - " \"Windows\": \"libquantized_ops_aot_lib.dll\"}\n", - "aot_lib_name = os_aot_lib_names[platform.system()]\n", - "\n", - "libquantized_ops_aot_lib_path = os.path.join(et_dir, \"cmake-out-aot-lib\", \"kernels\", \"quantized\", aot_lib_name)\n", - "torch.ops.load_library(libquantized_ops_aot_lib_path)\n", - "\n", "# Convert edge program to executorch\n", "executorch_program_manager = edge_program_manager.to_executorch(\n", " config=ExecutorchBackendConfig(extract_delegate_segments=False)\n", @@ -175,6 +166,7 @@ "executorch_program_manager.exported_program().module().print_readable()\n", "\n", "# Save pte file\n", + "cwd_dir = os.getcwd()\n", "pte_base_name = \"simple_example\"\n", "pte_name = pte_base_name + \".pte\"\n", "pte_path = os.path.join(cwd_dir, pte_name)\n", @@ -200,13 +192,20 @@ "metadata": {}, "outputs": [], "source": [ - "# Build executorch\n", + "import subprocess\n", + "\n", + "# Setup paths\n", + "et_dir = os.path.join(cwd_dir, \"..\", \"..\")\n", + "et_dir = os.path.abspath(et_dir)\n", + "script_dir = os.path.join(et_dir, \"backends\", \"arm\", \"scripts\")\n", + "\n", + "# Cross-compile executorch \n", "subprocess.run(os.path.join(script_dir, \"build_executorch.sh\"), shell=True, cwd=et_dir)\n", "\n", - "# Build portable kernels\n", + "# Cross-compile portable kernels\n", "subprocess.run(os.path.join(script_dir, \"build_portable_kernels.sh\"), shell=True, cwd=et_dir)\n", "\n", - "# Build executorch runner\n", + "# Cross-compile executorch runner\n", "args = f\"--pte={pte_path} --target={target}\"\n", "subprocess.run(os.path.join(script_dir, \"build_executor_runner.sh\") + \" \" + args, shell=True, cwd=et_dir)\n", "\n", @@ -236,7 +235,7 @@ ], "metadata": { "kernelspec": { - "display_name": "venv", + "display_name": ".venv", "language": "python", "name": "python3" },