idolezal commited on
Commit
ff77a20
1 Parent(s): 97092f5

Send more task for remote check significance

Browse files
Files changed (1) hide show
  1. server.py +23 -11
server.py CHANGED
@@ -266,19 +266,31 @@ class LeaderboardServer:
266
  task: False for task in self.tasks_metadata.keys()
267
  }
268
 
269
- for competitor_id in self.submission_ids - {new_submission_id}: # without self
270
- res = check_significance_send_task(new_model_file, self.submission_id_to_file[competitor_id])
271
- res_inverse = check_significance_send_task(self.submission_id_to_file[competitor_id], new_model_file)
 
 
 
 
 
 
 
272
 
273
- res = check_significance_wait_for_result(res)
274
- res_inverse = check_significance_wait_for_result(res_inverse)
 
275
 
276
- new_tournament[new_submission_id][competitor_id] = {
277
- task: data["significant"] for task, data in res.items()
278
- }
279
- new_tournament[competitor_id][new_submission_id] = {
280
- task: data["significant"] for task, data in res_inverse.items()
281
- }
 
 
 
 
282
  return new_tournament
283
 
284
  @staticmethod
 
266
  task: False for task in self.tasks_metadata.keys()
267
  }
268
 
269
+ rest_of_competitors = list(self.submission_ids - {new_submission_id}) # without self
270
+
271
+ result_url = {}
272
+ result_inverse_url = {}
273
+
274
+ while rest_of_competitors:
275
+ next_competitors = []
276
+ while rest_of_competitors:
277
+ if len(next_competitors) < 5: # 5*2==10 tasks
278
+ next_competitors.append(rest_of_competitors.pop())
279
 
280
+ for competitor_id in next_competitors:
281
+ result_url[competitor_id] = check_significance_send_task(new_model_file, self.submission_id_to_file[competitor_id])
282
+ result_inverse_url[competitor_id] = check_significance_send_task(self.submission_id_to_file[competitor_id], new_model_file)
283
 
284
+ for competitor_id in next_competitors:
285
+ result = check_significance_wait_for_result(result_url.pop(competitor_id))
286
+ result_inverse = check_significance_wait_for_result(result_inverse_url.pop(competitor_id))
287
+
288
+ new_tournament[new_submission_id][competitor_id] = {
289
+ task: data["significant"] for task, data in result.items()
290
+ }
291
+ new_tournament[competitor_id][new_submission_id] = {
292
+ task: data["significant"] for task, data in result_inverse.items()
293
+ }
294
  return new_tournament
295
 
296
  @staticmethod