diff --git a/predix.py b/predix.py index e51d5183..74347bd5 100644 --- a/predix.py +++ b/predix.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +import logging """ Predix CLI - Wrapper for rdagent with LLM model selection. @@ -49,7 +50,7 @@ def _ensure_kronos_factor_in_pool(con) -> None: if existing.get("ic") is not None: return except Exception: - pass + logging.debug("Exception caught", exc_info=True) con.print("\n[bold yellow]Kronos Factor[/bold yellow] not in pool — generating automatically...") con.print(" [dim]stride=500 (~4500 windows), batch=32 — ~5-10 min on GPU[/dim]") diff --git a/rdagent/app/finetune/llm/ui/components.py b/rdagent/app/finetune/llm/ui/components.py index 75242a8b..dbec703e 100644 --- a/rdagent/app/finetune/llm/ui/components.py +++ b/rdagent/app/finetune/llm/ui/components.py @@ -1,3 +1,4 @@ +import logging """ FT UI Components - Hierarchical Event Renderers """ @@ -223,7 +224,7 @@ def render_scenario(content: Any) -> None: timeout_hours = content.real_full_timeout() / 60 / 60 st.markdown(f"**Full Train Timeout:** {timeout_hours:.2f} hours") except Exception: - pass + logging.debug("Exception caught", exc_info=True) # 4. Device info - formatted nicely if hasattr(content, "device_info") and content.device_info: diff --git a/rdagent/app/rl/ui/rl_summary.py b/rdagent/app/rl/ui/rl_summary.py index ebb72908..f9cc013f 100644 --- a/rdagent/app/rl/ui/rl_summary.py +++ b/rdagent/app/rl/ui/rl_summary.py @@ -1,3 +1,4 @@ +import logging """ RL Job Summary View Display summary table for all tasks in a job directory @@ -43,7 +44,7 @@ def get_loop_status(task_path: Path, loop_id: int) -> tuple[str, bool | None]: feedback_decision = decision break except Exception: - pass + logging.debug("Exception caught", exc_info=True) if feedback_decision is not None: return ("OK" if feedback_decision else "X"), feedback_decision diff --git a/rdagent/components/coder/factor_coder/factor.py b/rdagent/components/coder/factor_coder/factor.py index 6312f8a8..f565cdd1 100644 --- a/rdagent/components/coder/factor_coder/factor.py +++ b/rdagent/components/coder/factor_coder/factor.py @@ -1,3 +1,4 @@ +import logging from __future__ import annotations import subprocess diff --git a/rdagent/components/coder/kronos_adapter.py b/rdagent/components/coder/kronos_adapter.py index af7e6f35..3bca9a04 100644 --- a/rdagent/components/coder/kronos_adapter.py +++ b/rdagent/components/coder/kronos_adapter.py @@ -355,7 +355,7 @@ def evaluate_kronos_model( predicted_returns.append(pred_ret) actual_returns.append(actual_ret) except Exception: - pass + logging.debug("Exception caught", exc_info=True) pred_arr = np.array(predicted_returns) actual_arr = np.array(actual_returns) diff --git a/rdagent/components/coder/model_coder/benchmark/gt_code/A-DGN.py b/rdagent/components/coder/model_coder/benchmark/gt_code/A-DGN.py index 91cba514..d048169e 100644 --- a/rdagent/components/coder/model_coder/benchmark/gt_code/A-DGN.py +++ b/rdagent/components/coder/model_coder/benchmark/gt_code/A-DGN.py @@ -1,3 +1,4 @@ +import logging import math from typing import Any, Callable, Dict, Optional, Union diff --git a/rdagent/components/coder/model_coder/benchmark/gt_code/dirgnn.py b/rdagent/components/coder/model_coder/benchmark/gt_code/dirgnn.py index cd0a178a..f1cbcc89 100644 --- a/rdagent/components/coder/model_coder/benchmark/gt_code/dirgnn.py +++ b/rdagent/components/coder/model_coder/benchmark/gt_code/dirgnn.py @@ -1,3 +1,4 @@ +import logging import copy import torch diff --git a/rdagent/components/coder/model_coder/benchmark/gt_code/gpsconv.py b/rdagent/components/coder/model_coder/benchmark/gt_code/gpsconv.py index 92491338..edda2419 100644 --- a/rdagent/components/coder/model_coder/benchmark/gt_code/gpsconv.py +++ b/rdagent/components/coder/model_coder/benchmark/gt_code/gpsconv.py @@ -1,3 +1,4 @@ +import logging import inspect from typing import Any, Dict, Optional diff --git a/rdagent/components/coder/model_coder/benchmark/gt_code/linkx.py b/rdagent/components/coder/model_coder/benchmark/gt_code/linkx.py index 332c2075..fc2463ce 100644 --- a/rdagent/components/coder/model_coder/benchmark/gt_code/linkx.py +++ b/rdagent/components/coder/model_coder/benchmark/gt_code/linkx.py @@ -1,3 +1,4 @@ +import logging import math import torch diff --git a/rdagent/components/coder/model_coder/benchmark/gt_code/pmlp.py b/rdagent/components/coder/model_coder/benchmark/gt_code/pmlp.py index de93fda5..9ba08ee2 100644 --- a/rdagent/components/coder/model_coder/benchmark/gt_code/pmlp.py +++ b/rdagent/components/coder/model_coder/benchmark/gt_code/pmlp.py @@ -1,3 +1,4 @@ +import logging from typing import Optional import torch diff --git a/rdagent/components/coder/model_coder/benchmark/gt_code/visnet.py b/rdagent/components/coder/model_coder/benchmark/gt_code/visnet.py index e859ceca..1aedf3fd 100644 --- a/rdagent/components/coder/model_coder/benchmark/gt_code/visnet.py +++ b/rdagent/components/coder/model_coder/benchmark/gt_code/visnet.py @@ -1,3 +1,4 @@ +import logging import math from typing import Optional, Tuple diff --git a/rdagent/components/coder/model_coder/gt_code.py b/rdagent/components/coder/model_coder/gt_code.py index 49f0e955..1055eb1b 100644 --- a/rdagent/components/coder/model_coder/gt_code.py +++ b/rdagent/components/coder/model_coder/gt_code.py @@ -1,3 +1,4 @@ +import logging """ This is just an exmaple. It will be replaced wtih a list of ground truth tasks. diff --git a/rdagent/log/daily_log.py b/rdagent/log/daily_log.py index df817b64..924370c6 100644 --- a/rdagent/log/daily_log.py +++ b/rdagent/log/daily_log.py @@ -1,3 +1,4 @@ +import logging """ Daily-rotating log for all Predix commands. @@ -103,7 +104,7 @@ def log_llm_call( try: entry["duration_ms"] = int((end_time - start_time).total_seconds() * 1000) except Exception: - pass + logging.debug("Exception caught", exc_info=True) line = _json.dumps(entry, ensure_ascii=False) out_path = _today_dir() / "llm_calls.jsonl" with _llm_log_lock: diff --git a/rdagent/scenarios/data_science/debug/data.py b/rdagent/scenarios/data_science/debug/data.py index b2c06ffa..e94573e0 100644 --- a/rdagent/scenarios/data_science/debug/data.py +++ b/rdagent/scenarios/data_science/debug/data.py @@ -1,3 +1,4 @@ +import logging import json import os import shutil diff --git a/rdagent/scenarios/data_science/proposal/exp_gen/select/submit.py b/rdagent/scenarios/data_science/proposal/exp_gen/select/submit.py index bd89a014..67548182 100644 --- a/rdagent/scenarios/data_science/proposal/exp_gen/select/submit.py +++ b/rdagent/scenarios/data_science/proposal/exp_gen/select/submit.py @@ -1,3 +1,4 @@ +import logging import json import os import pickle # nosec B301 diff --git a/rdagent/scenarios/kaggle/developer/coder.py b/rdagent/scenarios/kaggle/developer/coder.py index b98a7c18..225260ab 100644 --- a/rdagent/scenarios/kaggle/developer/coder.py +++ b/rdagent/scenarios/kaggle/developer/coder.py @@ -1,3 +1,4 @@ +import logging import json from typing import Dict, List diff --git a/rdagent/scenarios/rl/autorl_bench/agents/example_agent/train.py b/rdagent/scenarios/rl/autorl_bench/agents/example_agent/train.py index 3ba05d6c..86b6745f 100644 --- a/rdagent/scenarios/rl/autorl_bench/agents/example_agent/train.py +++ b/rdagent/scenarios/rl/autorl_bench/agents/example_agent/train.py @@ -1,3 +1,4 @@ +import logging """ GRPO Training Loop """