-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add QrackCircuit to compiler options #88
Conversation
Thanks for trying out UCC and benchmarking against Qrack! Very nice results on the gate reductions. |
So I just took a look at the benchmark notebook where you added the Qrack compile function: def qrack_compile(qiskit_circuit):
"""Compile given qiskit.QuantumCircuit object and return the compiled circuit and total number of raw and compiled 2 qubit gates"""
qrack_circuit = QrackCircuit.in_from_qiskit_circuit(qiskit_circuit)
qiskit_circuit = qrack_circuit.to_qiskit_circuit()
qiskit_circuit = qiskit_transpile(qiskit_circuit, optimization_level=3, basis_gates=['rz', 'rx', 'ry', 'h', 'cx']) @WrathfulSpatula I thought you said above that you only used Qiskit with |
@jordandsullivan I tried level 0, but I settled on 3 due to improved results. (To memory, I thought I said that I used 3, but apologies if that wasn't clear.) Note that if we're using |
I have a few more thoughts about this: it's true that the compilation time might be roughly 10x slower, when making a round trip from Qiskit, to Also, I mean to call attention to a detail about the benchmark notebook: it requires As for the matter of I completely understand not including |
Thanks Dan. I was mainly asking to find out how much of the reduction was coming from Qiskit vs. Qrack. I certainly don't think Qrack is uninteresting or not worth including in a future version of UCC. I would just want to understand the structure better to see how we could most effectively integrate it. |
@jordandsullivan Thank you, and sorry if that came across as a bit confrontational. It's not UF's fault, but I have to get personal for a second: many times in Qrack's seven-year history, we've forwarded our software and sometimes our best attempt at comparative (simulation) benchmarks that seemed fair according to the specification and intent of other researchers we worked with who were running comparative benchmarks on simulators, only for them to pretend like we didn't exist or to be paid lip-service that our benchmarks would enter future iterations of results, never to see it ultimately happen, by years later. Now, recently, a couple of unrelated but relatively visible reports have portrayed Qrack simulation results as low-middling performance with no sufficient account of the Qrack settings they used to produce their data (and even getting basic factual details wrong, in peer-reviewed literature, about features like multi-GPU simulation that have been in use for years by the Qrack hobbyist community and authors). In other words, as lead author of Qrack, these reports simply lack sufficient details for me to even try in good faith to reproduce them, to understand what happened, while the Qrack coauthors are left saying to ourselves, "Please RTFM or at least talk to us before you do this," with no one else to hear us. Thank you, again. I realize that software development as part of a team can't shift roadmaps on a dime, and I know full well that there might be very real reasons not to directly use I'd love to discuss this further whenever it actually fits in the UCC workflow and roadmap. Sorry if that came across surly, but, again, thank you, because it's not UF's fault, nor yours. |
I heard you Dan. If you like, we can leave this PR open and circle back when we have more development bandwidth (say in the new year). I just don't want to merge it before launch on Dec 12 because if we add a Qrack dependency to run the default benchmarks, and it's performing better than default UCC in terms of gate reduction, this raises the question of why we haven't just integrated it, but as discussed above, there are nuances there which need to be figured out. Like could we do better by combining UCC and Qrack? Should we reimplement the Qrack Circuit optimization logic using the TranspilerPass classes we imported from Qiskit, or should we rethink the design philosophy? All good questions, and if you're interested in exploring them, I welcome it! My take is that we should wait until after public launch to integrate these changes into main. |
Jordan, from a product ownership and management perspective, I understand the desire and the request. However, scientifically, isn't this selective reporting? Doesn't this mean the benchmarks we intend to publicize, as Unitary Foundation, withhold essential information that's tucked back in an open PR on this repository, but publicly available through the Qrack repository for the functionality itself, for a long time, when anyone tries to argue that any one of these compilers leads in fair and complete comparison of a literature survey, not just |
hi @WrathfulSpatula! My understanding from our previous discussion is that QrackCircuit is optimized for a simulator framework such as Qrack, so I disagree with the assessment that it is selective reporting- rather it is trying to maintain only apples-to-apples comparison. While it is true that Qiskit conversion provides a workaround, it is no longer purely the Qrack compiler being benchmarked. That said, I'm game to investigate the multiplexing methods further, to see whether we can leverage them for an enhanced version of UCC. Please do be patient with our limited bandwidth to assess and respond given the tight deadline approaching. |
Misty, I'm sorry. Challenge my statement, in scientific honesty: What do our benchmarks mean, as Unitary Foundation, whether for |
I think I have an implementation of a compromise that serves and benefits the performance of both optimization pass sets: I'm running the benchmarks before committing and pushing to the branch, and I notice already that Qrack might be roughly 10 seconds faster on I also think it could behoove both projects to brand together rather than as distinct alternatives. |
I know you were working on additional improvements today, just give me a ping when you're ready for final review :) |
@jordandsullivan @Misty-W after a round of debugging, the tests pass for 32-bit floating-point precision tolerance, but the compiled gate reduction is very modest. However, it's still there! Personally, I would still mostly use This is ready for final review. I understand if consideration for inclusion is influenced by the reduction in the compiled gate differential, but, again, personally, I'd use |
Thanks for all your work on this Dan. I'm going to close it as not planned for now for the reasons above. |
I love what you've done with
ucc
! PyQrack offersQrackCircuit
for optimizing compilation, which has no proper "transpilation" capability, with mapper and gate translation, relying on Qiskitoptimization_level=0
to translate between gate basis sets, but focusingQrackCircuit
solely on the task of gate reduction in any potential (physically valid) vernacular gate set of Qrack, or specifically the dialect of single-target-qubit multiplexer gates with arbitrary numbers of control qubits.UCC is faster than Qrack, it looks like! I hope that Unitary Foundation can consider using
QrackCircuit
as a "homegrown" compilation pass, though!