-
Notifications
You must be signed in to change notification settings - Fork 59
New OQD end-to-end pipeline is added to Catalyst #2299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
|
||
| CO_MSG(options, Verbosity::All, "[ARTIQ] Linking ELF: " << lldCmd << "\n"); | ||
|
|
||
| int lldResult = std::system(lldCmd.c_str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OS command Injection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to use LLVM C++ API to compile it to object file directly without llc steps in, we need to add ARM target when building LLVM
-DLLVM_TARGETS_TO_BUILD="host;ARM"
And on more thing should be noted is that the we also need to build lld to get the linker as well.
Need lld in LLVM_PROJECTS, for clarification:
LLVM_ENABLE_LLD=ON is different, this is about using lld as the linker during LLVM’s own build, not necessarily building the ld.lld binary
LLVM_PROJECTS ?= mlir;lld
|
Hello. You may have forgotten to update the changelog!
|
Context:
Description of the Change:
This pipeline enables Catalyst to compile circuit for ARTIQ-based quantum device. When
device_dbconfiguration is provided, the compilation follows the ARTIQ route:ions-decomposition: Decompose quantum operations for trapped ion systemsgates-to-pulses: Convert gate operations to pulse sequencesconvert-ion-to-rtio: Convert ion operations to RTIO dialectconvert-rtio-event-to-artiq: Lower RTIO event to ARTIQ's primitivesllvm-dialect-lowering-stage: Lower to LLVM IRemit-artiq-runtime: Generate ARTIQ runtime entry point as wrapper for ARITQ device to executeThe final stage compiles LLVM IR to an ELF binary targeting the ARTIQ device (ARM Cortex-A9). Due to current limitations where Catalyst's internal LLVM build does not include the corresponding ARM backend, the compilation will use
llcto compile.llto object file, and useld.lldto compile to.elfReplace the artiq configs to your own env setting:
The result will store in the
circuit/And you can run it on artiq device:
Benefits:
Possible Drawbacks:
It causes the OQD specific compile stuffs steps into the original catalyst compiler driver's pipepline
TODOs: (Need further discussions)
llcRelated GitHub Issues:
[sc-100853]