[data] feat: add datachecker - #27
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refactors the data handling and validation mechanisms within the RL-Insight project. By introducing a dedicated Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
The pull request refactors the data validation and handling mechanism by introducing a DataChecker class and moving DataEnum and DataValidationError to rl_insight/data/data_checker.py and rl_insight/data/rules.py respectively. The BaseData class and MultiJsonData class are removed, and the PathExistsRule is updated to check for directory existence. The OfflineInsightPipeline and BaseClusterParser are updated to use the new DataChecker for input validation and to remove hardcoded input types, making the system more modular. A hardcoded local path in rl_insight/main.py was updated, and a generated HTML file was added to the repository. Review comments highlight critical issues such as non-portable hardcoded paths, shared mutable class attributes in DataChecker and PathExistsRule, and global logging configuration. Other improvements suggested include renaming a shadowed parameter, safely accessing dictionary keys, aligning type hints with implementation, clarifying path existence checks, and making input types more configurable in BaseClusterParser and RLTimelineVisualizer. Additionally, the generated rl_timeline.html file should be added to .gitignore.
I am having trouble creating individual review comments. Click here to see my feedback.
rl_insight/main.py (32)
The default value for --input-path is a hardcoded path specific to a user's local machine (C:\Users\Tardis\Documents\profile_data\...). This is not portable and will cause issues for other developers or in different environments. It should be changed to a generic, relative path or a path that is expected to exist in a typical development setup, or removed if no sensible default can be provided.
"--input-path", default="./data", help="Raw path of profiling data"
rl_insight/data/data_checker.py (41-46)
The rules attribute is defined as a class attribute, meaning it's shared across all instances of DataChecker. If an instance modifies this dictionary, it will affect all other instances, which is likely unintended. It should be an instance attribute initialized within the __init__ method to ensure each DataChecker instance has its own set of rules.
class DataChecker():
"""Base data class for RL-Insight."""
def __init__(self, type: DataEnum, data: str|dict):
self.type = type
self.data = data
self.rules: dict[DataEnum, List[ValidationRule]] = {
DataEnum.MULTI_JSON: [PathExistsRule()],
DataEnum.SUMMARY_EVENT: [],
}
rl_insight/data/rules.py (52)
The _error_message attribute is defined as a class attribute, making it shared across all instances of PathExistsRule. This means if one instance sets an error message, it will overwrite the message for all other instances. It should be an instance attribute initialized in the __init__ method. Additionally, the type hint str for _error_message conflicts with the error_message property's return type List[str] (line 68).
class PathExistsRule(ValidationRule):
def __init__(self):
self._error_message: List[str] = []
def check(self, data: str|dict|pd.DataFrame) -> bool:
rl_insight/data/data_checker.py (22-26)
Configuring logging globally within a module can lead to unexpected behavior or conflicts if other parts of the application require different logging setups. It's generally best practice to configure logging at the application's entry point or use a more flexible configuration mechanism.
rl_insight/data/data_checker.py (48)
Using type as a parameter name shadows the built-in type() function in Python. This can lead to confusion and potential issues. Consider renaming this parameter to something more descriptive, like data_type.
def __init__(self, data_type: DataEnum, data: str|dict):rl_insight/data/data_checker.py (53)
Accessing self.rules[self.type] directly can raise a KeyError if self.type is not present in the rules dictionary. It's safer to use self.rules.get(self.type, []) to gracefully handle cases where no rules are defined for a specific DataEnum, or explicitly raise a more informative error.
rules = self.rules.get(self.type, [])rl_insight/data/rules.py (53)
The type hint for data includes pd.DataFrame, but the current implementation of the check method only handles str input. If pd.DataFrame is a valid input type for this rule, the logic within the check method needs to be updated to correctly process it. Otherwise, the type hint should be narrowed to str.
rl_insight/data/rules.py (59)
The path.is_dir() check is specific to directories. If the PathExistsRule is intended to validate the existence of any path (file or directory), path.exists() would be more appropriate. If it's strictly for directories, the error message should clearly state that a directory is expected.
if not path.exists():
rl_insight/parser/parser.py (36)
Hardcoding self.input_type = DataEnum.MULTI_JSON in the BaseClusterParser makes the base class less flexible. If different parsers need to handle different input types, this should either be an abstract property that subclasses must implement, or passed in during initialization, rather than being fixed in the base class.
rl_insight/visualizer/visualizer.py (83)
Similar to the BaseClusterParser, hardcoding self.input_type = DataEnum.SUMMARY_EVENT in RLTimelineVisualizer limits its flexibility. If other visualizers or future extensions need to handle different input types, this should be a more dynamic property or configurable.
test/rl_timeline.html (1-7)
This rl_timeline.html file appears to be a generated output from the visualization process. Generated files should generally not be committed to the repository. They can cause unnecessary diffs, bloat the repository size, and lead to merge conflicts. Please add this file to .gitignore.
| return False | ||
| return True | ||
| except Exception as e: | ||
| self._error_message = f"Source path does not exist: {data}" |
There was a problem hiding this comment.
The exception message variable 'e' is unused, recommand to add it to self._error_message
* add datachecker * Delete rl_timeline.html
|
lgtm |
* [data] feat: add base data class framework with validation support (#26) * [data] feat: add base data class framework with validation support Signed-off-by: Debonex <debonexx@gmail.com> * [refactor] move data module to rl_insight package and fix imports Signed-off-by: Debonex <debonexx@gmail.com> * [data] refactor: simplify validation system with class method approach Signed-off-by: Debonex <debonexx@gmail.com> * [data] feat: update data related interfaces and tests Signed-off-by: Debonex <debonexx@gmail.com> --------- Signed-off-by: Debonex <debonexx@gmail.com> * [data] feat: add datachecker (#27) * add datachecker * Delete rl_timeline.html * Unify logging and address other code review comments * update requirement * address code review comments from gemini * adjust ut * pre-commit * pre-commit * format uworkflow yml * Address review comments --------- Signed-off-by: Debonex <debonexx@gmail.com> Co-authored-by: Debonet <37174444+Debonex@users.noreply.github.com>
* [misc] feat: optimize console output (#29) Optimize console output * [data, torch_profile] test: add st of torch and mstx (#23) * add st of torch * delate json * add special_e2e * code check * code check * add special_e2e.yml * mv data and fix bug * bugfix * add st of mstx * Revise inspection comments * change st name * Add data description * add data file * delate st --timeout=300 * delate img.png * revise data_directory --------- Co-authored-by: gcw_fbonFwWl <gcw_fbonFwWl@noreply.gitcode.com> * [data] feat: add DataChecker (#28) * [data] feat: add base data class framework with validation support (#26) * [data] feat: add base data class framework with validation support Signed-off-by: Debonex <debonexx@gmail.com> * [refactor] move data module to rl_insight package and fix imports Signed-off-by: Debonex <debonexx@gmail.com> * [data] refactor: simplify validation system with class method approach Signed-off-by: Debonex <debonexx@gmail.com> * [data] feat: update data related interfaces and tests Signed-off-by: Debonex <debonexx@gmail.com> --------- Signed-off-by: Debonex <debonexx@gmail.com> * [data] feat: add datachecker (#27) * add datachecker * Delete rl_timeline.html * Unify logging and address other code review comments * update requirement * address code review comments from gemini * adjust ut * pre-commit * pre-commit * format uworkflow yml * Address review comments --------- Signed-off-by: Debonex <debonexx@gmail.com> Co-authored-by: Debonet <37174444+Debonex@users.noreply.github.com> * [mstx] fix: do not perform filtering when total_rank is too small (#34) * do not perform filtering when total_rank is too small * Update rl_insight/parser/parser.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * [mstx] fix: skip mstx_preprocessing if necessary (#32) * skip mstx_preprocessing if necessary * Update examples/mstx_exec.sh Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update examples/mstx_exec.sh Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update examples/mstx_exec.sh Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update mstx_preprocessing.py * Update mstx_preprocessing.md --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * [visualizer] feat: optimize the encapsulation and registration of the visualizer (#30) * Optimize the encapsulation and registration of the visualizer * update pr-title check * [data] feat: add data check rule func ParserOutputValidatorRule (#36) * add rule func ParserOutputValidatorRule * fix check error * fix data checker test error * fix start_time_ms error * Fixed review comments and added test cases. * rename docs/data/data_directory.md to docs/data/data_specification.md add empty summary event data test case * fix data directory reference --------- Co-authored-by: zhangning <zhangning42@huawei.com> * [ci] test: add doc url validation check (#43) test: add doc url check in CI Co-authored-by: zhangning <zhangning42@huawei.com> * [doc] chore: add guideline for offlinepipeline (#40) * doc optimization * add guideline * Update main.py * Update architecture_and_guideline.md * [visualizer] fix: delete the remaining visualizer type. (#39) * remove vis_type from visualizer * update ut * [data] feat: add VerlLogData validation rules (#35) * [data] feat: add VERL_LOG validation rules and local check script * fix(data): refine VERL_LOG validation per review - Move VeRL rules to verl_log_rules.py; rename PresentRule to ExistRule - Require single .log file path; share path validation helper - CLI errors to stderr; update tests and data_directory.md * docs(data): use data/verl_data for VeRL log sample paths Made-with: Cursor * chore(data): track VeRL sample logs under data/verl_data (override *.log) Made-with: Cursor * feat(data): require Training Progress in VeRL logs; trim full sample - Add Training Progress: to DEFAULT_REQUIRED_KEYWORDS and docs - Replace good_full_verl.log with good_minimal_verl.log; add bad_* fixtures - Update tests; data spec lists only minimal log for check example Made-with: Cursor * style: ruff-format data rules; Apache header on check_verl_log - Keep shebang first in check_verl_log.py for direct execution Made-with: Cursor * [visualizer] feat: add RL timeline PNG generator (#38) * [visualizer]feat:update generate timeline type of PNG * [visualizer]fix:add ut and code optimization * [visualizer]feat:add ut * [visualizer] fix: clean code and fix rank sorting * fix:update gemini assist * fix:update gemini assist again * fix:update gemini assist * fix:fix gemini assist * fix:update pre-commit * fix: update ut * fix: update ci test again * fix: update ci test again * feat: add kaleido depend * fix: test ci again * fix: test ci again * fix: test ci again * fix: test ci again --------- Co-authored-by: ChenGary13 <chenjiayu31@huawei.com> * [data] feat: add verify rules for MSTX profiling files (#41) * Add validation rules for Mstx JSON files 1、add MstxJsonFileExistsRule 2、add MstxJsonFieldValidRule * Added tests for MstxJsonFileExistsRule and MstxJsonFieldValidRule Added tests for MstxJsonFileExistsRule and MstxJsonFieldValidRule. * Update data_checker.py * split MULTI_JSON to MULTI_JSON_MSTX and MULTI_JSON_TORCH. * Fix bug * modify 'multi_json' to 'multi_json_mstx' * fix 'tmp_path' bug in test case * use pre-commit code consistent --------- Co-authored-by: pqhgitee <pqhgitee@noreply.gitcode.com> * [doc] fix: Update roadmap links in README.md * [data] feat: add verify rules for Torch profiling files (#52) * Add validation rules for Torch Profile files * Update rl_insight/data/rules.py changing this to > 0 Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * [doc] refactor: reorganize documentation structure (#51) * Update data_specification.md * Update data_specification.md * update pipeline docs&mstx_exec * update * update docs * update docs * clean DS_Store * clean * Update index.rst * update * Enhance input/output section with directory structure Add directory structure example for input data in documentation. * Update input/output section in documentation Removed example directory structure for input data. * Update baseclusterparser_interface.md * [parser, data, doc, ci] feat: add nvtx parser function (#50) * add nvtx parser function * Update examples/nvtx_exec.sh Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Apply suggestion from @gemini-code-assist[bot] Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * fix error * resume pre-commit yaml * Apply suggestion from @gemini-code-assist[bot] Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update docs/cluster_analysis.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * add nvtx data and e2e test script * add verify rules for nvtx data * refactor nvtx parser * Update rl_insight/parser/nvtx_parser.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * [visualizer, pipeline] feat: add MoE expert load heatmap visualization (#47) * support moe load visualization with heatmap * standardize gmm_exec.sh * [parser,data] fix: harden gmm parsing, filtering, and output schema * [pipeline,cfg] refactor: normalize gmm cli parameters and config passing * [visualizer] refactor: improve gmm heatmap layout and segment rendering * [doc] docs: update gmm guide, example script and sample heatmap asset * [test,doc] test: add st for gmm_heatmap and document dump data layout * refactor: move GMM CLI groups to parser/visualizer packages for centralized registration * add minimal data example & format code (pre-commit compliant) * fix(types): resolve parser mypy errors for nvtx and shared DataMap keys --------- Co-authored-by: chenjiao.angel <chenjiao.angel@bytedance.com> * [misc] fix: harden parser validation and stabilize cross-platform test behavior (#56) * fix: improve parser robustness, cross-platform path handling, and test stability * docs: refine RL timeline quickstart profiling link text * fix: improve GMM parsing and restore scalable heatmap metadata * fix: restore matplotlib gmm visualizer * fix: restore original gmm visualizer * fix: improve MSTX ordering and harden docs URL validation * fix: accept Path inputs in validators and normalize GMM paths * fix: apply pre-commit cleanup for validator tests * update requirements.txt * fix ut error & update requirements * [pipeline] feat: rl insight support online monitor (#53) rl insight support online monitor * [cfg] refactor: Use omegaconf structured configuration system (#58) * Use omegaconf structured configuration system and migrate CLI * Modular configuration of parameters and reduction of redundancy. * [parser] feat: add memory parser (#54) * [memory] feat: add memory parser * [memory]fix: fix reviews * [memory]fix: fix pre check problems --------- Co-authored-by: mookies1 <zhanghaoyong1@huawei.com> * [pipeline] feat: rl monitor add grafana config file (#60) rl monitor add grafana config file * [pipeline] feat: rl online monitor statetimeline optime (#61) rl online monitor statetimeline optime * [doc] fix: fix pypi display issue and expand readme with more details (#65) * Update README.md and provide more details * remove dead code * Update schema.py * [doc] fix: align quickstart installation instructions with README (#67) Unify installation sections in timeline and GMM heatmap quickstarts to match README: pip install first, then optional source install. * [misc] fix: remove dead code (#71) * remove dead code * Update schema.py --------- Signed-off-by: Debonex <debonexx@gmail.com> Co-authored-by: JIANG-PENGJUN <52533600+756017542@users.noreply.github.com> Co-authored-by: gcw_fbonFwWl <gcw_fbonFwWl@noreply.gitcode.com> Co-authored-by: Debonet <37174444+Debonex@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: tifning <44485561+tifning@users.noreply.github.com> Co-authored-by: zhangning <zhangning42@huawei.com> Co-authored-by: duesdues <55529526+duesdues@users.noreply.github.com> Co-authored-by: Gary-cjy <71553064+Gary-cjy@users.noreply.github.com> Co-authored-by: ChenGary13 <chenjiayu31@huawei.com> Co-authored-by: panqihan <39796558+pqhgit@users.noreply.github.com> Co-authored-by: pqhgitee <pqhgitee@noreply.gitcode.com> Co-authored-by: a550580874 <82751568+a550580874@users.noreply.github.com> Co-authored-by: zhengxiaojun <alwayszxj@gmail.com> Co-authored-by: hswei88 <129183149+hswei88@users.noreply.github.com> Co-authored-by: chenjiao.angel <chenjiao.angel@bytedance.com> Co-authored-by: Zhen <295632982@qq.com> Co-authored-by: TMC <87188729+mengchengTang@users.noreply.github.com> Co-authored-by: Ruowei Zheng <892882856@qq.com> Co-authored-by: Moocharr <1123277477@qq.com> Co-authored-by: mookies1 <zhanghaoyong1@huawei.com> Co-authored-by: zyang6 <zhouyang271@huawei.com>
* [data] feat: add base data class framework with validation support (#26) * [data] feat: add base data class framework with validation support Signed-off-by: Debonex <debonexx@gmail.com> * [refactor] move data module to rl_insight package and fix imports Signed-off-by: Debonex <debonexx@gmail.com> * [data] refactor: simplify validation system with class method approach Signed-off-by: Debonex <debonexx@gmail.com> * [data] feat: update data related interfaces and tests Signed-off-by: Debonex <debonexx@gmail.com> --------- Signed-off-by: Debonex <debonexx@gmail.com> * [data] feat: add datachecker (#27) * add datachecker * Delete rl_timeline.html * Unify logging and address other code review comments * update requirement * address code review comments from gemini * adjust ut * pre-commit * pre-commit * format uworkflow yml * Address review comments --------- Signed-off-by: Debonex <debonexx@gmail.com> Co-authored-by: Debonet <37174444+Debonex@users.noreply.github.com>
* [misc] feat: optimize console output (#29) Optimize console output * [data, torch_profile] test: add st of torch and mstx (#23) * add st of torch * delate json * add special_e2e * code check * code check * add special_e2e.yml * mv data and fix bug * bugfix * add st of mstx * Revise inspection comments * change st name * Add data description * add data file * delate st --timeout=300 * delate img.png * revise data_directory --------- Co-authored-by: gcw_fbonFwWl <gcw_fbonFwWl@noreply.gitcode.com> * [data] feat: add DataChecker (#28) * [data] feat: add base data class framework with validation support (#26) * [data] feat: add base data class framework with validation support Signed-off-by: Debonex <debonexx@gmail.com> * [refactor] move data module to rl_insight package and fix imports Signed-off-by: Debonex <debonexx@gmail.com> * [data] refactor: simplify validation system with class method approach Signed-off-by: Debonex <debonexx@gmail.com> * [data] feat: update data related interfaces and tests Signed-off-by: Debonex <debonexx@gmail.com> --------- Signed-off-by: Debonex <debonexx@gmail.com> * [data] feat: add datachecker (#27) * add datachecker * Delete rl_timeline.html * Unify logging and address other code review comments * update requirement * address code review comments from gemini * adjust ut * pre-commit * pre-commit * format uworkflow yml * Address review comments --------- Signed-off-by: Debonex <debonexx@gmail.com> Co-authored-by: Debonet <37174444+Debonex@users.noreply.github.com> * [mstx] fix: do not perform filtering when total_rank is too small (#34) * do not perform filtering when total_rank is too small * Update rl_insight/parser/parser.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * [mstx] fix: skip mstx_preprocessing if necessary (#32) * skip mstx_preprocessing if necessary * Update examples/mstx_exec.sh Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update examples/mstx_exec.sh Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update examples/mstx_exec.sh Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update mstx_preprocessing.py * Update mstx_preprocessing.md --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * [visualizer] feat: optimize the encapsulation and registration of the visualizer (#30) * Optimize the encapsulation and registration of the visualizer * update pr-title check * [data] feat: add data check rule func ParserOutputValidatorRule (#36) * add rule func ParserOutputValidatorRule * fix check error * fix data checker test error * fix start_time_ms error * Fixed review comments and added test cases. * rename docs/data/data_directory.md to docs/data/data_specification.md add empty summary event data test case * fix data directory reference --------- Co-authored-by: zhangning <zhangning42@huawei.com> * [ci] test: add doc url validation check (#43) test: add doc url check in CI Co-authored-by: zhangning <zhangning42@huawei.com> * [doc] chore: add guideline for offlinepipeline (#40) * doc optimization * add guideline * Update main.py * Update architecture_and_guideline.md * [visualizer] fix: delete the remaining visualizer type. (#39) * remove vis_type from visualizer * update ut * [data] feat: add VerlLogData validation rules (#35) * [data] feat: add VERL_LOG validation rules and local check script * fix(data): refine VERL_LOG validation per review - Move VeRL rules to verl_log_rules.py; rename PresentRule to ExistRule - Require single .log file path; share path validation helper - CLI errors to stderr; update tests and data_directory.md * docs(data): use data/verl_data for VeRL log sample paths Made-with: Cursor * chore(data): track VeRL sample logs under data/verl_data (override *.log) Made-with: Cursor * feat(data): require Training Progress in VeRL logs; trim full sample - Add Training Progress: to DEFAULT_REQUIRED_KEYWORDS and docs - Replace good_full_verl.log with good_minimal_verl.log; add bad_* fixtures - Update tests; data spec lists only minimal log for check example Made-with: Cursor * style: ruff-format data rules; Apache header on check_verl_log - Keep shebang first in check_verl_log.py for direct execution Made-with: Cursor * [visualizer] feat: add RL timeline PNG generator (#38) * [visualizer]feat:update generate timeline type of PNG * [visualizer]fix:add ut and code optimization * [visualizer]feat:add ut * [visualizer] fix: clean code and fix rank sorting * fix:update gemini assist * fix:update gemini assist again * fix:update gemini assist * fix:fix gemini assist * fix:update pre-commit * fix: update ut * fix: update ci test again * fix: update ci test again * feat: add kaleido depend * fix: test ci again * fix: test ci again * fix: test ci again * fix: test ci again --------- Co-authored-by: ChenGary13 <chenjiayu31@huawei.com> * [data] feat: add verify rules for MSTX profiling files (#41) * Add validation rules for Mstx JSON files 1、add MstxJsonFileExistsRule 2、add MstxJsonFieldValidRule * Added tests for MstxJsonFileExistsRule and MstxJsonFieldValidRule Added tests for MstxJsonFileExistsRule and MstxJsonFieldValidRule. * Update data_checker.py * split MULTI_JSON to MULTI_JSON_MSTX and MULTI_JSON_TORCH. * Fix bug * modify 'multi_json' to 'multi_json_mstx' * fix 'tmp_path' bug in test case * use pre-commit code consistent --------- Co-authored-by: pqhgitee <pqhgitee@noreply.gitcode.com> * [doc] fix: Update roadmap links in README.md * [data] feat: add verify rules for Torch profiling files (#52) * Add validation rules for Torch Profile files * Update rl_insight/data/rules.py changing this to > 0 Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * [doc] refactor: reorganize documentation structure (#51) * Update data_specification.md * Update data_specification.md * update pipeline docs&mstx_exec * update * update docs * update docs * clean DS_Store * clean * Update index.rst * update * Enhance input/output section with directory structure Add directory structure example for input data in documentation. * Update input/output section in documentation Removed example directory structure for input data. * Update baseclusterparser_interface.md * [parser, data, doc, ci] feat: add nvtx parser function (#50) * add nvtx parser function * Update examples/nvtx_exec.sh Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Apply suggestion from @gemini-code-assist[bot] Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * fix error * resume pre-commit yaml * Apply suggestion from @gemini-code-assist[bot] Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update docs/cluster_analysis.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * add nvtx data and e2e test script * add verify rules for nvtx data * refactor nvtx parser * Update rl_insight/parser/nvtx_parser.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * [visualizer, pipeline] feat: add MoE expert load heatmap visualization (#47) * support moe load visualization with heatmap * standardize gmm_exec.sh * [parser,data] fix: harden gmm parsing, filtering, and output schema * [pipeline,cfg] refactor: normalize gmm cli parameters and config passing * [visualizer] refactor: improve gmm heatmap layout and segment rendering * [doc] docs: update gmm guide, example script and sample heatmap asset * [test,doc] test: add st for gmm_heatmap and document dump data layout * refactor: move GMM CLI groups to parser/visualizer packages for centralized registration * add minimal data example & format code (pre-commit compliant) * fix(types): resolve parser mypy errors for nvtx and shared DataMap keys --------- Co-authored-by: chenjiao.angel <chenjiao.angel@bytedance.com> * [misc] fix: harden parser validation and stabilize cross-platform test behavior (#56) * fix: improve parser robustness, cross-platform path handling, and test stability * docs: refine RL timeline quickstart profiling link text * fix: improve GMM parsing and restore scalable heatmap metadata * fix: restore matplotlib gmm visualizer * fix: restore original gmm visualizer * fix: improve MSTX ordering and harden docs URL validation * fix: accept Path inputs in validators and normalize GMM paths * fix: apply pre-commit cleanup for validator tests * update requirements.txt * fix ut error & update requirements * [pipeline] feat: rl insight support online monitor (#53) rl insight support online monitor * [cfg] refactor: Use omegaconf structured configuration system (#58) * Use omegaconf structured configuration system and migrate CLI * Modular configuration of parameters and reduction of redundancy. * [parser] feat: add memory parser (#54) * [memory] feat: add memory parser * [memory]fix: fix reviews * [memory]fix: fix pre check problems --------- Co-authored-by: mookies1 <zhanghaoyong1@huawei.com> * [pipeline] feat: rl monitor add grafana config file (#60) rl monitor add grafana config file * [pipeline] feat: rl online monitor statetimeline optime (#61) rl online monitor statetimeline optime * [doc] fix: fix pypi display issue and expand readme with more details (#65) * Update README.md and provide more details * [doc] fix: align quickstart installation instructions with README (#67) Unify installation sections in timeline and GMM heatmap quickstarts to match README: pip install first, then optional source install. * [misc] fix: remove dead code (#71) * remove dead code * Update schema.py * [pipeline] refactor: support server backend (#73) * [pipeline] fix: online monitor bug fix and grafana json update (#80) * optim rl insight * optim env config * update grafana json * remove docker dev guide * refactor1 close rename to finish * refactor2 add client base class * refactor 3 add collector base * refactor 4 move constant to constant.py * refactor 5 move load config to utils * refactor 6 config file path refactor * refactor 7 readme refactor * fix * [BREAKING][pipeline] refactor: rl-insight refactor directory structure (#82) rl-insight refactor directory structure * [env, ci] fix: remove specific versions in requirements (#81) * remove torch 2.7.1 requirement * Update requirements.txt * Update pyproject.toml * [doc] refactor: rl-insight docs fix (#85) rl-insight docs fix * [monitor-server, monitor-config] feat: prometheus config file support add labels (#87) * prometheus config file support add labels * grafana dashborad support seprate replica * gemini review fix * fix dashboard * fix title ci * [doc, deployment] feat: flexible server install (#84) * Keep the manifest binary field name consistent with config. * Add binary_path field in config.yaml, with documented binary discovery fallback logic * Make download URLs configurable * Convert instance methods to static methods * Print the planned download list before downloading, and support offline installation from a local archive directory. * Update server_installation.md * Add guard for --local-archive when the path is not a directory * Remove duplicate _resolve_release calls across plan_install and install * test bugfix * pre-commit * Fix url-check ci * Gemini review * remove approach 2 * Update server_installation.md * Remove the URL template exposure from the config * [doc] feat: readme optim and add demo grafana json (#90) * readme optim * Unify between README and actual files --------- Co-authored-by: Xiaobo Hu <huxiaobo@zju.edu.cn> * [monitor-config] fix: config optim (#92) config optim * [recipe] feat: add memory timeline HTML visualizer with DataChecker and e2e test (#93) * [visualizer] feat: add memory timeline HTML visualizer - Plotly-based interactive Gantt chart with operator grouping - Time-window segmentation for large datasets (max 20 segments) - Chart1 memory trend line + Chart2 operator Gantt synchronized zoom - Segment navigation with smart hint (suggest best segment for range) - Call stack display in detail panel on bar click - Overlap detection: hover and click show all stacked bars per operator - Absolute time display on x-axis tick labels and hover tooltip * [visualizer] refactor: rename MEMORY_DATA to MEMORY_SUMMARY and optimize performance * [memory] feat: add DataChecker rules, e2e test, and update docs for memory visualizer - Add MEMORYKEYS schema, MemoryContentRule, and wire MEMORY_SUMMARY rules - Fix memory_visualizer.py imports (rl_insight.* -> recipe.*) - Add e2e test with sample data (data/recipe/memory_data/) - Rename docs: memory_parser_* -> memory_guide/quickstart - Update all docs for visualizer output, DataChecker, CLI format * [memory] fix: add OmegaConf DictConfig type annotation to MemoryClusterParser init * [recipe] feat: integrate memory analysis pipeline (#97) * [pipeline] fix: add yaml and examples * [pipeline] fix: Generate one HTML per rank * [pipeline] feat: add Ascend Memory data checker * [pipeline] feat: optim memory html * [pipeline] feat: fix review * [pipeline] feat: fix review * Update recipe/visualizer/memory_template.html Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * [pipeline] feat: fix review * Update recipe/visualizer/memory_template.html Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update recipe/visualizer/memory_template.html Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update recipe/visualizer/memory_visualizer.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update recipe/visualizer/memory_visualizer.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * [pipeline] feat: fix review * Update recipe/visualizer/memory_visualizer.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * [pipeline] feat: fix review * [pipeline] feat: fix review * [pipeline] feat: fix review * Update recipe/data/rules.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update recipe/data/rules.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * [pipeline] feat: fix review --------- Co-authored-by: mookies1 <zhanghaoyong1@huawei.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * [BREAKING][monitor-server, monitor-config] feat: rl-insight support server api and supprot ipv6 (#96) * [monitor-config] feat: Json update to support transfer queue monitor (#99) grafana json update support transfer_queu * [monitor-api] fix: trace api optim (#101) trace api optim * [monitor-collector] fix: opentelemetry log optim (#102) opentelemetry log optim * [monitor-config] feat: json update to support verl v1 trainer better (#103) json update * [ci] feat: add st (#100) * add st * pre-commit * refactor test * [BREAKING][monitor-api] refactor: api rename to promethues style (#104) api rename to promethues style * [ci] test: rl-insight monitor add ci (#86) monitor e2e ci * [doc] fix: readme update (#109) * readme update * Update README.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * [ci] test: monitor add ut (#107) monitor add ut * [monitor-config] feat: add verl_tainer_v1_with_sglang_engine (#108) add verl_tainer_v1_with_sglang_engine * [deployment] feat: rl-insight log optim (#110) rl-insight log optim * [monitor-api, doc] feat: rl-insight support hardware (#111) rl-insight support hardware * [monitor-server] fix: ipv6 support and actor isolation (#112) * bugfix for ipv6 support * pre-commit * Update test_prometheus_utils.py * Update test_prometheus_utils.py * job-level isolation, remove the detached lifecycle * pre-commit & ci fix * keep the original try-catch logic, ci update * Update ray_monitor_client.py * fix: catch RayActorError when health check detects dead actor * Update ray_monitor_client.py * test: remove health-check assertions and dead-actor test, no longer applicable * [doc] feat: docs optim (#113) docs optim * [misc] chore: update version to 0.2 (#114) Update pyproject.toml * [doc] fix: docs update (#115) docs update --------- Signed-off-by: Debonex <debonexx@gmail.com> Co-authored-by: JIANG-PENGJUN <52533600+756017542@users.noreply.github.com> Co-authored-by: gcw_fbonFwWl <gcw_fbonFwWl@noreply.gitcode.com> Co-authored-by: Debonet <37174444+Debonex@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: tifning <44485561+tifning@users.noreply.github.com> Co-authored-by: zhangning <zhangning42@huawei.com> Co-authored-by: duesdues <55529526+duesdues@users.noreply.github.com> Co-authored-by: Gary-cjy <71553064+Gary-cjy@users.noreply.github.com> Co-authored-by: ChenGary13 <chenjiayu31@huawei.com> Co-authored-by: panqihan <39796558+pqhgit@users.noreply.github.com> Co-authored-by: pqhgitee <pqhgitee@noreply.gitcode.com> Co-authored-by: a550580874 <82751568+a550580874@users.noreply.github.com> Co-authored-by: zhengxiaojun <alwayszxj@gmail.com> Co-authored-by: hswei88 <129183149+hswei88@users.noreply.github.com> Co-authored-by: chenjiao.angel <chenjiao.angel@bytedance.com> Co-authored-by: Zhen <295632982@qq.com> Co-authored-by: TMC <87188729+mengchengTang@users.noreply.github.com> Co-authored-by: Ruowei Zheng <892882856@qq.com> Co-authored-by: Moocharr <1123277477@qq.com> Co-authored-by: mookies1 <zhanghaoyong1@huawei.com> Co-authored-by: zyang6 <zhouyang271@huawei.com>
What does this PR do?
Checklist Before Starting
[{modules}] {type}: {description}(This will be checked by the CI){modules}includemstx,mvtx,torch_profile,deployment,perf,algo,env,doc,data,cfg,ci,misc,,like[mstx, ci]{type}is infeat,fix,refactor,chore,test[BREAKING]to the beginning of the title.[BREAKING][mstx, torch_profile] feat: support timeline parsingTest
API and Usage Example
# Add code snippet or script demonstrating how to use thisDesign & Code Changes
Checklist Before Submitting
Important
Please check all the following items before requesting a review, otherwise the reviewer might deprioritize this PR for review.
pre-commit install && pre-commit run --all-files --show-diff-on-failure --color=always