Commit Graph

100 Commits (ed901094c1a8d0ef07ef6a34abdd4df07501268a)

Author SHA1 Message Date
Sean Silva de4bcbfe9b [docs] Centralize all images in docs/images/ 2022-11-04 03:12:17 -07:00
Daniel Ellis 8d3ca887df Update installation instructions to point to new releases page. 2022-09-27 14:26:38 -04:00
Sambhav Jain e749831434
[Arch] Remove torch_dispatch frontend and move figure to docs/ dir (#1372)
Addresses leftover comment from earlier PRs: #1254 , #1265 to remove `torch_dispatch` frontend. In addition, moves the main arch diagram into `docs/` directory for consistency.
2022-09-14 23:00:38 -07:00
Sean Silva f402eb270e Move development.md to docs/ for consistency 2022-08-29 13:26:25 -07:00
Henry Tu 61db88c9ec LTC Documentation (#1021)
* Create ltc_backend.md

* Added introduction and examples

* Added descriptions for files from autogen

* Added remaining file descriptions

* architecture overview

* Added subheadings to architecture section

* Description for implementing custom backend

* Add graphics

* Future expansion

* Remove "location" in architecture section

* Updated LTC in readme

* Remove extra space in example

* Fix typo

* Reworded vendor compilation process

* Address PR review comments

* Updated diagrams

* Add kernel registration to diagram

* Address PR comments

* Create separate ltc_examples file

* PyBind -> pybind
2022-07-30 09:40:02 -04:00
Henry Tu a3244b6a44 Update README.md to reflect LTC landing in main branch (#1000)
* Update README.md

* Update README.md

Co-authored-by: Jae Hoon (Antonio) Kim <17433012+antoniojkim@users.noreply.github.com>

* Update README.md

Co-authored-by: Jae Hoon (Antonio) Kim <17433012+antoniojkim@users.noreply.github.com>

* Update README.md

Co-authored-by: Jae Hoon (Antonio) Kim <17433012+antoniojkim@users.noreply.github.com>
2022-07-30 09:40:02 -04:00
Sean Silva b36a17c9d2
README: Add op office hours 2022-07-28 15:11:49 -07:00
powderluv 4bf34523d7
Update README.md 2022-06-10 20:00:43 -07:00
Sean Silva 30adb1e675
Add weekly meetings to the readme. 2022-05-20 06:21:04 -07:00
Sean Silva 07d92bcbb4
Remove mention of python-dev.
It belongs in the development docs.
2022-05-02 09:09:40 -07:00
Sean Silva f31743b651
Mention installing python-dev package.
See https://github.com/llvm/torch-mlir/issues/647#issuecomment-1114328241
2022-05-02 05:50:16 -07:00
powderluv a9ef4bb378
Move development notes to development.md (#800)
* Update README.md

* Create development.md

Add a separate development.md file
2022-04-26 11:28:04 -07:00
powderluv 50297864df
Update README.md (#785) 2022-04-26 07:19:48 -07:00
Ashay Rane 28bf9cc1fc doc: [nfc] add instruction for running Python regression tests
Prior to this patch, the top-level README did not include the line for
running the Python regression tests in `//python/test`.  This patch
fixes the problem by adding a line to run the `check-torch-mlir-python`
target.
2022-04-22 10:54:04 -04:00
Clément Fournier 8d700dee21 Improve README 2022-04-19 15:11:17 -07:00
Clément Fournier 2a0c567418 Add README instructions for OOT build 2022-04-19 15:11:17 -07:00
Maksim Levental eecbf0bab6
Eager mode description in the README and small example and ResNet18 example. (#707) 2022-03-28 23:54:06 -05:00
Sean Silva 52c330cca2 Fix some more uses of "e2e" that I missed in the last commit. 2022-03-28 19:09:56 +00:00
Sean Silva e59a91620a Tidy up README and examples
- update diagram to use the name "Eager Mode" instead of
  `torch.dispatch`, which wasn't a very accurate name
- rename `resnet_inference.ipynb` to
  `torchscript_resnet_inference.ipynb` - this is in preparation to LTC
  and Eager Mode versions
- remove mention of TorchFX - turns out that all TorchFX modules are
  actually scriptable modules, so there is literally "zero code" vs
  using the TorchScript path
- remove LazyTensorCore example, and instead point at the current
  in-development `torch_mlir_ltc_backend` branch.

Note: there were actually some pretty useful utilities built out in the
examples directory, but they now live inside the Eager Mode
`python/torch_mlir/eager_mode/ir_building.py` (and need to be rolled
into a proper home with the upcoming rewrite of our top-level
`torch_mlir.compile` API).
2022-03-28 10:05:58 -07:00
Ahmed S. Taei 8383497704
[NFC] Rename external -> externals (#699) 2022-03-26 09:12:27 -07:00
Prashant Kumar 126dac3ded Cmake build commands fix.
The external projects torch-mlir and torch-mlir-dialects should be
placed inside double quotes.
2022-02-16 20:46:53 +05:30
Yi Zhang 869daf3c22 Add TMTensor dialect to torch-mlir
This is intended to explore support for non-structured ops that can't
be modeled by Linalg dialect. `tm_tensor.scan` and `tm_tensor.scatter`
are added as the first such ops. The dialect should aim to be
upstreamed in the future.
2022-02-15 16:45:38 -05:00
Sean Silva 76728491cb
Polish readme. 2022-01-19 13:19:46 -08:00
Sean Silva a75ae82530
README: Move Project Communication section higher
People might want to lurk on discord, and not even check out the code yet.
2021-11-08 11:18:00 -08:00
Stella Laurenzo a23d77100b Set some wheel building optimization options.
* Also adds a requirements.txt and updates docs to reference it versus stringy pip install.
* Adds doc with instructions on creating a wheel.

Fixes #370
2021-10-25 18:30:53 +00:00
Stella Laurenzo fe69bb339c
Bump llvm-project to 3d92722f74993969243d1400bc3257ca3d03902f. (#369)
* Picks up Python configure changes (was pinned to a bad intermediate commit).
* Uses the new mlir_configure_python_dev_packages() to ensure CMake python is found consistently.
* Fixes the JIT importer to build as a MODULE vs SHARED (needed for linking to Python as a module, per config changes).
* Adds some notes to the README to help folks build a smaller set focused just on this project.
2021-10-21 21:09:00 -07:00
Boian Petkantchin 393bd211c7 In readme build instructions force CMake to use Python virtual env
By default CMake is quite happy to use any Python that it finds
to fit the version requirements.
2021-10-14 10:27:56 -07:00
Sean Silva 00e94c70ef Remove packaging info for now.
Need to do manylinux build for it to work across many machines.
2021-10-07 01:38:42 +00:00
Sean Silva de8ea59d52 Fix feedback from Anush. 2021-10-07 01:28:13 +00:00
Sean Silva a157d6c946 Add instructions for installing from packages. 2021-10-07 01:20:49 +00:00
Phoenix Meadowlark c3e0a1e1dc Add shell markdown formatting to README.md 2021-10-04 11:59:25 -07:00
Ramiro Leal-Cavazos 3aef3a9e30 Remove duplicate example + fix README typo 2021-09-30 13:23:25 -07:00
Sean Silva 05a01b10b3
Add example deps for torchscript_resnet18_e2e.py 2021-09-30 12:48:35 -07:00
powderluv 649d6e4f28 Update README.md 2021-09-29 10:14:20 -07:00
Sean Silva 4a64fa28e7
Add MLP1Layer IR sample. 2021-09-29 09:20:04 -07:00
powderluv 36ac87dd83
Update Readme with examples (#336) 2021-09-28 21:43:38 -07:00
Ramiro Leal-Cavazos b59f2cb673
Implement the lazytensor package (#331)
Implement the `lazytensor` python package for converting
lazy computations captured by the Lazy Tensor Core into MLIR.
This PR also fixes a few things with `torchfx` and its example
2021-09-28 17:25:06 -07:00
Sean Silva 2b99c8b990
Wordsmith readme 2021-09-28 13:53:33 -07:00
powderluv b55baf508a
Updates to Readme.md (#334) 2021-09-28 13:50:25 -07:00
Sean Silva de1a8c92f7 First pass cleaning the README 2021-09-27 17:20:50 -07:00
Anush Elangovan 06559efe94 Update diagram and Readme.md 2021-09-23 14:34:02 -07:00
powderluv 81a9cf7800 Update README.md 2021-09-23 11:50:02 -07:00
Sean Silva b6be96d722 [torch-mlir earthmoving (2/N)] Python code movement.
This moves the bulk of the Python code (including the Torch interop)
from `frontends/pytorch` into `torch-mlir/TorchPlugin`. This also
required reconciling a bunch of other Python-related stuff, like the
`torch` dialects.

As I did this, it was simpler to just remove all the old numpy/basicpy
stuff because we were going to delete it anyway and it was faster than
debugging an intermediate state that would only last O(days) anyway.

torch-mlir has two top-level python packages (built into the
`python_packages` directory):

- `torch_mlir_dialects`: `torch` dialect Python bindings (does not
  depend on PyTorch). This also involves building the aggregate CAPI for
  `torch-mlir`.
- `torch_mlir`: bindings to the part of the code that links against
  PyTorch (or C++ code that transitively does).

Additionally, there remain two more Python packages in npcomp (but
outside `torch-mlir`):

- `npcomp_torch`: Contains the e2e test framework and testing configs
  that plug into RefBackend and IREE.
- `npcomp_core`: Contains the low-level interfaces to RefBackend and
  IREE that `npcomp_torch` uses, along with its own
  `MLIR_PYTHON_PACKAGE_PREFIX=npcomp.` aggregation of the core MLIR
  python bindings. (all other functionality has been stripped out)

After all the basicpy/numpy deletions, the `npcomp` C++ code is now very
tiny. It basically just contains RefBackend and the `TorchConversion`
dialect/passes (e.g. `TorchToLinalg.cpp`).

Correspondingly, there are now 4 main testing targets paralleling the
Python layering (which is reflective of the deeper underlying dependency
structure)

- `check-torch-mlir`: checks the `torch-mlir` pure MLIR C++ code.
- `check-torch-mlir-plugin`: checks the code in `TorchPlugin` (e.g.
  TorchScript import)
- `check-frontends-pytorch`: Checks the little code we have in
  `frontends/pytorch` -- mainly things related to the e2e framework
  itself.
- `check-npcomp`: Checks the pure MLIR C++ code inside npcomp.

There is a target `check-npcomp-all` that runs all of them.
The `torch-mlir/build_standalone.sh` script does a standalone build of
`torch-mlir`.

The e2e tests (`tools/torchscript_e2e_test.sh`) are working too.

The update_torch_ods script now lives in
`torch-mlir/build_tools/update_torch_ods.sh` and expects a standalone
build.

This change also required a fix upstream related to cross-shlib Python
dependencies, so we also update llvm-project to
8dca953dd39c0cd8c80decbeb38753f58a4de580 to get
https://reviews.llvm.org/D109776 (no other fixes were needed for the
integrate, thankfully).

This completes most of the large source code changes. Next will be
bringing the CI/packaging/examples back to life.
2021-09-15 13:40:30 -07:00
Sean Silva 496051163f Rename npcomp-run-mlir to refback-run
This better represents its limited scope. This was causing confusion --
people were feeding it higher level ops that require frontend lowering.
2021-08-03 18:24:24 -07:00
Sean Silva 719f0cd709 Minor wordsmithing to README 2021-08-03 14:59:58 -07:00
Sean Silva a153cf4ef2 Refresh Dockerfile and instructions.
Related to https://github.com/llvm/mlir-npcomp/issues/266
2021-08-03 14:54:39 -07:00
Sean Silva 453e29ea05 Add E2E support for tests with heavy dependencies (heavydep tests).
The tests use the same (pure-Python) test framework as the
normal torchscript_e2e_test.sh, but the tests are added in
`build_tools/torchscript_e2e_heavydep_tests` instead of
`frontends/pytorch/e2e_testing/torchscript`. Any needed dependencies can
easily be configured in generate_serialized_tests.sh.

We add an initial machine translation model with a complex set of
dependencies to seed the curriculum there. I verified that this model
gets to the point of MLIR import (it fails there with a segfault due to
not being able to import the "Any" type).

This required moving a few files from the `torch_mlir` Python module
into multiple modules to isolate the code that depends on our C++
extensions (which now live in `torch_mlir` and
`torch_mlir_torchscript_e2e_test_configs`) from the pure Python code
(which now lives in `torch_mlir_torchscript`). This is an entirely
mechanical change, and lots of imports needed to be updated.

The dependency graph is:
```
       torch_mlir_torchscript_e2e_test_configs
                  /              |
                 /               |
                /                |
               V                 V
torch_mlir_torchscript       torch_mlir
```

The `torch_mlir_torchscript_e2e_test_configs` are then dependency-injected
into the `torch_mlir_torchscript` modules to successfully assemble a
working test harness (the code was already structured this way, but this
new file organization allows the isolation from C++ code to actually
happen).  This isolation is critical to allowing the serialized programs
to be transported across PyTorch versions and for the test harness to be
used seamlessly to generate the heavydep tests.

Also:
- Extend `_Tracer` class to support nested property (submodule) accesses.

Recommended review order:
- "user-level" docs in README.md
- code in `build_tools/torchscript_e2e_heavydep_tests`.
- changes in `torch_mlir_torchscript/e2e_test/framework.py`
- misc mechanical changes.
2021-08-03 14:09:56 -07:00
Stella Laurenzo 445472c51e Build packages for npcomp-torch.
* Adds a minimal setup.py for frontends/pytorch
* Makes npcomp-core export its headers and libraries
* Adds a script to build packages.
* Adds CI step to package and smoke test.
* Will need some more tweaks and coordination prior to deploying (version locking etc).
2021-07-29 19:58:59 -07:00
Yi Zhang 6fbf94f0b2 Update readme and scripts for setting the new PYTHONPATH
Add scripts for generating .env and update instructions in README.
2021-07-28 15:06:40 -04:00
Stella Laurenzo 2dbab50444
Rework the python build to a static assembly of MLIR+NPCOMP (#251)
* Adapt to python build system updates.

* Bump llvm to 310c9496d80961188e8d8f8ad306cdf44bd7541f (includes python build updates)
* Adds refback C-API.
* Re-layers all python builds.
* Rework CI.
2021-07-27 16:10:10 -07:00