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

When set DEBUG = True in setup.py, I get the following error: #36

Open
Lenan22 opened this issue Nov 25, 2024 · 4 comments
Open

When set DEBUG = True in setup.py, I get the following error: #36

Lenan22 opened this issue Nov 25, 2024 · 4 comments

Comments

@Lenan22
Copy link

Lenan22 commented Nov 25, 2024

when run "pip install -e",

Traceback (most recent call last):
File "SVDQuant/nunchaku/example.py", line 3, in
from nunchaku.pipelines import flux as nunchaku_flux
File "SVDQuant/nunchaku/nunchaku/pipelines/flux.py", line 7, in
from ..models.flux import inject_pipeline, load_quantized_model
File "nunchaku/nunchaku/models/flux.py", line 11, in
from .._C import QuantizedFluxModel
ImportError: nunchaku/nunchaku/_C.cpython-311-x86_64-linux-gnu.so: undefined symbol: ZN26FluxSingleTransformerBlock7forwardE6TensorS0_S0

@Lenan22
Copy link
Author

Lenan22 commented Nov 25, 2024

Do I need to turn on the debug mode if I want the log information of spdlog::debug?

@xmfbit
Copy link

xmfbit commented Nov 25, 2024

@Lenan22 To get the output of spdlog::debug, I add this method and set the logging level to debug:

void set_log_level(const std::string& level) {
    auto enum_level = spdlog::level::from_str(level);
    spdlog::set_level(enum_level);
}

// where you want to set logging level
set_log_level("debug");

@Lenan22
Copy link
Author

Lenan22 commented Nov 25, 2024

@xmfbit Could you please tell me in which file you added these codes?

@xmfbit
Copy link

xmfbit commented Nov 25, 2024

@Lenan22 You can add the definition of this method anywhere that the c++ syntax allows, and set the logging level to debug before where you want to start to print the log.

Actually, I add the method in pybind.cpp and bind it to python, which makes it possiable to set the level in python script.

// pybind.cpp

// author's code

void set_log_level(const std::string& level) {
    auto enum_level = spdlog::level::from_str(level);
    spdlog::set_level(enum_level);
}

// export to python
m.def("set_log_level", &set_log_level, py::arg("level"), "Set the logging level");

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