Hello PennyLane team,
I am investigating a performance discrepancy when using lightning.qubit with a PyTorch interface.
My setup:
- PennyLane: 0.42.3
- PennyLane-Lightning: 0.42.0
- PyTorch: 2.6.0+cpu
- Python: 3.10
- Device:
lightning.qubit - Interface:
torch - Differentiation method:
adjoint
The model is a hybrid PyTorch + PennyLane model. The quantum circuit is called inside the training loop.
I tested the exact same source code and environment on two Windows machines.
Machine A (Desktop)
CPU:
Intel Core i3-12100F
Configuration:
- 4 physical cores
- 8 logical processors
Observed behavior:
- Training uses approximately 4 active CPU cores.
- CPU utilization is distributed across multiple threads.
Machine B (Laptop)
CPU:
Intel Core i7-13620H
Configuration:
- 10 physical cores
- 16 logical processors
- Hybrid architecture (6 Performance cores + 4 Efficient cores)
Observed behavior:
- Training uses approximately 1 active CPU core.
- One thread consumes almost all CPU time.
- Other threads remain almost idle.
The same behavior was also observed on another Intel laptop.
Checks already performed
I verified:
- Same source files (SHA256 checked)
- Same Python environment
- Same PennyLane and PennyLane-Lightning versions
- Same
lightning_qubit_opsbinary - No CPU affinity restrictions
- Tested
OMP_NUM_THREADS - Tested
MKL_NUM_THREADS - Tested
torch.set_num_threads() - Tested CPU affinity manually
Changing OpenMP settings did not change the behavior. The process still behaves as mostly single-threaded on the laptop.
A small standalone test using lightning.qubit confirms that the device loads correctly.
My questions:
- Could this behavior be related to OpenMP scheduling on Windows with Intel hybrid CPUs (P-core/E-core architecture)?
- Does
lightning.qubithave any known limitations with hybrid Intel CPUs? - Is there a recommended way to verify whether the Lightning kernels are actually using OpenMP parallel regions?
I can provide benchmark scripts, profiling output, or any additional information if needed.
Thank you.