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
The logger struggles to parse the values of the GPU properties dictionary into a string. It should be possible to fix this by doing the string transformation more explicitly.
The following code reproduces the error:
import cupy as cp
from pytket import Circuit
from pytket.extensions.cutensornet import CuTensorNetHandle
from pytket.extensions.cutensornet.general_state import GeneralState
circ = Circuit(2).H(0).CX(0,1)
with CuTensorNetHandle() as libhandle:
GeneralState(circ, libhandle, loglevel=10)
--- Logging error ---
Traceback (most recent call last):
File "/global/homes/p/pam_q/.conda/envs/cuquantum-24.03/lib/python3.12/logging/init.py", line 1160, in emit
msg = self.format(record)
^^^^^^^^^^^^^^^^^^^
File "/global/homes/p/pam_q/.conda/envs/cuquantum-24.03/lib/python3.12/logging/init.py", line 999, in format
return fmt.format(record)
^^^^^^^^^^^^^^^^^^
File "/global/homes/p/pam_q/.conda/envs/cuquantum-24.03/lib/python3.12/logging/init.py", line 703, in format
record.message = record.getMessage()
^^^^^^^^^^^^^^^^^^^
File "/global/homes/p/pam_q/.conda/envs/cuquantum-24.03/lib/python3.12/logging/init.py", line 392, in getMessage
msg = msg % self.args
~~~~^~~~~~~~~~~
TypeError: not all arguments converted during string formatting
Call stack:
File "/global/u1/p/pam_q/Repository/prueba.py", line 8, in
GeneralState(circ, libhandle, loglevel=10)
File "/global/homes/p/pam_q/.conda/envs/cuquantum-24.03/lib/python3.12/site-packages/pytket/extensions/cutensornet/general_state/tensor_network_state.py", line 69, in init
libhandle.print_device_properties(self._logger)
File "/global/homes/p/pam_q/.conda/envs/cuquantum-24.03/lib/python3.12/site-packages/pytket/extensions/cutensornet/general.py", line 85, in print_device_properties
logger.debug("GPU-name:", device_props["name"].decode())
Message: 'GPU-name:'
Arguments: ('NVIDIA A100-PCIE-40GB',)
The text was updated successfully, but these errors were encountered:
# Description
Fixed the issue below. The issue has a code snippet to reproduce the
error (and see what the fix did).
# Related issues
Solves issue #143
# Checklist
- [x] I have run the tests on a device with GPUs.
- [x] I have performed a self-review of my code.
- [ ] I have commented hard-to-understand parts of my code.
- [ ] I have made corresponding changes to the public API documentation.
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have updated the changelog with any user-facing changes.
The issue is in
pytket-cutensornet/pytket/extensions/cutensornet/general.py
Line 81 in 0fa5f32
The logger struggles to parse the values of the GPU properties dictionary into a string. It should be possible to fix this by doing the string transformation more explicitly.
The following code reproduces the error:
The text was updated successfully, but these errors were encountered: