[Misc] Fix import error and address nits to make CI happy (#563)

1. Add `vllm_version_is` function to check vllm version.
2. `ensure_kv_transfer_initialized` and `get_kv_transfer_group ` have
been moved to other place in vllm main branch via
https://github.com/vllm-project/vllm/commit/3408e471597e7a36ca79fab5fc849f4fb5576df8
, this patch fix the import error.

Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>
This commit is contained in:
wangxiyuan authored and GitHub committed 2025-04-18 12:23:32 +08:00
1 parent 66a0837963
commit 42c7fbb10e
9 files changed
+46 -30

No files matched your search

+4 -6
View File
@@ -14,14 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import vllm
from packaging.version import Version
# Import common patches for all versions
from vllm_ascend.patch.platform import patch_common # noqa: F401
from vllm_ascend.utils import vllm_version_is
# Import specific patches for different versions
if Version(vllm.__version__) == Version("0.8.4"):
if vllm_version_is("0.8.4"):
from vllm_ascend.patch.platform import patch_0_8_4 # noqa: F401
from vllm_ascend.patch.platform import patch_common # noqa: F401
else:
from vllm_ascend.patch.platform import patch_common # noqa: F401
from vllm_ascend.patch.platform import patch_main # noqa: F401