[Bugfix] Fix WSL circular import from pin_memory warning_once (#48444)
Signed-off-by: AlejandroParedesLT <alejandroparedeslatorre@gmail.com> Co-authored-by: Shengqi Chen <harry-chen@outlook.com>
Alejandro Paredes La Torre committed
Jul 20, 2026 at 18:30 UTC
0a684ab0c0156fc0c4a8ebae33eba35439a9ef13
2 files changed
+4
-2
vllm/platforms/cuda.py
+2
-1
@@ -290,7 +290,8 @@ class CudaPlatformBase(Platform):
290
# kernel with limited pinned memory support for CUDA.
291
version = _get_wsl_kernel_version()
292
if version is None or version < (4, 19, 121):
293
- logger.warning_once(
293
+ # warning_once() causes a circular import on WSL, see #48397.
294
+ logger.warning(
295
"Using 'pin_memory=False' as WSL is detected and the "
296
"WSL2 kernel version is below 4.19.121. This may slow "
297
"down performance. Please run `wsl --update`."
vllm/platforms/interface.py
+2
-1
@@ -991,7 +991,8 @@ class Platform:
991
# Pinned memory support under WSL depends on the vendor and driver
992
# version. Conservative default: return False. Platform subclasses
993
# that can verify support (e.g. CudaPlatformBase) override this.
994
- logger.warning_once(
994
+ # warning_once() causes a circular import on WSL, see #48397.
995
+ logger.warning(
996
"Using 'pin_memory=False' as WSL is detected. "
997
"This may slow down performance."
998
)