Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental committed Dec 17, 2023
1 parent 86dd476 commit d04ad31
Showing 1 changed file with 5 additions and 23 deletions.
28 changes: 5 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,6 @@ The few main features/affordances:
See [mlir_utils.types](https://github.com/makslevental/mlir-python-utils/blob/a9885db18096a610d29a26293396d860d40ad213/mlir_utils/types.py) for details.
\
 
4. `register_value_caster` (enables `C[i, j]` above)
\
 
1. This is a mechanism for registering a python wrapper class that should wrap an `ir.Value` when that `ir.Value` is fetched using `ir.Operation.results`.
They are primarily called by the generated wrappers.
They enable you to associate "creative" methods with the `ir.Value` (like `__add__` or `__getitem__`).
They are keyed on the `mlir::TypeID` of the `ir.Type` of the `ir.Value` (through `ir.Type.typeid`, or more robustly, through `ir.Type.static_typeid`).
\
\
See [mlir_utils.types](https://github.com/makslevental/mlir-python-utils/blob/a9885db18096a610d29a26293396d860d40ad213/mlir_utils/types.py) for details.
\
 
4. `Pipeline()`
\
 
Expand All @@ -139,22 +127,17 @@ But, open an issue if something isn't clear.

## Install

First
This package is meant to work in concert with host bindings.
Practically speaking that means you need to have *some* package installed that includes mlir python bindings.

```shell
$ HOST_MLIR_PYTHON_PACKAGE_PREFIX=<YOUR_HOST_MLIR_PYTHON_PACKAGE_PREFIX> pip install git+https://github.com/makslevental/mlir-python-utils
```
So

This package is meant to work in concert with host bindings.
Practically speaking that means you need to have *some* package installed that includes mlir python bindings, **and you need to `mlir-python-utils-generate-all-upstream-trampolines`**.
So after pip-installing you need to
```shell
$ <YOUR_HOST_MLIR_PYTHON_PACKAGE_PREFIX>-mlir-python-utils-generate-all-upstream-trampolines
$ YOUR_HOST_MLIR_PYTHON_PACKAGE_PREFIX=<YOUR_HOST_MLIR_PYTHON_PACKAGE_PREFIX> pip install git+https://github.com/makslevental/mlir-python-utils
```

where `YOUR_HOST_MLIR_PYTHON_PACKAGE_PREFIX` is (as it says) the package prefix for your chosen host bindings.
**When in doubt about this prefix**, it is everything up until `ir` when you import your bindings, e.g., in `import torch_mlir.ir`, `torch_mlir` is the `HOST_MLIR_PYTHON_PACKAGE_PREFIX` for the torch-mlir bindings.
Thus, for torch-mlir host bindings, you would execute `torch-mlir-mlir-python-utils-generate-all-upstream-trampolines`.
Note, the underscore in `torch_mlir` becomes a dash in `torch-mlir-mlir-python-utils-generate-all-upstream-trampolines`.

If you don't have any such package, but you want to experiment anyway, you can install the "stock" upstream bindings first:

Expand All @@ -166,7 +149,6 @@ and then

```shell
$ pip install git+https://github.com/makslevental/mlir-python-utils
$ mlir-python-utils-generate-all-upstream-trampolines
```

## Examples/Demo
Expand Down

0 comments on commit d04ad31

Please sign in to comment.