♻️ Define target compilation with payload specifications - #2219
♻️ Define target compilation with payload specifications#2219burgholzer wants to merge 1 commit into
Conversation
b53e303 to
c62e088
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
c62e088 to
ae5b72f
Compare
burgholzer
left a comment
There was a problem hiding this comment.
This one will likely still need a bit of work to iron out the details.
ae5b72f to
b0dd192
Compare
|
Important Approval pendingCodeRabbit has no unresolved comments, but it has not reviewed the latest commit. Use the checkbox below to review the latest commit. CodeRabbit will approve the changes if it finds no blocking issues.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
b0dd192 to
bb0240b
Compare
|
This looks much cleaner now. And should also be ready. |
Represent the selected hardware target and payload specification as one validated target environment. Cache that value through the MLIR analysis manager for mapping, native synthesis, and conformance. Derive targeted compiler output from the selected payload format in the C++, Python, and mqt-cc APIs. Keep untargeted output selection independent. Assisted-by: GPT-5.6 Sol via Codex
bb0240b to
28284fa
Compare
|
@simon1hofmann @denialhaag any feedback on this one from your side? |
Going through this now and will provide feedback in around 15min. |
simon1hofmann
left a comment
There was a problem hiding this comment.
Also went through the changes here and they look really clean 👍
denialhaag
left a comment
There was a problem hiding this comment.
This also looks pretty clean to me! 😌 I just have two observations and a small reminder:
There was a problem hiding this comment.
My earlier point about removing the MQT_ prefix will probably show up during rebasing here, but just as a reminder.
There was a problem hiding this comment.
Good to keep it in mind!
| ) | ||
|
|
||
| target = CompilerTarget.from_device_id("mqt.sc.iqm.garnet") | ||
| payload = PayloadSpecification(PayloadFormat("qir", "2.1.0", "base", PayloadEncoding.BINARY)) |
There was a problem hiding this comment.
Does QIR even have a patch version? 🤔 It doesn't look like here: https://github.com/qir-alliance/qir-spec/blob/f5647346542d5a65225c3eb349847fe4df01d1b2/specification/profiles/Base_Profile.md#L179-L180
There was a problem hiding this comment.
Not really. I was just about to argue that it is cleaner if one always specifies a full semver tripple. But one could also argue that this should actually be a version range following the python dependency specification.
That would allow to express things like "accepts OpenQASM 3" or "accepts QIR 2.1" or more. Adds a fair bit of complexity probably, but may be worth it.
Any thoughts?
There was a problem hiding this comment.
Hmm, I do understand the intention behind requiring a full SemVer triple, but OpenQASM and QIR really seem like prime examples where people generally don't think too much about patch (and sometimes even minor) versions. I'd say relaxing the condition could be worth it. 🤔
There was a problem hiding this comment.
Technically, both formats have a minor version that is kind of meaningful (OpenQASM 3.1 and QIR 2.1) but I agree with you that people typically do not care and just refer to them as OpenQASM 3 and QIR 2 (or even just QIR for the sake of it).
Let's what gpt-5.6 comes up with in plan mode later 😌
🤖 AI text below 🤖
Description
Make the selected hardware target and payload specification the single source of truth for target compilation.
This pull request:
PayloadSpecificationwith an exactPayloadFormat, capabilities, and typed constraints;TargetEnvironment;mqt.target_envmodule attribute;mqt-cc; andThis PR is stacked on #2215. The focused child PRs #2226 and #2227 connect QDMI v1.4 program formats and feature records to this provider-neutral compiler interface before #2220.
Validation
mqt-ccQIR output test: passed.uvx nox --non-interactive -s lint: passed.git diff --check: passed.AI assistance: OpenAI Codex assisted with implementation, review, testing, and this description.
Checklist
If PR contains AI-assisted content:
🤖 *AI text below* 🤖(titles are exempt).