diff --git a/common/config_models.py b/common/config_models.py index f7f0add..96622fc 100644 --- a/common/config_models.py +++ b/common/config_models.py @@ -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=( diff --git a/config_sample.yml b/config_sample.yml index ebea5a1..d9812ec 100644 --- a/config_sample.yml +++ b/config_sample.yml @@ -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. diff --git a/main.py b/main.py index e17e2f8..c7981d5 100644 --- a/main.py +++ b/main.py @@ -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