[Serve] Require traffic weights to sum more closely to 1. #8476
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes the following.
The last line returns
Internal Error. Traceback: \x1b[36mray::Router.enqueue_request()\x1b[39m (pid=82306, ip=192.168.1.104)\n File "python/ray/_raylet.pyx", line 457, in ray._raylet.execute_task\n with ray.worker._changeproctitle(title, next_title):\n File "python/ray/_raylet.pyx", line 458, in ray._raylet.execute_task\n outputs = function_executor(*args, **kwargs)\n File "python/ray/_raylet.pyx", line 410, in ray._raylet.execute_task.function_executor\n return future.result()\n File "/Users/rkn/opt/anaconda3/lib/python3.7/concurrent/futures/_base.py", line 428, in result\n return self.__get_result()\n File "/Users/rkn/opt/anaconda3/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result\n raise self._exception\n File "/Users/rkn/anyscale/ray/python/ray/serve/router.py", line 220, in enqueue_request\n await self.flush_endpoint_queue(endpoint)\n File "/Users/rkn/anyscale/ray/python/ray/serve/router.py", line 308, in flush_endpoint_queue\n self.endpoint_queues[endpoint], self.backend_queues)\n File "/Users/rkn/anyscale/ray/python/ray/serve/policy.py", line 71, in flush\n p=self.backend_weights).squeeze()\n File "mtrand.pyx", line 924, in numpy.random.mtrand.RandomState.choice\nValueError: probabilities do not sum to 1.