Fix issues around frontend path discovery of externally built extension modules
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- python
- Domain
- build-system
Research direction
Start with frontend/catalyst/jax_primitives.py, frontend/catalyst/compiler.py, and frontend/catalyst/init.py, then review doc/conf.py and the linked module changes in pull request 2259. Check the discussion in pull request 2713 about custom build directories. Done means externally built modules are discovered uniformly without repeated path entries, while docs-only imports and non-installed custom builds continue to work.
Written by the indexing model from the issue text.
Description
A few issues around path discovery of externally built extension modules:
1) Runtime nanobind module discovery repeatedly appends to path
There are two locations where this happens for the runtime registry module:
and
Because these lines are run every-time functionality from the module is used, the system path would get polluted with more and more duplicate entries. This doesn't break anything but is not ideal.
A solution could perform this task once upon import for example, similar to how we handle the mlir_quantum module:
https://github.com/PennyLaneAI/catalyst/blob/c6f318051063316f2e23e4c01808744ed5c2c51f/frontend/catalyst/__init__.py#L55-L62
The thing to keep in mind is that these modules may not exist in some contexts, in particular for a CI docs build which uses only the Python code. So code importing such modules would fail in this context. Typically, we resolve this with mocking the modules in the docs config:
2) The fix should consider a similar module that will be merged soon from the MLIR component to make sure all such modules are handled uniformly
See https://github.com/PennyLaneAI/catalyst/pull/2259 which introduced the new module.
3) The path mlir_quantum should consider custom build directories when not in INSTALLED mode.
See also https://github.com/PennyLaneAI/catalyst/pull/2713#discussion_r3126902923 for a discussion of this.
- Dominant language
- Python
- Stars
- 234
- Forks
- 84
- Avg merge
- 3d 11h
- Merged PRs (30d)
- 78
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PennyLaneAI/catalyst
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
PennyLaneAI/catalyst#3489 ·
Maintainers usually reply within 1 day
-
Fix platform tag for macOS wheelsMay be free again @sarehaskari17 claimed this 107 days ago, and no pull request is open. OpenCI/Build enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
PennyLaneAI/catalyst#2907 · 2 comments ·
Maintainers usually reply within 1 day
-
The docs page for `CompileOptions` is missing a description for the `target` attributePossibly taken @daxsh2803 claimed this 68 days ago. Opendocumentation
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
PennyLaneAI/catalyst#2653 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 68/100
PennyLaneAI/catalyst#3550 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 57/100
PennyLaneAI/catalyst#3497 ·
Maintainers usually reply within 1 day
All issues in PennyLaneAI/catalyst
Similar issues
-
docs(contributing): the two things that silently block a PRPossibly taken A pull request linked to this issue is open or already merged. Openavailable documentation good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 95/100
Nixitov/Riptide-Native#944 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
JTHCode/secretguard#24 ·
Maintainers usually reply within 1 day
-
area: middleware documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
omarelshamy25x/shamy-hijri#63 ·
Maintainers usually reply within 1 day