Skip to content

Add kernel compilation pass for ORC JIT remote execution#2850

Draft
rniczh wants to merge 7 commits into
mainfrom
rniczh/orc-jit
Draft

Add kernel compilation pass for ORC JIT remote execution#2850
rniczh wants to merge 7 commits into
mainfrom
rniczh/orc-jit

Conversation

@rniczh

@rniczh rniczh commented May 17, 2026

Copy link
Copy Markdown
Member

Context:

Description of the Change:

ENABLE_REMOTE=ON make all

Take x86_64 as an example:

import os

import pennylane as qp

import jax.numpy as jnp
from catalyst import qjit
from catalyst.pipelines import default_pipeline

REMOTE_TARGET_TRIPLE = "x86_64-linux-gnu"
REMOTE_ADDRESS = "ADDRESS:PORT"
WORKSPACE = os.path.dirname(os.path.abspath(__file__))


def _pipeline_with_cross_compile():
    stages = default_pipeline()
    cross_compile = (
        "cross-compile-remote-kernels"
        f"{{workspace={WORKSPACE} "
        f"target={REMOTE_TARGET_TRIPLE} address={REMOTE_ADDRESS}}}"
    )
    for name, passes in stages:
        if name == "MLIRToLLVMDialectConversion":
            passes.insert(0, cross_compile)
            break
    return stages

def main():
    dev = qp.device("lightning.qubit", wires=2)

    @qjit(pipelines=_pipeline_with_cross_compile(), keep_intermediate="pass")
    @qp.qnode(dev)
    def circuit(theta, weights):
        qp.RX(theta, wires=0)
        qp.RY(weights[0, 0], wires=0)
        qp.RZ(weights[1, 1], wires=1)
        return qp.expval(qp.PauliZ(0)), qp.probs(wires=[0, 1])

    print(circuit(0.5, jnp.array([[0.1, 0.2], [0.3, 0.4]])))


if __name__ == "__main__":
    main()

TODO:

  • remove remote_close, it's useless.

Benefits:

Possible Drawbacks:

Related GitHub Issues:
[sc-119223]

@rniczh

rniczh commented Jun 8, 2026

Copy link
Copy Markdown
Member Author

We split this PR to the following PRs for reviewing.
#2909
#2910
#2915
#2916
#2889
#2904

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