Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python logging not working with version 0.9 and python 3.12 #403

Open
koubaa opened this issue Dec 9, 2024 · 6 comments
Open

Python logging not working with version 0.9 and python 3.12 #403

koubaa opened this issue Dec 9, 2024 · 6 comments

Comments

@koubaa
Copy link
Contributor

koubaa commented Dec 9, 2024

Python 3.12.3 (tags/v3.12.3:f6650f9, Apr  9 2024, 14:05:25) [MSC v.1938 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging
>>> import kp
>>> kp_logger = logging.getLogger("kp")
>>> kp_logger.setLevel(logging.INFO)
>>> mgr=kp.Manager()
>>> mgr.get_device_properties()
{'device_name': 'NVIDIA GeForce RTX 4060 Ti', 'max_work_group_count': (2147483647, 65535, 65535), 'max_work_group_invocations': 1024, 'max_work_group_size': (1024, 1024, 64), 'timestamps_supported': True}
>>> kp.__version__
'0.9.0'

According to the documentation at https://kompute.cc/overview/python-examples.html, I expect to see some logging output after the mgr = kp.Manager() line.

@axsaucedo
Copy link
Member

@koubaa can you try setting the log level to TRACE or DEBUG?

@koubaa
Copy link
Contributor Author

koubaa commented Dec 9, 2024

@axsaucedo I just tried - that didn't make any difference. I'm on windows, if that makes any difference

@koubaa
Copy link
Contributor Author

koubaa commented Dec 9, 2024

@axsaucedo I know the vulkan C API well enough to try and debug it... but I can't find documentation on how to configure cmake to find pybind11.

output from cmake configure stage

-- pybind11 v2.9.2
CMake Warning (dev) at build/_deps/pybind-src/tools/FindPythonLibsNew.cmake:98 (find_package):
  Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
  build/_deps/pybind-src/tools/pybind11Tools.cmake:50 (find_package)
  build/_deps/pybind-src/tools/pybind11Common.cmake:206 (include)
  build/_deps/pybind-src/CMakeLists.txt:200 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

output from cmake build stage:

C:\Dev\OSS\kompute\src\include\kompute\logger\Logger.hpp(28,10): error C1083: Cannot open include file: 'pybind11/pybind11.h': No such file or directory [C:\Dev\OSS\kompute\build\src\logger\kp_logger.vcxp
roj]

@koubaa
Copy link
Contributor Author

koubaa commented Dec 9, 2024

I have a workaround, I installed pybind11 globally using pip install pybind11[global] and then I built with the following options:
cmake -Bbuild -D KOMPUTE_OPT_BUILD_PYTHON=ON -D KOMPUTE_OPT_USE_BUILT_IN_PYBIND11=OFF

I manually installed it into my python environment by overwriting the kp.cp312-win_amd64.pyd file and I get debug output.

I had to replace OpTensorSyncDevice with OpSyncDevice (Thats either an unreleased API incompatibility with the documented examples or a stale example I copied from; I suspect the latter).

Anyways - now my program gets debug printout

@axsaucedo
Copy link
Member

Ok interesting - I assume this last message was built from master? If so we have chnaged he API to use OpSyncX instead of OpTensorSyncX as we have introduced a new Image data structure besides the Tensor. We will be documenting this and making the release as v0.10. For the time being it sounds like at least this is unblocked in case someone else comes across this

@koubaa
Copy link
Contributor Author

koubaa commented Dec 9, 2024

@axsaucedo yes I built from master. The only real issue here is that logging is broken for the windows 0.9 wheel on pypi (either it is a bug that was fixed since 0.9 or a problem with the build configuration that produced that pypi distribution)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants