Skip to content

[Core] Add RL-Kernel mode controls#16

Merged
Flink-ddd merged 3 commits into
rlk-mainfrom
feature/issue7-rlk-mode-parsing
Jul 23, 2026
Merged

[Core] Add RL-Kernel mode controls#16
Flink-ddd merged 3 commits into
rlk-mainfrom
feature/issue7-rlk-mode-parsing

Conversation

@inaniloquentee

Copy link
Copy Markdown
Collaborator

Summary

  • add public RL-Kernel controls --rlk-fast {off,auto,strict} and --rlk-consistency {off,audit,strict}
  • add env aliases VIME_RLK_FAST and VIME_RLK_CONSISTENCY
  • preserve legacy compatibility flags: --enable-rl-kernel, --rl-kernel-strict, and --rl-kernel-ops
  • centralize resolved values in args.rlk_mode_config

Fixes #7

Tests

  • pre-commit run --all-files --show-diff-on-failure --color=always
  • python -m pytest tests/test_megatron_argument_validation.py -m unit
  • python -m pytest tests/utils/test_megatron_server_arguments.py tests/test_megatron_argument_validation.py -m unit
  • git diff --check

CI note

  • python -m pytest tests -m unit was attempted locally, but collection fails before running this change's tests due to existing local environment/import issues on Windows: dotted test module names such as test_qwen2.5... are imported as packages, and ray.util is unavailable in the local stubbed environment.

AI assistance

This PR includes AI-assisted code changes generated with OpenAI Codex and reviewed before submission.

Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: inaniloquentee <3051000145@qq.com>
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: feb8d6a2-e61e-4720-ac0f-f97db4eefd8b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/issue7-rlk-mode-parsing

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.

@Flink-ddd Flink-ddd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Overall, the code is extremely solid and fully meets the Phase 1 acceptance criteria. LGTM!

Comment thread vime/utils/arguments.py
args.rlk_fast = fast
args.rlk_consistency = consistency
args.rl_kernel_ops = ops
args.rlk_mode_config = config

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Two Sources of Truth: Writing resolved values to both the root args (e.g., args.rl_kernel_ops) and args.rlk_mode_config is fine for backward compatibility. However, consider adding an inline deprecation comment to the root attributes to strictly guide future development toward the immutable rlk_mode_config.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Two Sources of Truth: Writing resolved values to both the root args (e.g., args.rl_kernel_ops) and args.rlk_mode_config is fine for backward compatibility. However, consider adding an inline deprecation comment to the root attributes to strictly guide future development toward the immutable rlk_mode_config.

Thanks, addressed. I added an inline compatibility comment explaining that the root attributes are legacy aliases and new code should prefer the immutable args.rlk_mode_config.

Comment thread vime/utils/arguments.py

parser = add_cluster_arguments(parser)
parser = add_train_arguments(parser)
parser = add_rl_kernel_arguments(parser)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ambiguous Injection Point: Hooking add_rl_kernel_arguments inside add_ci_arguments is slightly misleading in its naming. Just ensure this specific entry point is actually triggered during standard production training, not just in CI environments.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Ambiguous Injection Point: Hooking add_rl_kernel_arguments inside add_ci_arguments is slightly misleading in its naming. Just ensure this specific entry point is actually triggered during standard production training, not just in CI environments.

Good point. I clarified the production parser entry point with an inline comment and added a regression test that builds the standard vime parser and parses the RL-Kernel flags.

Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: inaniloquentee <3051000145@qq.com>

@Flink-ddd Flink-ddd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, Thank.

@Flink-ddd
Flink-ddd requested a review from a-kaa July 20, 2026 05:28
Signed-off-by: inaniloquentee <3051000145@qq.com>
@inaniloquentee
inaniloquentee force-pushed the feature/issue7-rlk-mode-parsing branch from c87f521 to af7e995 Compare July 20, 2026 15:12
@Flink-ddd

Copy link
Copy Markdown
Collaborator

cc @zhangj1an @maxiaosong1124 @a-kaa PTAL, if no further questions, we will merge this PR first. Thanks.

@Flink-ddd
Flink-ddd merged commit 2f62135 into rlk-main Jul 23, 2026
1 check 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