Main: Remove uvloop/winloop from experimental status

Uvloop/Winloop does provide advantages to asyncio vs the standard
Proactor loop, so remove experimental status.

Signed-off-by: kingbri <8082010+kingbri1@users.noreply.github.com>
This commit is contained in:
kingbri 2025-02-10 21:30:48 -05:00
parent 0dcbb7a722
commit 30f02e5453
3 changed files with 8 additions and 24 deletions

View file

@ -437,14 +437,6 @@ class DeveloperConfig(BaseConfigModel):
cuda_malloc_backend: Optional[bool] = Field(
False, description=("Enable the torch CUDA malloc backend (default: False).")
)
uvloop: Optional[bool] = Field(
False,
description=(
"Run asyncio using Uvloop or Winloop which can improve performance.\n"
"NOTE: It's recommended to enable this, but if something breaks "
"turn this off."
),
)
realtime_process_priority: Optional[bool] = Field(
False,
description=(

View file

@ -212,10 +212,6 @@ developer:
# Enable the torch CUDA malloc backend (default: False).
cuda_malloc_backend: false
# Run asyncio using Uvloop or Winloop which can improve performance.
# NOTE: It's recommended to enable this, but if something breaks turn this off.
uvloop: false
# Set process to use a higher priority.
# For realtime process priority, run as administrator or sudo.
# Otherwise, the priority will be set to high.

20
main.py
View file

@ -106,6 +106,14 @@ def entrypoint(arguments: Optional[dict] = None):
signal.signal(signal.SIGINT, signal_handler)
signal.signal(signal.SIGTERM, signal_handler)
if platform.system() == "Windows":
from winloop import install
else:
from uvloop import install
# Set loop event policy
install()
# Parse and override config from args
if arguments is None:
parser = init_argparser()
@ -133,18 +141,6 @@ def entrypoint(arguments: Optional[dict] = None):
os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "backend:cudaMallocAsync"
logger.warning("EXPERIMENTAL: Enabled the pytorch CUDA malloc backend.")
# Use Uvloop/Winloop
if config.developer.uvloop:
if platform.system() == "Windows":
from winloop import install
else:
from uvloop import install
# Set loop event policy
install()
logger.warning("EXPERIMENTAL: Running program with Uvloop/Winloop.")
# Set the process priority
if config.developer.realtime_process_priority:
import psutil