diff --git a/.gitignore b/.gitignore index 1b23e80469e..daeaba27b2b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ buck-out/ executorch.egg-info __pycache__/ +build/lib/ +exir/serialize/scalar_type.fbs +exir/serialize/schema.fbs \ No newline at end of file diff --git a/docs/website/docs/tutorials/setting_up_executorch.md b/docs/website/docs/tutorials/setting_up_executorch.md index 22b7a45c642..a247e7e2acb 100644 --- a/docs/website/docs/tutorials/setting_up_executorch.md +++ b/docs/website/docs/tutorials/setting_up_executorch.md @@ -29,7 +29,7 @@ git clone git@github.com:pytorch/executorch.git # [Runtime requirement] Run the following to get all submodules, only need for runtime setup git submodule update --init --recursive -pip install executorch +pip install . # cd into a directory that doesn't contain a `./executorch/exir` directory, since # otherwise python will try using it for `import executorch.exir...` instead of using the @@ -52,7 +52,7 @@ Or via python interpreter: >>> from executorch.exir.tests.models import Mul >>> m = Mul() >>> print(exir.capture(m, m.get_random_inputs()).to_edge()) ->>> exir.capture(m, m.get_random_inputs()).to_edge().to_executorch().buffer +>>> open("add.ff", "wb").write(exir.capture(m, m.get_random_inputs()).to_edge().to_executorch().buffer) ``` ## Runtime Setup diff --git a/exir/capture/_capture.py b/exir/capture/_capture.py index 48236303701..152c60efc41 100644 --- a/exir/capture/_capture.py +++ b/exir/capture/_capture.py @@ -17,7 +17,7 @@ flatten_output, Value, ) -from functorch.experimental import functionalize +from torch.func import functionalize from torch import _guards from torch._dispatch.python import enable_python_dispatcher from torch._dynamo.eval_frame import Constraint diff --git a/extension/pytree/__init__.py b/extension/pytree/__init__.py index 60030274f07..d6e11e28600 100644 --- a/extension/pytree/__init__.py +++ b/extension/pytree/__init__.py @@ -1,6 +1,11 @@ # flake8: noqa: F401 -import warnings +import logging + +# Create a logger +logger = logging.getLogger(__name__) +logger.setLevel(logging.WARNING) + try: """ @@ -22,9 +27,8 @@ TreeSpec as TreeSpec, ) except: - warnings.warn( - "Unable to import executorch.extension.pytree, using native torch pytree instead." - ) + logger.info("Unable to import executorch.extension.pytree, using native torch pytree instead.") + from torch.utils._pytree import ( _broadcast_to_and_flatten, diff --git a/setup.py b/setup.py index af70aa03149..9a662cc2966 100644 --- a/setup.py +++ b/setup.py @@ -6,6 +6,13 @@ from setuptools.command.egg_info import egg_info from setuptools.command.install import install +# Dependencies +required_packages = [ + "numpy", + "zstd", + "flatbuffers", + # "torch_nightly" # This is not available on PyPI. Please install manually. +] def custom_command(): src_dst_list = [ @@ -53,4 +60,5 @@ def run(self): "develop": CustomDevelopCommand, "egg_info": CustomEggInfoCommand, }, + install_requires=required_packages, )