Skip to content

Commit 94e1430

Browse files
committed
change cuda env to npu
Signed-off-by: wangli <wangli858794774@gmail.com>
1 parent b289dce commit 94e1430

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

vllm_ascend/device_allocator/camem.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
# CANN-mem-based pytorch pluggable allocator to implement sleep mode.
1818
#
1919
import dataclasses
20+
import os
2021
from contextlib import contextmanager
2122
from typing import Any, Callable, Dict, Optional, Tuple, Union
2223

@@ -143,6 +144,12 @@ def get_instance() -> "CaMemAllocator":
143144
return CaMemAllocator.instance
144145

145146
def __init__(self):
147+
conf = os.environ.get("PYTORCH_NPU_ALLOC_CONF", "")
148+
assert "expandable_segments:True" not in conf, \
149+
("Expandable segments are not compatible with memory pool. "
150+
"Please track https://github.com/pytorch/pytorch/issues/147851 "
151+
"for the latest updates.")
152+
146153
self.pointer_to_data: Dict[int, AllocationData] = {}
147154
self.current_tag: str = CaMemAllocator.default_tag
148155
self.allocator_and_pools: Dict[str, Any] = {}

0 commit comments

Comments
 (0)