-
-
Notifications
You must be signed in to change notification settings - Fork 16
add ascend 910B npu support #24
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
base: main
Are you sure you want to change the base?
Conversation
感谢感谢,等我晚点并入,发版 |
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.
Pull Request Overview
Adds support for Ascend 910B NPU by integrating the ONNXRuntime CANN execution provider.
- Introduces a new
CANNExecutionProvider
enum and related configuration flag - Extends session setup to conditionally prepend the CANN EP with its specific options
- Updates the main entrypoint to accept and forward a
use_cann
argument
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
rapid_layout/utils/infer_engine.py | Added CANN_EP enum, cfg_use_cann handling, _check_cann and EP insertion logic |
rapid_layout/main.py | Exposed new use_cann parameter and passed it into OrtInferSession configuration |
Comments suppressed due to low confidence (2)
rapid_layout/main.py:54
- No tests cover the new
use_cann
code path; consider adding unit or integration tests to verify the CANNExecutionProvider logic.
use_cann: bool = False,
@@ -51,6 +51,7 @@ def __init__( | |||
iou_thres: float = 0.5, | |||
use_cuda: bool = False, | |||
use_dml: bool = False, | |||
use_cann: bool = False, |
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.
[nitpick] The new use_cann
parameter is not documented in the function docstring or CLI help; consider updating documentation to describe this option.
Copilot uses AI. Check for mistakes.
@@ -71,6 +73,16 @@ def _get_ep_list(self) -> List[Tuple[str, Dict[str, Any]]]: | |||
} | |||
EP_list = [(EP.CPU_EP.value, cpu_provider_opts)] | |||
|
|||
self.use_cann = self._check_cann() |
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.
[nitpick] Provider initialization follows a similar pattern across _check_*
methods and EP_list
insertion; consider refactoring common logic into a helper to reduce duplication.
Copilot uses AI. Check for mistakes.
910B的支持,已在CANN8通过测试,需要依赖onnxruntime-cann