Unverified Commit 21f5d50f authored by MoonRide303's avatar MoonRide303 Committed by GitHub
Browse files

[Bugfix] Do not use resource module on Windows (#12858) (#13029)

parent bf3e0521
...@@ -15,7 +15,6 @@ import ipaddress ...@@ -15,7 +15,6 @@ import ipaddress
import multiprocessing import multiprocessing
import os import os
import re import re
import resource
import signal import signal
import socket import socket
import subprocess import subprocess
...@@ -2070,6 +2069,11 @@ def memory_profiling( ...@@ -2070,6 +2069,11 @@ def memory_profiling(
# Adapted from: https://github.com/sgl-project/sglang/blob/v0.4.1/python/sglang/srt/utils.py#L630 # noqa: E501 # Adapted from: https://github.com/sgl-project/sglang/blob/v0.4.1/python/sglang/srt/utils.py#L630 # noqa: E501
def set_ulimit(target_soft_limit=65535): def set_ulimit(target_soft_limit=65535):
if sys.platform.startswith('win'):
logger.info("Windows detected, skipping ulimit adjustment.")
return
import resource
resource_type = resource.RLIMIT_NOFILE resource_type = resource.RLIMIT_NOFILE
current_soft, current_hard = resource.getrlimit(resource_type) current_soft, current_hard = resource.getrlimit(resource_type)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment