iree-org / iree-org/iree

Incorrect import statement generated in python bindings

Open
#16,628 3 comments 0 reactions 0 assignees View on GitHub
bug 🐞
Dominant language
C++
Stars
3.9k
Forks
1k
Avg merge
4d 16h
Merged PRs (30d)
47

Description

### What happened?

During the binding generation process the following line is created in `iree-build/runtime/bindings/python/iree/runtime/_binding.py`:
```
from .._runtime.libs import _runtime
```
This causes an error when trying to import iree-runtime python modules.

This can be trivially fixed by replacing the line above with
```
from .._runtime_libs import _runtime
```
Unfortunately, I'm not familiar with the binding generation methods used and cannot come up with an MR to fix it.

### Steps to reproduce your issue

1. Build IREE with python bindings
2. Try to import iree-runtime into a python script

### What component(s) does this issue relate to?

Python

### Version information

`14895845b Adding iree-benchmark-executable help text for CUDA.`

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the generated file `iree-build/runtime/bindings/python/iree/runtime/_binding.py` and trace the binding-generation entry point that produces its import statement. Reproduce the Python import failure after building the bindings, then verify that the generated module imports successfully with the corrected `_runtime_libs` path.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.