-
Notifications
You must be signed in to change notification settings - Fork 630
[ascend] refactor code #4176
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?
[ascend] refactor code #4176
Conversation
| AscendOpsBackend.enable_graph = ascend_graph_runner.enable_graph | ||
| return ascend_graph_runner | ||
| from lmdeploy.pytorch.backends.cuda.graph_runner import CUDAGraphRunner | ||
| return CUDAGraphRunner(model, model_config, cache_config, backend_config, device) |
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.
let's make a new aclgraphrunner instead
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
This PR refactors the Ascend backend code by removing Ascend310P-specific support and simplifying the codebase to focus solely on Ascend910 devices. The refactoring also restructures the update_step_context method for better code organization.
Key changes:
- Removed all Ascend310P-specific logic including NZ format weight transformations, block shape calculations, and attention mask handling
- Simplified
SocVersionclass by replacing the cacheddevice_name()method with a class attribute - Refactored
update_step_contextmethod to use helper functions for better code organization and readability
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| lmdeploy/pytorch/backends/dlinfer/linear.py | Removed Ascend310P-specific weight transformation logic for NZ format |
| lmdeploy/pytorch/backends/dlinfer/ascend/op_backend.py | Removed Ascend310P support from block shape methods, simplified SocVersion class, refactored update_step_context with helper functions, removed enable_aclgraph method, updated build_graph_runner to use only CUDAGraphRunner, removed Ascend310P compile mode settings |
| lmdeploy/pytorch/backends/dlinfer/ascend/graph_runner.py | Removed Ascend310P-specific get_logits compilation logic |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.