Skip to content

增加集体通信对比性能结构化输出#7

Open
ghangz wants to merge 1 commit into
MetaX-MACA:mainfrom
ghangz:mengz/mccl-compare-perf-json
Open

增加集体通信对比性能结构化输出#7
ghangz wants to merge 1 commit into
MetaX-MACA:mainfrom
ghangz:mengz/mccl-compare-perf-json

Conversation

@ghangz

@ghangz ghangz commented Jun 10, 2026

Copy link
Copy Markdown

这次改动补上了集体通信对比性能结构化输出,主要是为了解决集体通信测试与结果整理流程里相关信息不够集中、人工整理成本较高的问题,让日常排查、验证和结果归档更直接。

实现上补充了对应工具或脚本逻辑,补上了对应测试,同时尽量保持现有用法不变,避免影响已有流程。

这一分支已经在沐曦算力环境完成实际验证,相关检查均已通过,现提交合入。

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new Python tool, compare_perf_json.py, along with its corresponding unit tests, to compare two MCCL benchmark JSON files and identify performance regressions. The review feedback points out a potential issue where duplicate record keys in the input JSON files would be silently overwritten due to the use of dictionary comprehensions, and suggests explicitly checking for duplicates and raising an error to ensure data integrity.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +51 to +52
base = {_record_key(record): record for record in _load_records(base_path)}
candidate = {_record_key(record): record for record in _load_records(candidate_path)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

使用字典推导式(Dictionary Comprehension)来加载记录时,如果输入的基准测试 JSON 文件中存在重复的键(Key),后入的记录会默默覆盖先入的记录。这可能会导致静默的数据丢失,从而使对比结果或性能退化(regression)分析不准确。

建议显式地检查是否存在重复的键,并在发现重复时抛出异常,以确保数据的完整性和对比的准确性。

    base: dict[tuple[tuple[str, str], ...], dict[str, Any]] = {}
    for record in _load_records(base_path):
        key = _record_key(record)
        if key in base:
            raise ValueError(f"Duplicate record key found in base: {key}")
        base[key] = record

    candidate: dict[tuple[tuple[str, str], ...], dict[str, Any]] = {}
    for record in _load_records(candidate_path):
        key = _record_key(record)
        if key in candidate:
            raise ValueError(f"Duplicate record key found in candidate: {key}")
        candidate[key] = record

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.

1 participant