Skip to content

Parallel: Added evalulation logic#29

Merged
rbx merged 2 commits intoFairRootGroup:masterfrom
enlorenz:wip/integration
Mar 3, 2026
Merged

Parallel: Added evalulation logic#29
rbx merged 2 commits intoFairRootGroup:masterfrom
enlorenz:wip/integration

Conversation

@enlorenz
Copy link
Contributor

@enlorenz enlorenz commented Mar 3, 2026

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 3, 2026

📝 Walkthrough

Walkthrough

Adds workload generator CLI support and savings-evaluation flags. Introduces build_workloadgen_cli_args to serialize workloadgen options, extends build_command() and run_all_parallel() signatures to accept evaluate_savings, eval_months, and workloadgen_args, and threads new parser flags through main() into the execution path.

Changes

Cohort / File(s) Summary
Train iteration CLI & callchain
train_iter.py
Added CLI flags --evaluate-savings (store_true) and --eval-months (int, default 6). Extended build_command(...) signature with evaluate_savings=False, eval_months=0, workloadgen_args=None to append --evaluate-savings/--eval-months and include workloadgen_args when present. run_all_parallel(...) signature extended to accept and forward evaluate_savings, eval_months, and workloadgen_args. main() now calls build_workloadgen_cli_args(args) and forwards all new params through the call chain.
Workload generator CLI helper
src/workloadgen_cli.py
Added build_workloadgen_cli_args(args: argparse.Namespace) -> list[str] which serializes parsed workload-gen-related args into a list of CLI flags (returns empty list when workload generation disabled). Kept alongside existing add_workloadgen_args.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning No pull request description was provided by the author, making it impossible to assess whether it relates to the changeset. Add a pull request description explaining the purpose of these changes, the workload generator integration, and how the evaluation savings feature works.
Docstring Coverage ⚠️ Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title mentions 'evaluation logic' but is misspelled as 'evalulation'. The changes actually add workload generator CLI integration and evaluation savings parameters, not just generic evaluation logic. Clarify the title to accurately describe the main changes: consider 'Add workload generator CLI integration and evaluation savings parameters' or similar to better reflect the actual implementation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@train_iter.py`:
- Around line 133-134: The code in build_command appends ["--evaluate-savings",
"--eval-months", str(eval_months)] when evaluate_savings is True, which will
pass the string "None" if eval_months is None; modify build_command (or the
default for eval_months) so that when evaluate_savings is True and eval_months
is None it uses a safe default (e.g., 6) or skips adding --eval-months until a
valid int is provided; specifically update the logic around
evaluate_savings/eval_months in build_command to either set eval_months = 6 when
None or only append "--eval-months" if eval_months is not None so train.py never
receives "None".

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 22e32ef and 5a6185a.

📒 Files selected for processing (1)
  • train_iter.py

Comment on lines +133 to +134
if evaluate_savings:
command += ["--evaluate-savings", "--eval-months", str(eval_months)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Potential bug: eval_months=None will pass "None" string to train.py.

When evaluate_savings=True but eval_months is not explicitly provided (remains None from the default on line 110), str(None) produces the literal string "None", which will likely cause train.py to fail when parsing the integer argument.

While the CLI path via main() always provides a default of 6, direct calls to build_command with evaluate_savings=True will hit this issue.

Proposed fix: add a guard or default
     if evaluate_savings:
+        if eval_months is None:
+            eval_months = 6
         command += ["--evaluate-savings", "--eval-months", str(eval_months)]

Alternatively, change the default on line 110:

-    eval_months=None,
+    eval_months=6,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@train_iter.py` around lines 133 - 134, The code in build_command appends
["--evaluate-savings", "--eval-months", str(eval_months)] when evaluate_savings
is True, which will pass the string "None" if eval_months is None; modify
build_command (or the default for eval_months) so that when evaluate_savings is
True and eval_months is None it uses a safe default (e.g., 6) or skips adding
--eval-months until a valid int is provided; specifically update the logic
around evaluate_savings/eval_months in build_command to either set eval_months =
6 when None or only append "--eval-months" if eval_months is not None so
train.py never receives "None".

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
train_iter.py (1)

109-110: Default value inconsistency between build_command and CLI.

The eval_months default here is 0, but the CLI default on line 220 is 6. If build_command is called directly with evaluate_savings=True without specifying eval_months, it will evaluate for 0 months, which is likely not meaningful.

Consider aligning defaults:

Proposed fix: align default to 6
     seed=None,
     evaluate_savings=False,
-    eval_months=0,
+    eval_months=6,
 ):
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@train_iter.py` around lines 109 - 110, The build_command invocation sets
eval_months=0 while the CLI default is 6, causing inconsistent behavior when
evaluate_savings=True; update the default in build_command (the eval_months
parameter used where evaluate_savings is passed) to 6 to match the CLI, or
modify build_command to default eval_months to None and fallback to the CLI's
default (6) when evaluate_savings is True; ensure you adjust the default for the
eval_months argument referenced in build_command and any callers that rely on
evaluate_savings to maintain consistent evaluation length.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@train_iter.py`:
- Around line 109-110: The build_command invocation sets eval_months=0 while the
CLI default is 6, causing inconsistent behavior when evaluate_savings=True;
update the default in build_command (the eval_months parameter used where
evaluate_savings is passed) to 6 to match the CLI, or modify build_command to
default eval_months to None and fallback to the CLI's default (6) when
evaluate_savings is True; ensure you adjust the default for the eval_months
argument referenced in build_command and any callers that rely on
evaluate_savings to maintain consistent evaluation length.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5a6185a and 58a4354.

📒 Files selected for processing (1)
  • train_iter.py

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@train_iter.py`:
- Around line 110-111: The eval_months parameter currently defaults to 0 and can
be forwarded into train.py unchanged; update validation in build_command (and
any callers that forward eval_months) to check that eval_months is a positive
integer and, if evaluate_savings is True and eval_months is missing/<=0,
substitute a safe default (e.g., 1 or a named constant DEFAULT_EVAL_MONTHS)
before constructing the command; ensure the validated/normalized value is the
one passed to train invocation and update references in functions/build_command
where eval_months is forwarded so non-CLI callers never send invalid month
values.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 58a4354 and 6372ad4.

📒 Files selected for processing (2)
  • src/workloadgen_cli.py
  • train_iter.py

Comment on lines +110 to +111
evaluate_savings=False,
eval_months=0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Validate eval_months and use a safe default in build_command.

Line 110 defaults eval_months to 0, and Line 136 forwards it as-is when evaluation is enabled. This allows invalid month values (e.g., 0/negative) to leak into train.py for non-CLI callers.

🔧 Proposed fix
 def build_command(
@@
-    eval_months=0,
+    eval_months=6,
@@
-    if evaluate_savings:
+    if evaluate_savings:
+        if eval_months < 1:
+            raise ValueError("eval_months must be >= 1 when evaluate_savings=True")
         command += ["--evaluate-savings", "--eval-months", str(eval_months)]
@@
 def main():
@@
     if args.parallel < 1:
         parser.error("--parallel must be at least 1")
+    if args.evaluate_savings and args.eval_months < 1:
+        parser.error("--eval-months must be at least 1 when --evaluate-savings is set")

Also applies to: 135-136, 225-226

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@train_iter.py` around lines 110 - 111, The eval_months parameter currently
defaults to 0 and can be forwarded into train.py unchanged; update validation in
build_command (and any callers that forward eval_months) to check that
eval_months is a positive integer and, if evaluate_savings is True and
eval_months is missing/<=0, substitute a safe default (e.g., 1 or a named
constant DEFAULT_EVAL_MONTHS) before constructing the command; ensure the
validated/normalized value is the one passed to train invocation and update
references in functions/build_command where eval_months is forwarded so non-CLI
callers never send invalid month values.

@rbx rbx merged commit 807366c into FairRootGroup:master Mar 3, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants