comaniac commented on a change in pull request #7389:
URL: https://github.com/apache/tvm/pull/7389#discussion_r568793940



##########
File path: python/tvm/rpc/tracker.py
##########
@@ -116,6 +115,7 @@ class PriorityScheduler(Scheduler):
 

Review comment:
       It still holds to me. Even we use a counter it is still a FIFO and based 
on the request order (i.e., time), but I'll refine it to reduce possible 
confusion.

##########
File path: python/tvm/rpc/tracker.py
##########
@@ -134,7 +134,8 @@ def put(self, value):
         self._schedule()
 
     def request(self, user, priority, callback):
-        heapq.heappush(self._requests, (-priority, time.time(), callback))
+        heapq.heappush(self._requests, (-priority, self._request_cnt, 
callback))
+        self._request_cnt += 1

Review comment:
       Added a lock to make heappush atomic. I didn't make heappop atomic since 
this PR doesn't change its behavior. Let me know if there will be an issue.

##########
File path: python/tvm/rpc/tracker.py
##########
@@ -112,10 +112,12 @@ def summary(self):
 
 
 class PriorityScheduler(Scheduler):
-    """Priority based scheduler, FIFO based on time"""
+    """Priority based scheduler, FIFO"""

Review comment:
       ```suggestion
       """Priority based scheduler, FIFO based on request order"""
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to