-
Notifications
You must be signed in to change notification settings - Fork 270
feat(rocm): add shape-based AITER FMoE tuning #1345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| py_library( | ||
| name = "kernel_tuning", | ||
| srcs = glob([ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P3] kernel_tuning BUILD 的 srcs/data glob 只覆盖一层目录,新增 provider 会静默漏出 runfiles
建议: 改为 Checklist: [6.1] 错误语义:fail-fast/retry/fallback/silent 行为显式;[6.1] 新逻辑有聚焦单测 + 相关集成/smoke 测试 |
||
| "*.py", | ||
| "aiter/*.py", | ||
| ]), | ||
| data = glob([ | ||
| "aiter/configs/*.csv", | ||
| ]), | ||
| deps = [ | ||
| "//rtp_llm:torch", | ||
| ], | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
|
|
||
| py_test( | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] aiter_fmoe_test 未按 ROCm 硬件调度,sha256 与已安装 wheel 校验恒为 skip,且缺少多条 fail-closed 分支覆盖 仓内约定是需要真实 ROCm 依赖的 py_test 带 建议: 拆分目标:纯 Python 逻辑用例(fake distribution、临时 CSV、requirements 版本比对)保持无 tag 在通用 runner 上跑;把依赖真实 aiter 的断言拆到一个带 |
||
| name = "aiter_fmoe_test", | ||
| srcs = ["test/aiter_fmoe_test.py"], | ||
| data = [ | ||
| "@rtp_deps//:requirements_lock_rocm.txt", | ||
| "@rtp_deps//:requirements_rocm.txt", | ||
| ], | ||
| deps = [":kernel_tuning"], | ||
| ) | ||
|
|
||
| py_test( | ||
| name = "registry_test", | ||
| srcs = ["test/registry_test.py"], | ||
| deps = [":kernel_tuning"], | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| from rtp_llm.models_py.kernel_tuning.registry import configure_kernel_tuning | ||
| from rtp_llm.models_py.kernel_tuning.types import KernelTuningStatus | ||
|
|
||
| __all__ = ["KernelTuningStatus", "configure_kernel_tuning"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| from rtp_llm.models_py.kernel_tuning.aiter.fmoe import ( | ||
| AITER_FMOE_GFX942_OVERLAY, | ||
| AiterFmoeWorkloadSignature, | ||
| configure_aiter_fmoe_overlays, | ||
| is_affected_aiter_fmoe_signature, | ||
| require_aiter_fmoe_tuning, | ||
| ) | ||
|
|
||
| __all__ = [ | ||
| "AITER_FMOE_GFX942_OVERLAY", | ||
| "AiterFmoeWorkloadSignature", | ||
| "configure_aiter_fmoe_overlays", | ||
| "is_affected_aiter_fmoe_signature", | ||
| "require_aiter_fmoe_tuning", | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| cu_num,token,model_dim,inter_dim,expert,topk,act_type,dtype,q_dtype_a,q_dtype_w,q_type,use_g1u1,doweight_stage1,block_m,ksplit,us1,kernelName1,err1,us2,kernelName2,err2,us,run_1stage,tflops,bw,_tag | ||
| 80,1,2048,128,256,8,ActivationType.Silu,torch.bfloat16,torch.float8_e4m3fnuz,torch.float8_e4m3fnuz,QuantType.per_Token,1,0,32,0,0.0,_ZN5aiter48fmoe_bf16_pertokenFp8_g1u1_vs_silu_1tg_ps_32x128E,0.0%,0.0,Null,0.0%,0.0,1,0.0,0.0, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] 调优表全部性能与误差列为 0 占位值,调优结论不可追溯且 5 行数据的测量列全为占位值: 建议: 二选一:(1)回填 AITER 调优脚本产出的真实 Checklist: [6.1] PR description 说明动机与设计
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] token 覆盖仅到 16 且只有 2 的幂桶,桶间与桶外 token 的选核语义未记录也未覆盖 本表只提供 token 1/2/4/8/16 五行。但 建议: 明确并在
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] 调优产物的性能与精度列全为 0.0 占位,且无生成来源记录,收益与精度不可复核 5 行数据的 建议: 回填真实 tuning 输出的 Checklist: [6.1] 可观测性:日志/指标/超时可操作、非噪声;[6.1] 回滚路径:风险行为存在运维回滚手段;[6.1] PR description 说明动机与设计
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] overlay 只覆盖 token 精确值 1/2/4/8/16,中间 token 的命中语义无文档也无测试固化 CSV 仅有 token=1、2、4、8、16 五行,fmoe.py:41 的 建议: 二选一并落到可验证形态:若为向上取桶,请在 Checklist: [6.1] 新逻辑有聚焦单测 + 相关集成/smoke 测试;[6.1] 边界 case 覆盖(空、单元素、最大值)
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] 调优产物的性能与精度列全为 0.0 占位,且无生成来源记录,收益与精度不可复核 5 行数据的 建议: 按 stock Checklist: [6.1] PR description 说明动机与设计
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] overlay 命中面比 fail-closed 声明更窄,中间 token 与 EP>1 的回落语义无文档也无测试 两个维度都比 fail-closed 声明更窄。其一, 建议: 在 Checklist: [6.1] 可观测性:日志/指标/超时可操作、非噪声 |
||
| 80,2,2048,128,256,8,ActivationType.Silu,torch.bfloat16,torch.float8_e4m3fnuz,torch.float8_e4m3fnuz,QuantType.per_Token,1,0,32,0,0.0,_ZN5aiter48fmoe_bf16_pertokenFp8_g1u1_vs_silu_1tg_ps_32x128E,0.0%,0.0,Null,0.0%,0.0,1,0.0,0.0, | ||
| 80,4,2048,128,256,8,ActivationType.Silu,torch.bfloat16,torch.float8_e4m3fnuz,torch.float8_e4m3fnuz,QuantType.per_Token,1,0,32,0,0.0,_ZN5aiter48fmoe_bf16_pertokenFp8_g1u1_vs_silu_1tg_ps_32x128E,0.0%,0.0,Null,0.0%,0.0,1,0.0,0.0, | ||
| 80,8,2048,128,256,8,ActivationType.Silu,torch.bfloat16,torch.float8_e4m3fnuz,torch.float8_e4m3fnuz,QuantType.per_Token,1,0,32,0,0.0,_ZN5aiter48fmoe_bf16_pertokenFp8_g1u1_vs_silu_1tg_ps_32x128E,0.0%,0.0,Null,0.0%,0.0,1,0.0,0.0, | ||
| 80,16,2048,128,256,8,ActivationType.Silu,torch.bfloat16,torch.float8_e4m3fnuz,torch.float8_e4m3fnuz,QuantType.per_Token,1,0,32,0,0.0,_ZN5aiter48fmoe_bf16_pertokenFp8_g1u1_vs_silu_1tg_ps_32x128E,0.0%,0.0,Null,0.0%,0.0,1,0.0,0.0, | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,288 @@ | ||
| import csv | ||
| import hashlib | ||
| import importlib.metadata | ||
| import logging | ||
| import os | ||
| from dataclasses import dataclass | ||
| from pathlib import Path | ||
| from typing import Optional | ||
|
|
||
| from rtp_llm.models_py.kernel_tuning.types import KernelTuningStatus | ||
|
|
||
| _LOGGER = logging.getLogger(__name__) | ||
|
|
||
| AITER_FMOE_GFX942_OVERLAY = ( | ||
| "aiter_fmoe_gfx942_cu80_m1_16_h2048_i128_e256_topk8_bf16_fp8pt" | ||
| ) | ||
| _SUPPORTED_AITER_VERSION = "0.1.21.dev80+g987203ba5.d20260825" | ||
| _SUPPORTED_DEFAULT_CONFIG_SHA256 = ( | ||
| "00a7d76ae7c49760b2bb389d9cd38887713878f139dc49ff3b0af5dc65a6039f" | ||
| ) | ||
| _OVERLAY_CONFIG = ( | ||
| Path(__file__).resolve().parent | ||
| / "configs" | ||
| / "gfx942_cu80_fmoe_m1_16_h2048_i128_e256_topk8_bf16_fp8pt.csv" | ||
| ) | ||
| _DISPATCH_KEY_FIELDS = ( | ||
| "cu_num", | ||
| "token", | ||
| "model_dim", | ||
| "inter_dim", | ||
| "expert", | ||
| "topk", | ||
| "act_type", | ||
| "dtype", | ||
| "q_dtype_a", | ||
| "q_dtype_w", | ||
| "q_type", | ||
| "use_g1u1", | ||
| "doweight_stage1", | ||
| ) | ||
| _AFFECTED_TOKEN_BUCKETS = (1, 2, 4, 8, 16) | ||
|
|
||
|
|
||
| @dataclass(frozen=True) | ||
| class AiterFmoeWorkloadSignature: | ||
| """Static portion of the AITER FMoE dispatch key. | ||
|
|
||
| Tensor-parallel, expert-parallel, and model identity are intentionally | ||
| absent. They matter only through the local workload passed to AITER. | ||
| """ | ||
|
|
||
| gfx: str | ||
| cu_num: int | ||
| model_dim: int | ||
| inter_dim: int | ||
| expert: int | ||
| topk: int | ||
| act_type: str | ||
| dtype: str | ||
| q_dtype_a: str | ||
| q_dtype_w: str | ||
| q_type: str | ||
| use_g1u1: int | ||
| doweight_stage1: int | ||
|
|
||
|
|
||
| _AFFECTED_WORKLOAD_SIGNATURES = frozenset( | ||
| { | ||
| AiterFmoeWorkloadSignature( | ||
| gfx="gfx942", | ||
| cu_num=80, | ||
| model_dim=2048, | ||
| inter_dim=128, | ||
| expert=256, | ||
| topk=8, | ||
| act_type="ActivationType.Silu", | ||
| dtype="torch.bfloat16", | ||
| q_dtype_a="torch.float8_e4m3fnuz", | ||
| q_dtype_w="torch.float8_e4m3fnuz", | ||
| q_type="QuantType.per_Token", | ||
| use_g1u1=1, | ||
| doweight_stage1=0, | ||
| ) | ||
| } | ||
| ) | ||
|
|
||
| _CONFIG_STATUS: Optional[KernelTuningStatus] = None | ||
|
|
||
|
|
||
| def is_affected_aiter_fmoe_signature( | ||
| signature: AiterFmoeWorkloadSignature, | ||
| ) -> bool: | ||
| return signature in _AFFECTED_WORKLOAD_SIGNATURES | ||
|
|
||
|
|
||
| def _sha256(path: Path) -> str: | ||
| digest = hashlib.sha256() | ||
| with path.open("rb") as source: | ||
| for chunk in iter(lambda: source.read(1024 * 1024), b""): | ||
| digest.update(chunk) | ||
| return digest.hexdigest() | ||
|
|
||
|
|
||
| def _stock_fmoe_configs(default_config: Path) -> list[Path]: | ||
| model_config_dir = default_config.parent / "model_configs" | ||
| model_configs = sorted( | ||
| path | ||
| for path in model_config_dir.glob("*tuned_fmoe*.csv") | ||
| if path.is_file() and "untuned" not in path.name | ||
| ) | ||
| return [default_config, *model_configs] | ||
|
|
||
|
|
||
| def _dispatch_keys(config: Path) -> set[tuple[str, ...]]: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] stock 与 overlay 两条 CSV 解析路径重复实现,且
建议: 抽出单一的
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] 两条 CSV 解析路径整段重复,且
建议: 抽出
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] 两条 CSV 解析路径整段重复,且 _tag 过滤语义不对称可致误判 dispatch 冲突
建议: 抽出一个共用的 CSV reader 统一两处对 |
||
| with config.open(newline="") as source: | ||
| reader = csv.DictReader(source) | ||
| fieldnames = set(reader.fieldnames or ()) | ||
| missing = set(_DISPATCH_KEY_FIELDS) - fieldnames | ||
| if missing: | ||
| raise ValueError( | ||
| f"{config} is missing AITER FMoE dispatch columns: {sorted(missing)}" | ||
| ) | ||
| return { | ||
| tuple((row.get(field) or "").strip() for field in _DISPATCH_KEY_FIELDS) | ||
| for row in reader | ||
| } | ||
|
|
||
|
|
||
| def _validated_overlay_dispatch_keys(config: Path) -> set[tuple[str, ...]]: | ||
| with config.open(newline="") as source: | ||
| reader = csv.DictReader(source) | ||
| fieldnames = set(reader.fieldnames or ()) | ||
| missing = set(_DISPATCH_KEY_FIELDS) - fieldnames | ||
| if missing: | ||
| raise ValueError( | ||
| f"{config} is missing AITER FMoE dispatch columns: {sorted(missing)}" | ||
| ) | ||
| rows = list(reader) | ||
|
|
||
| tagged_rows = [row for row in rows if (row.get("_tag") or "").strip()] | ||
| if tagged_rows: | ||
| raise ValueError( | ||
| f"{config} has non-empty _tag values; AITER excludes tagged rows from " | ||
| "normal FMoE dispatch" | ||
| ) | ||
|
|
||
| actual_keys = { | ||
| tuple((row.get(field) or "").strip() for field in _DISPATCH_KEY_FIELDS) | ||
| for row in rows | ||
| } | ||
| expected_keys = { | ||
| tuple( | ||
| str(token if field == "token" else getattr(signature, field)) | ||
| for field in _DISPATCH_KEY_FIELDS | ||
| ) | ||
| for signature in _AFFECTED_WORKLOAD_SIGNATURES | ||
| for token in _AFFECTED_TOKEN_BUCKETS | ||
| } | ||
| if actual_keys != expected_keys or len(rows) != len(expected_keys): | ||
| raise ValueError( | ||
| f"{config} dispatch rows do not match the declared affected workload " | ||
| f"signatures and token buckets {_AFFECTED_TOKEN_BUCKETS}" | ||
| ) | ||
| return actual_keys | ||
|
|
||
|
|
||
| def _status( | ||
| applied: bool, reason: str, version: Optional[str] = None | ||
| ) -> KernelTuningStatus: | ||
| return KernelTuningStatus( | ||
| overlay=AITER_FMOE_GFX942_OVERLAY, | ||
| applied=applied, | ||
| reason=reason, | ||
| dependency_version=version, | ||
| ) | ||
|
|
||
|
|
||
| def configure_aiter_fmoe_overlays() -> KernelTuningStatus: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P3] arch 维度只体现在两处函数体外的信息中: 建议: 在 Checklist: [6.1] 分层边界:新概念在正确层级,不泄漏内部;[6.1] 状态不变量:创建/更新/失败/重试/回滚路径有效 |
||
| """Append reviewed RTP dispatch rows before AITER's first FMoE lookup.""" | ||
|
|
||
| global _CONFIG_STATUS | ||
| if _CONFIG_STATUS is not None: | ||
| return _CONFIG_STATUS | ||
|
|
||
| try: | ||
| distribution = importlib.metadata.distribution("aiter") | ||
| except importlib.metadata.PackageNotFoundError: | ||
| _CONFIG_STATUS = _status(False, "aiter is not installed") | ||
| return _CONFIG_STATUS | ||
|
|
||
| version = distribution.version | ||
| if version != _SUPPORTED_AITER_VERSION: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] aiter 版本精确全等匹配叠加加载期硬 raise,无降级与运维逃生通道,且与仓内既有约定相反
建议: 改用与
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] fail-closed 缺少运维逃生开关与 overlay 复核流程,版本门位于 env 分支之前使显式配置也无法兜底 版本不等(fmoe.py:192)、stock CSV sha256 变化(:210)、任一 stock CSV 缺 13 个 dispatch 列或 key 冲突(:229)中任意一条成立即 建议: 增加显式逃生开关(如 |
||
| _CONFIG_STATUS = _status( | ||
| False, | ||
| "unsupported AITER version; review whether the overlay is still needed", | ||
| version, | ||
| ) | ||
| return _CONFIG_STATUS | ||
|
|
||
| default_config = Path( | ||
| distribution.locate_file("aiter/configs/tuned_fmoe.csv") | ||
| ).resolve() | ||
| if not default_config.is_file(): | ||
| _CONFIG_STATUS = _status( | ||
| False, f"AITER default FMoE config is missing: {default_config}", version | ||
| ) | ||
| return _CONFIG_STATUS | ||
|
|
||
| actual_sha256 = _sha256(default_config) | ||
| if actual_sha256 != _SUPPORTED_DEFAULT_CONFIG_SHA256: | ||
| _CONFIG_STATUS = _status( | ||
| False, | ||
| "AITER default FMoE config changed; review the RTP overlay before use " | ||
| f"(expected {_SUPPORTED_DEFAULT_CONFIG_SHA256}, got {actual_sha256})", | ||
| version, | ||
| ) | ||
| return _CONFIG_STATUS | ||
|
|
||
| overlay_config = _OVERLAY_CONFIG.resolve() | ||
| if not overlay_config.is_file(): | ||
| _CONFIG_STATUS = _status( | ||
| False, f"RTP AITER FMoE overlay is missing: {overlay_config}", version | ||
| ) | ||
| return _CONFIG_STATUS | ||
|
|
||
| stock_configs = _stock_fmoe_configs(default_config) | ||
| try: | ||
| overlay_keys = _validated_overlay_dispatch_keys(overlay_config) | ||
| for stock_config in stock_configs: | ||
| duplicate_keys = overlay_keys & _dispatch_keys(stock_config) | ||
| if duplicate_keys: | ||
| _CONFIG_STATUS = _status( | ||
| False, | ||
| "AITER stock FMoE configs now overlap the RTP overlay; review " | ||
| f"and remove or refresh {overlay_config}", | ||
| version, | ||
| ) | ||
| return _CONFIG_STATUS | ||
| except (OSError, ValueError) as error: | ||
| _CONFIG_STATUS = _status( | ||
| False, f"failed to validate AITER FMoE config keys: {error}", version | ||
| ) | ||
| return _CONFIG_STATUS | ||
|
|
||
| existing = os.environ.get("AITER_CONFIG_FMOE") | ||
| if existing: | ||
| existing_paths = { | ||
| str(Path(path).resolve()) for path in existing.split(os.pathsep) if path | ||
| } | ||
| if str(overlay_config) not in existing_paths: | ||
| _CONFIG_STATUS = _status( | ||
| False, | ||
| "AITER_CONFIG_FMOE was explicitly set without the RTP overlay; " | ||
| f"include {overlay_config}", | ||
| version, | ||
| ) | ||
| return _CONFIG_STATUS | ||
| else: | ||
| config_paths = [*stock_configs, overlay_config] | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] 启动期用 glob 重建的列表整体覆写
建议: 优先读取 aiter 自身暴露的默认配置集合再追加 overlay,而不是重建;若确实只能重建,补一条在 pinned 版本下断言「重建集合 ⊇ aiter 默认解析结果」的 ROCm 门控测试,让上游改名/移动由测试而非线上行为暴露。同时把
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] 启动期用 glob 重建的列表整体覆写 registry.py:11 仅以 建议: 优先只做追加而不接管:若 AITER 提供配置查询或追加入口,改用该接口而非路径 glob。若必须覆写,请在 configure 阶段把 Checklist: [6.1] 分层边界:新概念在正确层级,不泄漏内部
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] 启动期用 glob 重建的列表整体覆写 AITER_CONFIG_FMOE,波及进程内所有 gfx942 MoE 负载
建议: 把 env 改写收敛到确实需要的场景:让 provider 注册 key 带上 cu_num,或改为在 Checklist: [6.1] 分层边界:新概念在正确层级,不泄漏内部 |
||
| os.environ["AITER_CONFIG_FMOE"] = os.pathsep.join(map(str, config_paths)) | ||
|
|
||
| _CONFIG_STATUS = _status(True, "RTP AITER FMoE overlay configured", version) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] fmoe.py:260-262 写完 env 即返回 建议: 在成功分支加后置校验:回读 AITER 解析出的 FMoE 配置来源列表并断言包含 overlay 路径,或对受影响探针 shape 断言最终命中的 kernel 名等于 CSV 中声明的 Checklist: [6.1] 状态不变量:创建/更新/失败/重试/回滚路径有效
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] applied=True 只代表环境变量已写入,无法证明 AITER 真正消费了 overlay,兜底调用还发生在 import aiter 之后
建议: 补一道后置校验使「overlay 未真正生效」无法通过守卫,二选一或并用:(1)配置完成后回读 AITER 已加载的 FMoE dispatch 表,确认 overlay 的 5 条 key 在其中才置 |
||
| _LOGGER.info( | ||
| "Configured kernel tuning overlay %s from %s", | ||
| AITER_FMOE_GFX942_OVERLAY, | ||
| overlay_config, | ||
| ) | ||
| return _CONFIG_STATUS | ||
|
|
||
|
|
||
| def require_aiter_fmoe_tuning(signature: AiterFmoeWorkloadSignature) -> None: | ||
| """Fail closed only for a workload with known-bad stock dispatch rows.""" | ||
|
|
||
| if not is_affected_aiter_fmoe_signature(signature): | ||
| _LOGGER.debug( | ||
| "AITER FMoE tuning overlay is not required for workload signature: %s", | ||
| signature, | ||
| ) | ||
| return | ||
| status = configure_aiter_fmoe_overlays() | ||
| if status.applied: | ||
| return | ||
| raise RuntimeError( | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] fail-closed 缺少运维逃生开关,版本与哈希门位于 env 分支之前使显式配置也无法兜底
建议: 增加一个显式逃生开关(例如 |
||
| "The AITER FMoE workload signature " | ||
| f"{signature} for token buckets {_AFFECTED_TOKEN_BUCKETS} requires the " | ||
| f"reviewed one-stage tuning overlay, but it is inactive: {status.reason}. " | ||
| "Revalidate the small-token FMoE kernels and update or remove the overlay." | ||
| ) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P3] kernel_tuning BUILD 的 srcs/data glob 只覆盖一层目录,新增 provider 会静默漏出 runfiles
srcs = glob(["*.py", "aiter/*.py"])(BUILD:3-6)与data = glob(["aiter/configs/*.csv"])(:7-9)都只匹配单层。而 registry.py:11 的_PROVIDERS_BY_ARCH正是本模块声明的扩展点:后续新增 provider 子目录或把 CSV 放进子目录时,文件不会进入 srcs/data,构建仍然成功,只在目标 arch 的运行时以 ImportError 或「RTP AITER FMoE overlay is missing」形式暴露——而后者对受影响签名等价于硬失败。同仓//rtp_llm/models_py:modules等 py_library 已使用modules/**/*.py这类递归 glob。建议: 改为递归 glob(
"**/*.py"、"**/*.csv",必要时排除test/),使新增 provider 目录默认被打包,避免扩展时出现只能在特定 arch 上复现的运行期缺文件问题。Checklist: [6.1] OCP:本地扩展点优先于修改中心逻辑