Prhub

#51074 [CI] Prune PyTorch Fullgraph Test

原始 PR 作者 mgoin 合并时间 2026-08-06 03:27 文件变更 3 提交数 2 评论 2 代码增减 +25 / -124

执行摘要

精简 PyTorch Fullgraph 测试矩阵与 CI 步骤

PR 标题与提交信息表明意图是裁剪(Prune)Fullgraph 测试。原配置中 smoke test 与 fullgraph 分离导致重复运行,且测试矩阵包含大量低价值组合(GPTQ、w8a8、旧模型)。body 未提供详细说明,但从 diff 看是为了降低 CI 开销并集中维护。

该 PR 属于常规测试维护,值得快速浏览 diff 了解测试裁剪决策;不建议精读。关注点在于合并后的超时风险与覆盖缩减是否可接受。

讨论亮点

PR 无实质审查讨论;claude[bot] 因来自 fork 自动跳过审查,仅提示维护者可触发人工审查。作者 mgoin 触发了 Buildkite CI(#82527)作为验证。

实现拆解

  1. 精简正确性测试矩阵tests/compile/fullgraph/test_basic_correctness.py):删除 GPTQ 量化用例与 BAAI/bge-base-en-v1.5 的 ROCm 跳过用例;将 MoE 模型从 ibm/PowerMoE-3b(tp=2)替换为 ibm-granite/granite-3.0-1b-a400m-instruct(tp=1);将原先按三种编译模式分别与 NONE 配对比较的 inductor 循环重构为一次性比较全部四种模式,compare_all_settings 调用次数从 3 次降为 1 次。
  2. 精简全图测试模型列表tests/compile/fullgraph/test_full_graph.py):从 models_list 删除 Llama-3.2-1B-Instruct、w8a8/w8w8 量化模型和 GPTQ 模型,仅保留 opt-125m、FP8 dynamic 模型及 gptq_marlin/AWQ(按平台支持);FP8 模型由 neuralmagic 的仓库替换为 RedHatAI 的同一模型镜像;由于不再覆盖 int8 模型,移除了 Blackwell 上的 w8a8/w8w8 跳过分支,custom_ops 融合测试的关键字从 ['FP8-dynamic', 'quantized.w8a8'] 缩减为 ['FP8-dynamic']
  3. 合并 CI 步骤.buildkite/test_areas/pytorch.yaml):将“PyTorch Fullgraph Smoke Test”重命名为“PyTorch Fullgraph Test”,key 改为 pytorch-fullgraph-test,命令由排除 test_full_graph.py 改为仅排除 test_full_cudagraph.py,使 test_full_graph.py 纳入统一扫描;删除独立于 h200_18gb 的“PyTorch Fullgraph”步骤,全部用例集中在 h200_35gb(超时 90 分钟)运行。
  4. 配套说明:无新增测试或文档;依赖原有 tests/compile/utils.py 中的 compare_all_settingscreate_new_process_for_each_test 机制。
文件 模块 状态 重要度
tests/compile/fullgraph/test_basic_correctness.py 正确性测试 modified 5.5
tests/compile/fullgraph/test_full_graph.py 全图测试 modified 4.69
.buildkite/test_areas/pytorch.yaml 测试配置 modified 4.73

关键符号

test_compile_correctness models_list test_full_graph test_custom_compile_config

关键源码片段

tests/compile/fullgraph/test_basic_correctness.py test-coverage

核心测试矩阵调整,删除了量化与 embedding 用例,重构编译模式比较逻辑,直接影响正确性测试的覆盖范围与运行效率。

# tests/compile/fullgraph/test_basic_correctness.py(head 版本核心逻辑)
    final_args = [
        *model_args,
        '-pp', str(pp_size),
        '-tp', str(tp_size),
        '-cc.cudagraph_mode=none',
        f'--attention-backend={attn_backend}',
    ]
​
    all_args: list[list[str]] = []
    all_envs: list[dict[str, str] | None] = []
​
    # Test all compilation modes with inductor backend
    for mode in [
        CompilationMode.NONE,
        CompilationMode.STOCK_TORCH_COMPILE,
        CompilationMode.DYNAMO_TRACE_ONCE,
        CompilationMode.VLLM_COMPILE,
    ]:
        all_args.append(final_args + [f'-cc.mode={mode.name}', '-cc.backend=inductor'])
        all_envs.append({})
    # inductor 会更改输出,因此比较时使用 generate_close 方法
    compare_all_settings(
        model,
        all_args,
        all_envs,
        method=method if method != 'generate' else 'generate_close',
        force_v1_runner=True,
    )
​
    all_envs.clear()
    all_args.clear()
​
    # Test all compilation modes with eager backend
    for mode in [
        CompilationMode.NONE,
        CompilationMode.STOCK_TORCH_COMPILE,
        CompilationMode.DYNAMO_TRACE_ONCE,
        CompilationMode.VLLM_COMPILE,
    ]:
        all_args.append(final_args + [f'-cc.mode={mode.name}', '-cc.backend=eager'])
        all_envs.append({})
    compare_all_settings(model, all_args, all_envs, method=method, force_v1_runner=True)

评论区精华

自动化审查被禁用 other

claude[bot] 评论:该 PR 来自 fork,自动审查被禁用,维护者可评论 @claude review 触发一次性审查。

结论:无后续实质讨论,作者直接触发 CI 并合并。 · closed

风险与影响

主要风险:一是测试覆盖缩减可能遗漏量化路径(GPTQ、w8a8)与 Blackwell int8 支持问题;二是合并后的 fullgraph step 在 h200_35gb 上仍设 90 分钟超时,若 test_full_graph.py 用例变多可能超时;三是模型源替换(RedHatAI/Llama-3.2-1B-Instruct-FP8-dynamic)可用性与 license 依赖外部服务。

对用户无直接功能影响;对 CI 系统减少约一个 GPU 测试步骤和运行时长;对开发团队,fullgraph 测试的维护入口从两个 step 变为一个,降低了配置复杂度,但测试覆盖面有所收窄。

测试覆盖缩减 合并 CI 步骤超时风险 外部模型依赖替换

关联 Issue

未识别关联 Issue

当前没有检测到明确关联的 Issue 链接,后续同步到相关引用后会出现在这里。

完整报告

参与讨论