Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sql/join): add nested-loop join example #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bsarden-rivos
Copy link
Owner

  • Adds a nested loop join example using pytorch API's.
  • Attempts to lower the join operator through the iree-torch
    lowering pipeline(s). We fail on the following error in torch-mlir
    currently.
Exception:
Lowering TorchScript IR -> Torch Backend IR failed with the following diagnostics:
error: operand types should have the same type as the list contained type
note: see current operation: %14 = "torch.prim.ListConstruct"(%12, %13) :
  (!torch.vtensor<[1],si64>, !torch.vtensor<[2],si64>) -> !torch.list<vtensor<[1],si64>>

IR can be viewed here:
https://gist.github.com/bsarden-rivos/fab295529094243a17182b9f37945c1b

This patch adds a nested-loop `join` operator impl that runs on real
`TPC-H` data. The bench runs a join using `Pandas` and `PyTorch` API's
and compares the results.

To run:

```shell
(iree-torch.venv) $ export PYTHONPATH=`pwd`/python:$PYTHONPATH
(iree-torch.venv) $ python examples/join.py
```
This patch attempts to lower the `join` operator through the `iree-torch`
lowering pipeline(s). We fail on the following error in `torch-mlir`
currently.

```text
Exception:
Lowering TorchScript IR -> Torch Backend IR failed with the following diagnostics:
error: operand types should have the same type as the list contained type
note: see current operation: %14 = "torch.prim.ListConstruct"(%12, %13) :
  (!torch.vtensor<[1],si64>, !torch.vtensor<[2],si64>) -> !torch.list<vtensor<[1],si64>>
```

IR can be viewed here:
https://gist.github.com/bsarden-rivos/fab295529094243a17182b9f37945c1b
@bsarden-rivos bsarden-rivos self-assigned this Jun 27, 2022
@bsarden-rivos bsarden-rivos changed the title test(join): add nested-loop join example feat(sql/join): add nested-loop join example Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant