Skip to content

Commit eaafd14

Browse files
committed
Simulator optimization branch: GPU density matrix, perf, audits, shared context
Major work on branch (squash of 28 commits + final clippy cleanup): GPU simulator optimizations - f32 gate fusion, commuting-gate reorder, CY/SWAP/RXX/RYY direct shaders - Persistent kernel for small states with dynamic shared-memory sizing - CPU measurement fast path for small states (f32 <=16q, f64 <=15q) - Parallel CX/CZ/RZZ/RXX/RYY via rayon when .parallel(true) - Parallel scalar CX path for low-qubit pairs (q_lo < 2) - Fused flush_gates + state() readback into single encoder - Adaptive mz path selection: empirical N/M lookup table replacing hardcoded threshold - Raised StateVecSoA parallel threshold 14 -> 21 qubits - Exploration benchmarks for adaptive path decisions GpuDensityMatrix - Choi-Jamiolkowski representation on top of GpuStateVec - Generic over backend (f32 / f64); gates, noise channels, helpers - Cholesky re-purification for mixed states Correctness fixes (from audits) - GPU 2q rotation shaders (RXX/RYY bit_a==bit_b bug) - DensityMatrix phase/amplitude damping trace preservation - mz is_deterministic flag (previously hardcoded false) - GpuPauliProp gate ordering + Pauli X/Y/Z semantics, stale buffer reads - GpuDensityMatrix mz probability formula - GpuStabMulti::mz_queue now snapshots state at call time Shared GPU context (concurrent-use SIGSEGV fix) - Process-wide OnceLock<GpuDeviceContext> in pecos-gpu-sims/src/gpu_probe.rs - All 7 simulators now reuse one wgpu Instance/Adapter/Device/Queue - Fixes crashes under cargo's parallel test harness and MonteCarloEngine shots - Removed the --test-threads=1 workaround from pecos-cli rust test Test infrastructure - New audits: gate_audit, gate_fuzz, pauli_prop_audit, influence_sampler_audit, large_n_audit, noisy_sampler_stats, stab_extra_audits, extra_audits, flush_blocked_audit, concurrent_gpu_test - Removed pecos-quest / pecos-qulacs wrapper crates (bench code only) - Removed dangling quest_sim_test.rs and quest_example.rs Clippy / lint cleanup - GpuError::Startup variant wraps GpuStartupError - Internal GPU constants now usize (casts removed) - Renamed GatePipeline variants SWAP/RXX/RYY/RZZ -> Swap/Rxx/Ryy/Rzz - # Panics / # Errors doc sections added where clippy required - Cholesky loops allow needless_range_loop with justification - Test files allow cast_possible_truncation / cast_precision_loss with rationale
1 parent a9a9d7a commit eaafd14

118 files changed

Lines changed: 14823 additions & 17098 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.lock

Lines changed: 2 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,6 @@ pecos-qis = { version = "0.2.0-dev.0", path = "crates/pecos-qis" }
192192
pecos-qis-ffi = { version = "0.2.0-dev.0", path = "crates/pecos-qis-ffi" }
193193
pecos-qis-ffi-types = { version = "0.2.0-dev.0", path = "crates/pecos-qis-ffi-types" }
194194
pecos-quantum = { version = "0.2.0-dev.0", path = "crates/pecos-quantum" }
195-
pecos-quest = { version = "0.2.0-dev.0", path = "crates/pecos-quest" }
196-
pecos-qulacs = { version = "0.2.0-dev.0", path = "crates/pecos-qulacs" }
197195
pecos-random = { version = "0.2.0-dev.0", path = "crates/pecos-random" }
198196
pecos-relay-bp = { version = "0.2.0-dev.0", path = "crates/pecos-relay-bp" }
199197
pecos-rslib = { version = "0.2.0-dev.0", path = "python/pecos-rslib" }

crates/benchmarks/Cargo.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,13 @@ default = []
1717
parallel = ["pecos-simulators/parallel"]
1818
gpu-sims = ["dep:pecos-gpu-sims"]
1919
cuquantum = ["dep:pecos-cuquantum"]
20-
quest = ["dep:pecos-quest"]
21-
qulacs = ["dep:pecos-qulacs"]
2220
cppsparsestab = ["dep:pecos-cppsparsestab"]
23-
all-sims = ["gpu-sims", "cuquantum", "quest", "qulacs", "cppsparsestab"]
21+
all-sims = ["gpu-sims", "cuquantum", "cppsparsestab"]
2422

2523
[dependencies]
2624
# Optional simulator dependencies for benchmarking
2725
pecos-gpu-sims = { workspace = true, optional = true }
2826
pecos-cuquantum = { workspace = true, optional = true }
29-
pecos-quest = { workspace = true, optional = true }
30-
pecos-qulacs = { workspace = true, optional = true }
3127
pecos-cppsparsestab = { workspace = true, optional = true }
3228
pecos-core.workspace = true
3329
pecos-simulators.workspace = true

0 commit comments

Comments
 (0)