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

[Bug]: Qwen2 7b does not compile for NPU #28119

Open
3 tasks done
endomorphosis opened this issue Dec 18, 2024 · 2 comments
Open
3 tasks done

[Bug]: Qwen2 7b does not compile for NPU #28119

endomorphosis opened this issue Dec 18, 2024 · 2 comments
Assignees
Labels

Comments

@endomorphosis
Copy link

OpenVINO Version

2024.5

Operating System

Windows System

Device used for inference

NPU

Framework

None

Model used

Qwen2 7b

Issue description

[ERROR] 21:40:27.063 [vpux-compiler] Got Diagnostic at loc(fused<{name = "self.model.layers.1.self_attn.k_proj.weight/fq_weights_1", type = "Multiply"}>["self.model.layers.1.self_attn.k_proj.weight/fq_weights_1", "artificial_fq", "fq_in"]) : failed to legalize operation 'IE.FakeQuantize' that was explicitly marked illegal
loc(fused<{name = "self.model.layers.1.self_attn.k_proj.weight/fq_weights_1", type = "Multiply"}>["self.model.layers.1.self_attn.k_proj.weight/fq_weights_1", "artificial_fq", "fq_in"]): error: failed to legalize operation 'IE.FakeQuantize' that was explicitly marked illegal
[ERROR] 21:40:27.065 [vpux-compiler] Failed Pass HandleFakeQuantHasNegativeScales on Operation loc(fused<{name = "main", type = "Func"}>["main"])
[ERROR] 21:40:27.065 [vpux-compiler] Failed Pass mlir::detail::OpToOpPassAdaptor on Operation loc(fused<{name = "module", type = "Module"}>["module"])

Step-by-step reproduction

ov_model = ov_genai.LLMPipeline(model_dst_path, device=device)

Relevant log output

[ERROR] 21:40:27.063 [vpux-compiler] Got Diagnostic at loc(fused<{name = "self.model.layers.1.self_attn.k_proj.weight/fq_weights_1", type = "Multiply"}>["self.model.layers.1.self_attn.k_proj.weight/fq_weights_1", "artificial_fq", "fq_in"]) : failed to legalize operation 'IE.FakeQuantize' that was explicitly marked illegal
loc(fused<{name = "self.model.layers.1.self_attn.k_proj.weight/fq_weights_1", type = "Multiply"}>["self.model.layers.1.self_attn.k_proj.weight/fq_weights_1", "artificial_fq", "fq_in"]): error: failed to legalize operation 'IE.FakeQuantize' that was explicitly marked illegal
[ERROR] 21:40:27.065 [vpux-compiler] Failed Pass HandleFakeQuantHasNegativeScales on Operation loc(fused<{name = "main", type = "Func"}>["main"])
[ERROR] 21:40:27.065 [vpux-compiler] Failed Pass mlir::detail::OpToOpPassAdaptor on Operation loc(fused<{name = "module", type = "Module"}>["module"])

Issue submission checklist

  • I'm reporting an issue. It's not a question.
  • I checked the problem with the documentation, FAQ, open issues, Stack Overflow, etc., and have not found a solution.
  • There is reproducer code and related data files such as images, videos, models, etc.
@endomorphosis endomorphosis added bug Something isn't working support_request labels Dec 18, 2024
@ilya-lavrenov ilya-lavrenov added the category: NPU OpenVINO NPU plugin label Dec 18, 2024
@avitial
Copy link
Contributor

avitial commented Dec 19, 2024

@endomorphosis may I ask how you exported the Qwen/Qwen2-7B model? Are you following this guide for NPU inference? If possible please check if the issue still present on OpenVINO 2024.6 version, download here.

In addition please provide more details about your environment (CPU SKU, Windows 10/11, NPU driver version, Python version, etc.).

@avitial avitial self-assigned this Dec 19, 2024
@avitial avitial removed the bug Something isn't working label Dec 19, 2024
@endomorphosis
Copy link
Author

I upgraded the packages to the latest versions, and I tried both int8 and int4 quantization methods, and while they work on GPU, currently on NPU the fail silently and cause the entire process to exit (on windows)

Benchmarks (int4)
tiny-llama 1.1B 90 tok/s (gpu)
Qwen2 7B 23 tok/s (gpu)
llama3.1 8B 22tok/s (gpu) 6GB ram ram usage

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

No branches or pull requests

5 participants