llvm / llvm/lighthouse

[execution] support for higher dim memory allocation in the execution engine

Open
#147 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
55
Forks
19
Avg merge
1d 23h
Merged PRs (30d)
15

Description

I have kernel (fused attention) that deals with 4d tensors. and it fails with.

```
File "/home/jovyan/lighthouse/examples/xegpu/fused_attention.py", line 362, in
times = runner.benchmark(
^^^^^^^^^^^^^^^^^
File "/home/jovyan/lighthouse/lighthouse/execution/runner.py", line 186, in benchmark
return self._execute_kernel(
^^^^^^^^^^^^^^^^^^^^^
File "/home/jovyan/lighthouse/lighthouse/execution/runner.py", line 154, in _execute_kernel
with allocator() as inputs:
File "/home/jovyan/miniforge3/envs/imex-dev-torch-mlir/lib/python3.11/contextlib.py", line 137, in __enter__
return next(self.gen)
^^^^^^^^^^^^^^
File "/home/jovyan/lighthouse/lighthouse/execution/memory_manager.py", line 139, in clone_host_buffers
buf = self.alloc(
^^^^^^^^^^^
File "/home/jovyan/lighthouse/lighthouse/execution/memory_manager.py", line 88, in alloc
assert rank in (1, 2), "Only 1d or 2d arrays are supported."
^^^^^^^^^^^^^^
AssertionError: Only 1d or 2d arrays are supported.
```

any plans for supporting this? workarounds also welcome.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure from examples/xegpu/fused_attention.py around line 362, then inspect lighthouse/execution/memory_manager.py, especially alloc and clone_host_buffers, and the call path in lighthouse/execution/runner.py. Done means the fused-attention example can allocate and execute its 4D tensors without triggering the current rank assertion.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.