PennyLaneAI / PennyLaneAI/catalyst

3029 follow-up: Eliminate the rebinding of allocation primitives

Open
#3,055 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
234
Forks
84
Avg merge
2d 15h
Merged PRs (30d)
66

Description

Commenting for new issue:

Eliminate the rebinding of pl allocation primitives during the from_plxpr lowering, since these primitives now have a direct to mlir lowering. Then the TODO can be removed.

Also remove the qref_alloc_p and qref_dealloc_p primitives, and replace their use in the handle_qnode/calling_convention function with the equivalent pennylane primitives.

Originally posted by @dime10 in https://github.com/PennyLaneAI/catalyst/pull/3029#discussion_r3639261040

Contributor guide

Open the contributing guide

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

Locate the from_plxpr lowering code and the handle_qnode/calling_convention function mentioned in the issue, then inspect how allocation primitives and qref_alloc_p/qref_dealloc_p are currently used. Confirm the direct MLIR lowerings and the existing TODO before removing the rebinding and replacing the qref primitives; done means those obsolete bindings, primitives, and TODO are gone without changing the lowering behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
compilers
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.