Skip to content

Commit e72816d

Browse files
msaroufimfacebook-github-bot
authored andcommitted
Improve setup instructions (#24)
Summary: Pull Request resolved: #24 Reviewed By: kimishpatel, cccclai Differential Revision: D47814545 Pulled By: msaroufim fbshipit-source-id: 197ad900d2948f7caa5edaa2196654f030fb2282
1 parent 27ba498 commit e72816d

File tree

6 files changed

+17
-6
lines changed

6 files changed

+17
-6
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
buck-out/
22
executorch.egg-info
33
__pycache__/
4+
build/lib/
5+
exir/serialize/scalar_type.fbs
6+
exir/serialize/schema.fbs

docs/website/docs/tutorials/setting_up_executorch.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ git clone https://github.com/pytorch/executorch.git
2828
git clone [email protected]:pytorch/executorch.git
2929

3030
# [Runtime requirement] Run the following to get all submodules, only need for runtime setup
31+
cd executorch
3132
git submodule update --init --recursive
3233

33-
pip install executorch
34+
pip install .
3435

3536
# cd into a directory that doesn't contain a `./executorch/exir` directory, since
3637
# otherwise python will try using it for `import executorch.exir...` instead of using the
@@ -53,7 +54,7 @@ Or via python interpreter:
5354
>>> from executorch.exir.tests.models import Mul
5455
>>> m = Mul()
5556
>>> print(exir.capture(m, m.get_random_inputs()).to_edge())
56-
>>> exir.capture(m, m.get_random_inputs()).to_edge().to_executorch().buffer
57+
>>> open("add.ff", "wb").write(exir.capture(m, m.get_random_inputs()).to_edge().to_executorch().buffer)
5758
```
5859

5960
## Runtime Setup

exir/capture/TARGETS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ python_library(
2121
":config",
2222
":unlift",
2323
"//caffe2:torch",
24-
"//caffe2/functorch:functorch_src",
2524
"//executorch/exir:error",
2625
"//executorch/exir:tracer",
2726
"//executorch/exir/program:lib",

exir/capture/_capture.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
flatten_output,
1818
Value,
1919
)
20-
from functorch.experimental import functionalize
2120
from torch import _guards
2221
from torch._dispatch.python import enable_python_dispatcher
2322
from torch._dynamo.eval_frame import Constraint
2423
from torch._export import CallSpec, export, ExportGraphSignature
2524
from torch._export.passes import ReplaceViewOpsWithViewCopyOpsPass
2625
from torch._subclasses.fake_tensor import FakeTensor, FakeTensorMode
26+
from torch.func import functionalize
2727
from torch.fx._compatibility import compatibility
2828
from torch.fx.experimental.proxy_tensor import make_fx
2929
from torch.fx.experimental.symbolic_shapes import ShapeEnv

extension/pytree/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# flake8: noqa: F401
22

3-
import warnings
3+
import logging
4+
5+
# Create a logger
6+
logger = logging.getLogger(__name__)
7+
logger.setLevel(logging.WARNING)
8+
49

510
try:
611
"""
@@ -22,7 +27,7 @@
2227
TreeSpec as TreeSpec,
2328
)
2429
except:
25-
warnings.warn(
30+
logger.info(
2631
"Unable to import executorch.extension.pytree, using native torch pytree instead."
2732
)
2833

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ dependencies=[
99
"ruamel.yaml",
1010
"pyyaml",
1111
"sympy",
12+
"numpy",
13+
"zstd",
14+
"flatbuffers",
1215
]
1316

1417
[tool.setuptools.package-data]

0 commit comments

Comments
 (0)