-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add NPU Engine #31
base: main
Are you sure you want to change the base?
Add NPU Engine #31
Conversation
fix the logic error of if else
@szeyu The NPU support looks good. I added some reviews. If those are resolved then it should be go to be merged. Before merging this PR, can you first merged the OpenVINO vison model PR then only merge this NPU Engine? |
merge npu merge npu merge npu merge npu merge npu merge npu merge npu merge npu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added some comments, please take a look and let me know if you have any thoughts or questions.
@@ -56,6 +56,16 @@ def __init__(self, model_path: str, vision: bool, device: str = "xpu", backend: | |||
|
|||
self.engine = OnnxruntimeEngine(self.model_path, self.vision, self.device) | |||
logger.info(f"Initializing onnxruntime backend ({backend.upper()}): OnnxruntimeEngine") | |||
|
|||
elif self.backend == "npu": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you find a way to detect if this is Intel or AMD machine?
If user specify
npu
device, you have to check if it is Intel or AMD first.
> If the machine is Intel, then you continue to load model usingintel_npu_engine.py
.
> If the machine is AMD, then you throw error message saying that NPU support on AMD platform is not supported yet.
@@ -0,0 +1,268 @@ | |||
import contextlib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you rename npu_engine.py
into intel_npu_engine.py
as this is NPU code for Intel only?
Do DM me on Whatsapp to discuss about this if you think otherwise.
@szeyu can you also resolve the conflicts? |
resolved conflict |
Add NPU Engine #28
Reference : Phi-3 Cookbook - Intel NPU acceleration library
Update in:
modelui.py
engine.py
setup.py
README.md
Add:
npu_egnine.py
requirements-npu.txt
npu_models.md