mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-08-05 03:07:42 +00:00
feat: base data science scenario UI (#525)
* base data science ui * fix bug * fix mle grade * not cache when mle prepare * fix * fix grade sample * fix a small bug * fix * cache mle score * fix * add gen_mle_score script * update for mle score * simple debug show * small change * summary folder * add evo loop tag * add loop id * add comment * fix CI * add enable_cache for docker conf * CI * use setting data path * fix ui bug --------- Co-authored-by: yuanteli <1957922024@qq.com>
This commit is contained in:
@@ -144,6 +144,8 @@ class DockerConf(ExtendedBaseSettings):
|
||||
|
||||
running_timeout_period: int = 3600 # 1 hour
|
||||
|
||||
enable_cache: bool = True # enable the cache mechanism
|
||||
|
||||
|
||||
class QlibDockerConf(DockerConf):
|
||||
model_config = ExtendedSettingsConfigDict(env_prefix="QLIB_DOCKER_")
|
||||
@@ -227,6 +229,7 @@ class MLEBDockerConf(DockerConf):
|
||||
mem_limit: str | None = (
|
||||
"48g" # Add memory limit attribute # new-york-city-taxi-fare-prediction may need more memory
|
||||
)
|
||||
enable_cache: bool = False
|
||||
|
||||
|
||||
# physionet.org/files/mimic-eicu-fiddle-feature/1.0.0/FIDDLE_mimic3
|
||||
@@ -458,7 +461,10 @@ class DockerEnv(Env[DockerConf]):
|
||||
)
|
||||
|
||||
start = time.time()
|
||||
out = self.cached_run(entry_add_timeout, local_path, env, running_extra_volume)
|
||||
if self.conf.enable_cache:
|
||||
out = self.cached_run(entry_add_timeout, local_path, env, running_extra_volume)
|
||||
else:
|
||||
out = self.__run(entry, local_path, env, running_extra_volume, remove_timestamp=False)
|
||||
end = time.time()
|
||||
|
||||
if end - start + 1 >= self.conf.running_timeout_period:
|
||||
|
||||
+22
-22
@@ -111,29 +111,29 @@ class LoopBase:
|
||||
li, si = self.loop_idx, self.step_idx
|
||||
|
||||
name = self.steps[si]
|
||||
# with logger.tag(f"Loop_{li}.{name}"):
|
||||
start = datetime.datetime.now(datetime.timezone.utc)
|
||||
func = getattr(self, name)
|
||||
try:
|
||||
self.loop_prev_out[name] = func(self.loop_prev_out)
|
||||
# TODO: Fix the error logger.exception(f"Skip loop {li} due to {e}")
|
||||
except self.skip_loop_error as e:
|
||||
# FIXME: This does not support previous demo (due to their last step is not for recording)
|
||||
logger.warning(f"Skip loop {li} due to {e}")
|
||||
# NOTE: strong assumption! The last step is responsible for recording information
|
||||
self.step_idx = len(self.steps) - 1 # directly jump to the last step.
|
||||
self.loop_prev_out[self.EXCEPTION_KEY] = e
|
||||
continue
|
||||
finally:
|
||||
# make sure failure steps are displayed correclty
|
||||
end = datetime.datetime.now(datetime.timezone.utc)
|
||||
self.loop_trace[li].append(LoopTrace(start, end, step_idx=si))
|
||||
with logger.tag(f"Loop_{li}.{name}"):
|
||||
start = datetime.datetime.now(datetime.timezone.utc)
|
||||
func = getattr(self, name)
|
||||
try:
|
||||
self.loop_prev_out[name] = func(self.loop_prev_out)
|
||||
# TODO: Fix the error logger.exception(f"Skip loop {li} due to {e}")
|
||||
except self.skip_loop_error as e:
|
||||
# FIXME: This does not support previous demo (due to their last step is not for recording)
|
||||
logger.warning(f"Skip loop {li} due to {e}")
|
||||
# NOTE: strong assumption! The last step is responsible for recording information
|
||||
self.step_idx = len(self.steps) - 1 # directly jump to the last step.
|
||||
self.loop_prev_out[self.EXCEPTION_KEY] = e
|
||||
continue
|
||||
finally:
|
||||
# make sure failure steps are displayed correclty
|
||||
end = datetime.datetime.now(datetime.timezone.utc)
|
||||
self.loop_trace[li].append(LoopTrace(start, end, step_idx=si))
|
||||
|
||||
# Update tqdm progress bar directly to step_idx
|
||||
pbar.n = si + 1
|
||||
pbar.set_postfix(
|
||||
loop_index=li, step_index=si + 1, step_name=name
|
||||
) # step_name indicate last finished step_name
|
||||
# Update tqdm progress bar directly to step_idx
|
||||
pbar.n = si + 1
|
||||
pbar.set_postfix(
|
||||
loop_index=li, step_index=si + 1, step_name=name
|
||||
) # step_name indicate last finished step_name
|
||||
|
||||
# index increase and save session
|
||||
self.step_idx = (self.step_idx + 1) % len(self.steps)
|
||||
|
||||
Reference in New Issue
Block a user