mirror of
https://github.com/handsomezhuzhu/vllm-npu-plugin.git
synced 2026-02-20 19:50:15 +00:00
fix: Defer SOC version initialization to avoid NPU lazy init issues
This commit is contained in:
@@ -67,11 +67,13 @@ _IS_EAGLE_MODE = None
|
||||
def is_310p():
|
||||
global _IS_310P
|
||||
if _IS_310P is None:
|
||||
try:
|
||||
soc_version = torch_npu.npu.get_soc_version()
|
||||
# 310P soc_version range: 200-209
|
||||
_IS_310P = 200 <= soc_version <= 209
|
||||
except Exception:
|
||||
# Check if SOC version is already known from init_ascend_soc_version()
|
||||
if _ascend_soc_version is not None:
|
||||
_IS_310P = False # 310P is not A2 or A3
|
||||
else:
|
||||
# Avoid calling torch_npu.npu.get_soc_version() here as it
|
||||
# triggers NPU lazy init which breaks forked subprocesses.
|
||||
# Default to False; will be updated after init_device().
|
||||
_IS_310P = False
|
||||
return _IS_310P
|
||||
|
||||
|
||||
Reference in New Issue
Block a user