microsoft / qsharp

Azure Quantum Development Kit, including the Q# programming language, resource estimator, and Quantum Katas
https://microsoft.github.io/qsharp/
MIT License
367 stars 73 forks source link

Make `SpreadZ` utility iterative instead of recursive #1545

Closed swernli closed 1 month ago

swernli commented 1 month ago

This updates the internal utility for SpreadZ as used by Microsoft.Quantum.Intrinsic.Exp to use an iterative algorith rather than recursive. This allows Exp to be used when generating QIR adaptive profile code, where RCA rejects call cycles.

github-actions[bot] commented 1 month ago

Change in memory usage detected by benchmark.

Memory Report for 74a3b480e061327b648c26c4f641f5669d2a20cd

Test This Branch On Main Difference
compile core + standard lib 16619501 bytes 16582941 bytes 36560 bytes
github-actions[bot] commented 1 month ago

Change in memory usage detected by benchmark.

Memory Report for 7a5ea2d9b7e66b5687a8dd857e09f90fe33f314d

Test This Branch On Main Difference
compile core + standard lib 16619429 bytes 16582941 bytes 36488 bytes
github-actions[bot] commented 1 month ago

Benchmark for 7a5ea2d

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | 328.2±2.72µs | **323.5±2.93µs** | **-1.43%** | | Array literal evaluation | 189.4±1.17µs | **171.1±0.86µs** | **-9.66%** | | Array update evaluation | 410.8±2.78µs | **407.8±2.40µs** | **-0.73%** | | Core + Standard library compilation | **18.3±0.08ms** | 18.4±0.06ms | **+0.55%** | | Deutsch-Jozsa evaluation | 5.1±0.06ms | 5.1±0.08ms | 0.00% | | Large file parity evaluation | 34.1±0.09ms | 34.1±0.45ms | 0.00% | | Large input file compilation | **12.2±0.26ms** | 12.6±0.45ms | **+3.28%** | | Large input file compilation (interpreter) | **45.7±0.85ms** | 46.6±1.69ms | **+1.97%** | | Large nested iteration | 32.8±0.98ms | **32.3±0.48ms** | **-1.52%** | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1549.6±33.23µs | 1554.1±36.60µs | +0.29% | | Perform Runtime Capabilities Analysis (RCA) on large file sample | 7.7±0.10ms | 7.7±0.06ms | 0.00% | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1413.0±30.24µs | 1412.0±27.97µs | -0.07% | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | **27.1±0.17ms** | 27.8±0.36ms | **+2.58%** | | Teleport evaluation | 88.8±4.01µs | 89.5±3.72µs | +0.79% |
github-actions[bot] commented 1 month ago

Change in memory usage detected by benchmark.

Memory Report for 3a2f08fea797e117e9fe2bce3876b31a4ec4b1af

Test This Branch On Main Difference
compile core + standard lib 16619429 bytes 16582941 bytes 36488 bytes
github-actions[bot] commented 1 month ago

Benchmark for 3a2f08f

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | 330.3±3.51µs | **324.4±2.71µs** | **-1.79%** | | Array literal evaluation | 192.1±0.72µs | **171.4±4.25µs** | **-10.78%** | | Array update evaluation | 408.1±3.52µs | 405.3±2.97µs | -0.69% | | Core + Standard library compilation | **18.8±0.30ms** | 19.3±0.71ms | **+2.66%** | | Deutsch-Jozsa evaluation | 5.0±0.05ms | 5.0±0.21ms | 0.00% | | Large file parity evaluation | 34.2±0.08ms | **34.1±0.11ms** | **-0.29%** | | Large input file compilation | 12.5±0.14ms | 12.5±0.15ms | 0.00% | | Large input file compilation (interpreter) | 47.7±1.28ms | 47.4±0.83ms | -0.63% | | Large nested iteration | 32.6±0.25ms | 32.5±1.62ms | -0.31% | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1652.3±239.81µs | **1551.9±39.20µs** | **-6.08%** | | Perform Runtime Capabilities Analysis (RCA) on large file sample | 8.2±1.18ms | **7.9±0.07ms** | **-3.66%** | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1547.8±293.29µs | **1414.0±33.70µs** | **-8.64%** | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | **27.5±0.20ms** | 28.1±0.20ms | **+2.18%** | | Teleport evaluation | 89.4±3.89µs | 87.4±4.02µs | -2.24% |