feat: async mechanism for multi-trace (#981)

* start to work on multi-trace + async

* init ver of async-multi-tarce, to test

* add eng-ver log

* complete version of async+ mul-trace

* debug

* fix bug on         DS_RD_SETTING.get()

* update

* fix bug + simplif the usage of async in multi-trace

* fix mini bug of arg_name

* Move local_selection into class Experiment & clean the code
This commit is contained in:
xuangu-fang
2025-06-26 15:49:47 +08:00
committed by GitHub
parent ea59efc139
commit a439d9ef2e
10 changed files with 232 additions and 8 deletions
+5
View File
@@ -136,6 +136,11 @@ class LoopBase:
if isinstance(limit := RD_AGENT_SETTINGS.step_semaphore, dict):
limit = limit.get(step_name, 1) # default to 1 if not specified
# NOTE: we assume the record step is always the last step to modify the global environment,
# so we set the limit to 1 to avoid race condition
if step_name == "record":
limit = 1
if step_name not in self.semaphores:
self.semaphores[step_name] = asyncio.Semaphore(limit)
return self.semaphores[step_name]