You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Profiling with Scalene 1.5.34 causes programs importing the Qiskit library to not run correctly. The program exits as soon as Qiskit is imported with the error:
Error in program being profiled:
'PosixPath' object is not subscriptable
This is a regression from previous Scalene versions: 1.5.31.1 works correctly.
To Reproduce
Consider this simple program:
$ cat scalene_check.py
from qiskit import QuantumCircuit
print("done")
This runs correctly:
$ python scalene_check.py
done
Profiling with Scalene, I get the TypeError: 'PosixPath' object is not subscriptable. Here is the full program and profiler output:
$ scalene scalene_check.py --outfile profile.txt
Error in program being profiled:
'PosixPath' object is not subscriptable
Traceback (most recent call last):
File "/opt/conda/envs/aurora-py310/lib/python3.10/site-packages/scalene/scalene_profiler.py", line 1709, in profile_code
exec(code, the_globals, the_locals)
File "/home/vscode/scalene_check.py", line 1, in <module>
from qiskit import QuantumCircuit
File "/opt/conda/envs/aurora-py310/lib/python3.10/site-packages/qiskit/__init__.py", line 87, in <module>
from qiskit.execute_function import execute
File "/opt/conda/envs/aurora-py310/lib/python3.10/site-packages/qiskit/execute_function.py", line 25, in <module>
from qiskit.compiler import transpile, schedule
File "/opt/conda/envs/aurora-py310/lib/python3.10/site-packages/qiskit/compiler/__init__.py", line 31, in <module>
from .transpiler import transpile
File "/opt/conda/envs/aurora-py310/lib/python3.10/site-packages/qiskit/compiler/transpiler.py", line 33, in <module>
from qiskit.transpiler.passes.synthesis.high_level_synthesis import HLSConfig
File "/opt/conda/envs/aurora-py310/lib/python3.10/site-packages/qiskit/transpiler/passes/__init__.py", line 214, in <module>
from .optimization import Optimize1qGates
File "/opt/conda/envs/aurora-py310/lib/python3.10/site-packages/qiskit/transpiler/passes/optimization/__init__.py", line 19, in <module>
from .consolidate_blocks import ConsolidateBlocks
File "/opt/conda/envs/aurora-py310/lib/python3.10/site-packages/qiskit/transpiler/passes/optimization/consolidate_blocks.py", line 29, in <module>
from qiskit.transpiler.passes.synthesis import unitary_synthesis
File "/opt/conda/envs/aurora-py310/lib/python3.10/site-packages/qiskit/transpiler/passes/synthesis/__init__.py", line 15, in <module>
from .unitary_synthesis import UnitarySynthesis
File "/opt/conda/envs/aurora-py310/lib/python3.10/site-packages/qiskit/transpiler/passes/synthesis/unitary_synthesis.py", line 43, in <module>
from qiskit.transpiler.passes.synthesis import plugin
File "/opt/conda/envs/aurora-py310/lib/python3.10/site-packages/qiskit/transpiler/passes/synthesis/plugin.py", line 279, in <module>
import stevedore
File "/opt/conda/envs/aurora-py310/lib/python3.10/site-packages/stevedore/__init__.py", line 11, in <module>
from .extension import ExtensionManager
File "/opt/conda/envs/aurora-py310/lib/python3.10/site-packages/stevedore/extension.py", line 19, in <module>
from . import _cache
File "/opt/conda/envs/aurora-py310/lib/python3.10/site-packages/stevedore/_cache.py", line 203, in <module>
_c = Cache()
File "/opt/conda/envs/aurora-py310/lib/python3.10/site-packages/stevedore/_cache.py", line 147, in __init__
sys.executable[0:4] == '/tmp']):
TypeError: 'PosixPath' object is not subscriptable
$ cat profile.txt
Memory usage: ▄▄▅██ (max: 20.316 MB, growth rate: 101%)
/home/vscode/scalene_check.py: % of time = 100.00% (485.960ms) out of 485.960ms.
╷ ╷ ╷ ╷ ╷ ╷ ╷ ╷
│Time │–––––– │–––––– │Memory │–––––– │––––––––––– │Copy │
Line │Python │native │system │Python │peak │timeline/% │(MB/s) │/home/vscode/scalene_check.py
╺━━━━━━┿━━━━━━━┿━━━━━━━┿━━━━━━━┿━━━━━━━━┿━━━━━━━┿━━━━━━━━━━━━━━━┿━━━━━━━┿━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸
1 │ 38% │ 59% │ 4% │ 99% │ 20M │▄█ 100% │ 1328 │from qiskit import QuantumCircuit
2 │ │ │ │ │ │ │ │
3 │ │ │ │ │ │ │ │print("done")
4 │ │ │ │ │ │ │ │
╵ ╵ ╵ ╵ ╵ ╵ ╵ ╵
Top AVERAGE memory consumption, by line:
(1) 1: 20 MB
Top PEAK memory consumption, by line:
(1) 1: 20 MB
Expected behavior
The program should run correctly. This is the output from Scalene 1.5.31.1:
Thanks for the report. I just issued a new release and your test works for me; it will take some time to get to conda-forge. That said, I saw that you tested with the repo version, and it did not work for you, which is surprising. Please give the new version a try and let's see what happens. Thanks.
Describe the bug
Profiling with Scalene 1.5.34 causes programs importing the Qiskit library to not run correctly. The program exits as soon as Qiskit is imported with the error:
This is a regression from previous Scalene versions: 1.5.31.1 works correctly.
To Reproduce
Consider this simple program:
This runs correctly:
Profiling with Scalene, I get the
TypeError: 'PosixPath' object is not subscriptable
. Here is the full program and profiler output:Expected behavior
The program should run correctly. This is the output from Scalene 1.5.31.1:
Desktop:
Tested with the repository version as well.
The text was updated successfully, but these errors were encountered: