Skip to content

Conversation

@luoxiaolin712
Copy link
Contributor

@luoxiaolin712 luoxiaolin712 commented Jan 8, 2026

What this PR does / why we need it?

Based on the RFC:#5604

This PR is a refactoring of vllm_ascend/distributed, moving all kv_transfer realtaed codes into a dedicated folder, which has already been done in vLLM

Does this PR introduce any user-facing change?

NA

How was this patch tested?

@github-actions
Copy link

github-actions bot commented Jan 8, 2026

👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:‌‌

  • A PR should do only one thing, smaller PRs enable faster reviews.
  • Every PR should include unit tests and end-to-end tests ‌to ensure it works and is not broken by other future PRs.
  • Write the commit message by fulfilling the PR description to help reviewer and future developers understand.

If CI fails, you can run linting and testing checks locally according Contributing and Testing.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a large-scale refactoring of the vllm_ascend/distributed module, moving files into a more organized directory structure and updating import paths accordingly. While this is a positive change for code organization, I've identified several incorrect import paths that will cause ImportError exceptions at runtime. These are critical issues that need to be fixed. I've provided specific comments and suggestions for each case.

Comment on lines 10 to 11
from vllm_ascend.distributed.kv_transfer.kv_pool.ascend_store.backend import ( # noqa: E402
_convert_to_bytes, _parse_global_segment_size)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The import for _convert_to_bytes and _parse_global_segment_size is incorrect. They are being imported from the backend package, but the __init__.py for that package is empty, which will cause an ImportError. Please either update the __init__.py to expose these functions or change the import to be direct from their module.

Suggested change
from vllm_ascend.distributed.kv_transfer.kv_pool.ascend_store.backend import ( # noqa: E402
_convert_to_bytes, _parse_global_segment_size)
from vllm_ascend.distributed.kv_transfer.kv_pool.ascend_store.backend.mooncake_backend import ( # noqa: E402
_convert_to_bytes, _parse_global_segment_size)

from vllm.logger import logger

from vllm_ascend.distributed.kvpool.backend.backend import Backend
from vllm_ascend.distributed.kv_transfer.kv_pool.ascend_store.backend import Backend
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The import for Backend is incorrect. It is being imported from the backend package, but the __init__.py for that package is empty, which will cause an ImportError. Please either update the __init__.py to expose this class or change the import to be direct from its module.

Suggested change
from vllm_ascend.distributed.kv_transfer.kv_pool.ascend_store.backend import Backend
from vllm_ascend.distributed.kv_transfer.kv_pool.ascend_store.backend.backend import Backend

Comment on lines 14 to 18
from vllm_ascend.distributed.kv_transfer.kv_pool.ascend_store.backend import Backend
from vllm_ascend.distributed.kv_transfer.kv_pool.ascend_store.backend.memcache_backend import \
MemcacheBackend
from vllm_ascend.distributed.kvpool.backend.mooncake_backend import \
from vllm_ascend.distributed.kv_transfer.kv_pool.ascend_store.backend import \
MooncakeBackend
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The imports for Backend and MooncakeBackend are incorrect. They are being imported from the backend package, but the __init__.py for that package is empty, which will cause an ImportError. Please either update the __init__.py to expose these classes or change the imports to be direct from their respective modules.

Suggested change
from vllm_ascend.distributed.kv_transfer.kv_pool.ascend_store.backend import Backend
from vllm_ascend.distributed.kv_transfer.kv_pool.ascend_store.backend.memcache_backend import \
MemcacheBackend
from vllm_ascend.distributed.kvpool.backend.mooncake_backend import \
from vllm_ascend.distributed.kv_transfer.kv_pool.ascend_store.backend import \
MooncakeBackend
from vllm_ascend.distributed.kv_transfer.kv_pool.ascend_store.backend.backend import Backend
from vllm_ascend.distributed.kv_transfer.kv_pool.ascend_store.backend.memcache_backend import \
MemcacheBackend
from vllm_ascend.distributed.kv_transfer.kv_pool.ascend_store.backend.mooncake_backend import \
MooncakeBackend


from vllm_ascend.ascend_config import get_ascend_config
from vllm_ascend.distributed.utils import fc3_all_gather_and_maybe_unpad_impl
from vllm_ascend.distributed.kv_transfer.utils.utils import fc3_all_gather_and_maybe_unpad_impl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The import path for fc3_all_gather_and_maybe_unpad_impl is incorrect. This function was not moved to vllm_ascend.distributed.kv_transfer.utils.utils as part of the refactoring; it remains in vllm_ascend.distributed.utils. This change will cause an ImportError.

Suggested change
from vllm_ascend.distributed.kv_transfer.utils.utils import fc3_all_gather_and_maybe_unpad_impl
from vllm_ascend.distributed.utils import fc3_all_gather_and_maybe_unpad_impl

@luoxiaolin712 luoxiaolin712 changed the title [RPC]Refactor of vllm_ascend/distributed module [RFC]Refactor of vllm_ascend/distributed module Jan 8, 2026
@luoxiaolin712 luoxiaolin712 changed the title [RFC]Refactor of vllm_ascend/distributed module [Refactor]Refactor of vllm_ascend/distributed module Jan 8, 2026
@luoxiaolin712
Copy link
Contributor Author

luoxiaolin712 commented Jan 9, 2026

The RFC has reached an agreement.

@github-actions
Copy link

github-actions bot commented Jan 9, 2026

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@wangxiyuan
Copy link
Collaborator

@LCAIZJ @liziyu179

@wangxiyuan
Copy link
Collaborator

please fix the merge conflict.

@lidenghui1110
Copy link
Contributor

organized by function is ok to me, howerver, cpu_offload_manager in distributed directory is relied by cpu_offload_connector, maybe cpu_offload_manager should be moved into cpu_offload dir after this refactor?

@Pz1116
Copy link
Contributor

Pz1116 commented Jan 14, 2026

organized by function is ok to me, howerver, cpu_offload_manager in distributed directory is relied by cpu_offload_connector, maybe cpu_offload_manager should be moved into cpu_offload dir after this refactor?

my bad, moving cpu_offload_manager under cpu_offload dir is exactly what we planed to do, but I missed this part when drawing the table in the RFC, we'll fix this shortly.

@wangxiyuan wangxiyuan merged commit 295018e into vllm-project:main Jan 15, 2026
16 checks passed
aipaes pushed a commit to aipaes/vllm-ascend that referenced this pull request Jan 15, 2026
### What this PR does / why we need it?
Based on the RFC:vllm-project#5604

This PR is a refactoring of vllm_ascend/distributed, moving all
kv_transfer realtaed codes into a dedicated folder, which has already
been done in vLLM

### Does this PR introduce _any_ user-facing change?
NA

### How was this patch tested?


- vLLM version: v0.13.0
- vLLM main:
vllm-project/vllm@2f4e654

---------

Signed-off-by: lty <[email protected]>
@LCAIZJ
Copy link
Collaborator

LCAIZJ commented Jan 20, 2026

LGTM

starmountain1997 pushed a commit to starmountain1997/vllm-ascend that referenced this pull request Jan 31, 2026
### What this PR does / why we need it?
Based on the RFC:vllm-project#5604

This PR is a refactoring of vllm_ascend/distributed, moving all
kv_transfer realtaed codes into a dedicated folder, which has already
been done in vLLM

### Does this PR introduce _any_ user-facing change?
NA

### How was this patch tested?


- vLLM version: v0.13.0
- vLLM main:
vllm-project/vllm@2f4e654

---------

Signed-off-by: lty <[email protected]>
starmountain1997 pushed a commit to starmountain1997/vllm-ascend that referenced this pull request Jan 31, 2026
Based on the RFC:vllm-project#5604

This PR is a refactoring of vllm_ascend/distributed, moving all
kv_transfer realtaed codes into a dedicated folder, which has already
been done in vLLM

NA

- vLLM version: v0.13.0
- vLLM main:
vllm-project/vllm@2f4e654

---------

Signed-off-by: lty <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants