Language, Compiler, and Optimization Issues in Quantum Computing Margaret Martonosi Princeton University Fred Chong Ali JavadiAbhari Kenneth R. Brown Diana Franklin Shruti Patil Georgia Tech Jeff Heckey Princeton University Daniel Kudrow Adam Holmes UC Santa Barbara Cornell University
Quantum Computing at a Crossroads QC Ten years ago: ¡ High level algorithms ¡ Low level devices QC Algorithms ¡ Little in between Today: ¡ Increasing attention at languages and toolflows to Languages, Compilers, Toolflows connect top to bottom. Architectural Design Why? And why “regular” architecture, language, and compiler researchers? QC Devices
Analogy: Early Classical Computing No abstractions, no system layering. ¡ Just people with big problems to solve ¡ And people who could build machines. 1964: Instruction Set Architecture is born. ¡ ISA = Fundamental abstraction: Allows same software to run on different implementations. ¡ Gives software stable target. Allows hardware to optimize itself under stable abstraction layer. ¡ Supports independent layers of optimization and analysis. Now: Time to begin similar layerings for QC. ¡ Should be a collaboration of QC people and classical computer systems researchers.
QC Architecture & Compiler Research: Goals Identify and compare the viability of proposed technologies ¡ Quantify physical bounds and hardware characteristics ¡ Alert physicists of technological limits that are needed for computationally relevant implementation. Identify the Unknowns ¡ Scaling to arbitrary sizes compounds challenges Identify correct microarchitectural abstractions Necessarily Multidisciplinary: Computer Engineers + Algorithmicists + Physicists
QC Architecture & Compiler Challenges Algorithms vs. Benchmarks: QC impact on compilation/ computation: Few diverse and large-scale benchmarks exist —> write No cloning theorem -> Many our own in our own high-level data dependencies & long serial language. computation chains -> low parallelism. How to address? Long serial chains: Data Tools: dependences, rotation Few openly-available tools for decomposition, … cause lots of compilation and analysis of qubit movements -> Mitigating large QC programs communication cost? Code/data specialization common in QC -> Results in Technology Impacts: massive compilation files and memory usage eg Quantum Teleportation vs. Ballistic motion. -> Intelligent memory hierarchy design.
This Talk Background & Basics Focus 1: Scalable Tailored Compilation Focus 2: QC Communication and Scheduling Issues Focus 3: QC Language design and evolution
Quantum Device Technology Our Main Focus: Ion Trap Technology ¡ Good experimental understanding ¡ Microwave control ¡ Allows for “SIMD” operation: Multiple ion, single control But plan to broaden to other technologies too ¡ Superconducting, QDOT…
SIMD Operating Regions SIMD: Single-Instruction, Multiple-Data Microwave Local Mem SIMD Region Control Can apply the same gate operation (H, CNOT, etc) to many qubits at once. ¡ Capacity (d): Few to 100’s ¡ K=2-8 SIMD regions are useful for QC apps we’ve studied
Computational Architecture: Multi-SIMD (k,d) Microwave Microwave Local Mem Local Mem SIMD SIMD Region Control Control Region Teleport Teleport Entangled Pair Channels Teleportation Unit K SIMD operation regions, each operating Microwave on d qubits per cycle Global Memory Control Teleport Teleport Microwave Microwave Local Mem Local Mem SIMD SIMD Region Control Region Control
Scheduling Challenge Primary Goal: Schedule Microwave moving qubits in/ out of Local Mem Local Mem SIMD SIMD Region Control SIMD regions to maximize Region parallelism & minimize Teleport Teleport Entangled Pair Channels communication Teleportation Unit Also: Manage tradeoffs between ballistic and Microwave teleportation comm, Global Memory Control balance storage requirements, … Teleport Teleport Microwave Local Mem Local Mem SIMD SIMD Region Control Region
Compiling Quantum Codes: Our Scaffold/ScaffCC Toolflow Algorithm Data types and instructions in Quantum Program in High-Level Language quantum computers: Logical ¡ Qubits, quantum gates ScaffCC Scaffold Decoherence requires QECC Compiler & High-level ¡ Logical vs. Physical Levels Scheduler Efficiency crucial QASM ¡ Inefficiencies at logical level are Error Correction QECC amplified into greater physical QASM with level QECC requirements. QECC Physical Physical Mapper ¡ Optimizations performed at Machine (Final Placement, logic level can be more tractable Description Routing) and have high leverage. Quantum Physical Operation Language
Benchmarks Lines ¡of ¡ Min ¡Logical ¡ Benchmark ¡ Size ¡ Ops ¡ Code ¡ Qubits ¡ Grover’s ¡Search ¡ n ¡= ¡40 ¡ 208 ¡ 2.4E+09 ¡ 120 ¡ n ¡= ¡300 ¡ Binary ¡Welded ¡Tree ¡ 482 ¡ 2.9E+09 ¡ 2719 ¡ s ¡= ¡3000 ¡ Ground ¡State ¡EsDmaDon ¡ m ¡= ¡10 ¡ 9643 ¡ 9.74E+07 ¡ 13 ¡ SHA-‑1 ¡Reversal ¡ n ¡= ¡128 ¡ 855 ¡ 1.02E+11 ¡ 486536 ¡ Shor’s ¡FactorizaDon ¡ n ¡= ¡512 ¡ 1055 ¡ 9.80E+10 ¡ 5634 ¡ Triangle ¡Finding ¡Problem ¡ n ¡= ¡5 ¡ 4052 ¡ 5.24E+09 ¡ 176 ¡ x ¡= ¡2 ¡ Boolean ¡Formula ¡ 693 ¡ 3.1E+08 ¡ 1711 ¡ y ¡= ¡3 ¡ Class ¡Number ¡ p ¡= ¡6 ¡ 383 ¡ 3.5E+06 ¡ 60052 ¡
This Talk Background & Basics Focus 1: Scalable Tailored Compilation Focus 2: QC Communication and Scheduling Issues Focus 3: QC Language design and evolution
Scalable Tailored QC Compilation Quantum circuits often specialized to one problem input or size: Benefits of Customization: Efficient circuits . Deeply and statically analyzable. Vs. Lack of Scalability: Code explosion: > 10 12 ops for some applications! • Need better balance of optimization and scalability • QASM format changes: QASM-H, QASM-HL: 200,000X or more code size savings • Modular analysis • Memoization and Instrumentation-driven analysis
Critical Path Estimates & Modular Analysis Scheduling based on qubit data dependences: ¡ Many compilation optimizations rest on critical path estimates. Intractable as whole-program analysis => ¡ Use Hierarchical / Modular techniques ¡ Obtain module critical paths separately and then treat them as black boxes.
Hierarchical Approach Improves Scalability, but Loses Optimality at Module Boundaries Flattened Analysis Module Toffoli(a,b,c) Modular Analysis PrepZ(s0) PrepZ(s1) c a b a0 s1 s0 s1 s0 a0 X(s1) Toffoli(a0,s1,s0) Pz Pz 1 1 H X(s1) P P 1 . . . z z X H 2 2 C 3 T 2 X 3 C 4 4 C T T 5 5 • Closeness to actual C C T 6 6 critical path is 12 cycles C 7 7 T T dependent on the T T 8 8 C level of modularity C T 9 9 C • Flatter overall T 10 C T H 10 program means H T C 11 11 more opportunity for C 12 12 T S discovering 13 S T parallelism 14 X More X 15 Scalable Accurate
Effect of Remodularization • Based on resource analysis, flatten modules with size less than a threshold • Tradeoff between speed of analysis and its accuracy 6.4E+08 ¡ 6 ¡ CriDcal ¡Path ¡Length ¡EsDmate ¡ 6.2E+08 ¡ 5 ¡ Analysis ¡Time ¡(s) ¡ 6.0E+08 ¡ 4 ¡ 5.8E+08 ¡ (# ¡gates) ¡ 5.6E+08 ¡ 3 ¡ 5.4E+08 ¡ 2 ¡ 5.2E+08 ¡ 1 ¡ 5.0E+08 ¡ 4.8E+08 ¡ 0 ¡ 5k ¡ 10k ¡ 50k ¡ 100k ¡ 150k ¡ 2M ¡ FlaPening ¡Threshold ¡for ¡RemodularizaDon ¡ Binary ¡Welded ¡Tree ¡n=300, ¡s=1000 ¡
Scalable Tailored Compilation: Summary Extended LLVM’s classical framework for quantum compilation at the logical level Managed scalability through: ¡ QASM Output format: ÷ 200,000X on average + up to 90% for some benchmarks ¡ Code generation approach: ÷ Up to 70% for large problems For more info, see our ScaffCC papers: ¡ Computing Frontiers (CF) 2014: ScaffCC overview. ¡ IISWC 2014: Trials & Rotations in Quantum Phase Estimation ¡ J. Parallel Computation: ScaffCC long version. ¡ ASPLOS 2015: Communication optimizations.
This Talk Background & Basics Focus 1: Scalable Tailored Compilation Focus 2: QC Communication and Scheduling Issues Focus 3: QC Language design and evolution
Why Communication Time Matters Global Mem SIMD 2 SIMD 1 a a b b c c H H a b c 1 1 1 1 C C b c a 2 2 2 2 a b c T † T † 3 3 3 3 C C b a c 4 4 4 4 T T a b c 5 5 5 5 C C a b c 6 6 6 6 T † T † T † a b c 7 7 7 7 C C b a c 8 8 8 8 T T C C c a b 9 9 9 9 H H T † T † a c b 10 10 10 10 C C c a b 11 11 11 11 T S T S c c b 12 12 12 12
Recommend
More recommend