test eager and custom allreduce toggles
This commit is contained in:
@@ -29,6 +29,10 @@ flash attention kernel(ixformer / cudnnFlashAttnForward)。
|
||||
关闭选项),原意是防止 profiling OOM。但 _run_sdpa_fallback 已通过 Q-tiling
|
||||
解决了该问题,chunked prefill 反而会把推理路径从 _run_sdpa_fallback 切换到
|
||||
_forward_prefix_pytorch,属于不必要的行为变更,因此一并禁用该自动逻辑。
|
||||
同时解除 EngineArgs.create_*_config 中强制 enforce_eager=True 和
|
||||
disable_custom_all_reduce=True 的硬编码,让 Iluvatar 环境可以实际验证
|
||||
CUDA Graph / custom all-reduce;需要回退时仍可通过命令行显式传
|
||||
--enforce-eager --disable-custom-all-reduce。
|
||||
|
||||
Deploy:
|
||||
python3 modified_scripts/patch_xformers_sdpa_seq.py
|
||||
@@ -91,6 +95,13 @@ _ARG_NEW_BLOCK = """\
|
||||
# handles long-context memory without chunked prefill\
|
||||
"""
|
||||
|
||||
_ARG_FORCE_EAGER_OLD = " enforce_eager=True,"
|
||||
_ARG_FORCE_EAGER_NEW = " enforce_eager=self.enforce_eager,"
|
||||
_ARG_FORCE_ALLREDUCE_OLD = " disable_custom_all_reduce=True,"
|
||||
_ARG_FORCE_ALLREDUCE_NEW = (
|
||||
" disable_custom_all_reduce=self.disable_custom_all_reduce,"
|
||||
)
|
||||
|
||||
FALLBACK_METHOD = '''
|
||||
def _run_sdpa_fallback(
|
||||
self,
|
||||
@@ -275,6 +286,26 @@ def patch_arg_utils(path):
|
||||
else:
|
||||
print(" [warn] target block not found — check arg_utils.py version")
|
||||
|
||||
if _ARG_FORCE_EAGER_NEW in content:
|
||||
print(" [skip] enforce_eager already respects CLI")
|
||||
elif _ARG_FORCE_EAGER_OLD in content:
|
||||
content = content.replace(_ARG_FORCE_EAGER_OLD,
|
||||
_ARG_FORCE_EAGER_NEW, 1)
|
||||
print(" [ok] enforce_eager now respects CLI")
|
||||
changed = True
|
||||
else:
|
||||
print(" [warn] enforce_eager assignment not found")
|
||||
|
||||
if _ARG_FORCE_ALLREDUCE_NEW in content:
|
||||
print(" [skip] custom all-reduce already respects CLI")
|
||||
elif _ARG_FORCE_ALLREDUCE_OLD in content:
|
||||
content = content.replace(_ARG_FORCE_ALLREDUCE_OLD,
|
||||
_ARG_FORCE_ALLREDUCE_NEW, 1)
|
||||
print(" [ok] custom all-reduce now respects CLI")
|
||||
changed = True
|
||||
else:
|
||||
print(" [warn] custom all-reduce assignment not found")
|
||||
|
||||
if changed:
|
||||
with open(path, "w") as f:
|
||||
f.write(content)
|
||||
|
||||
Reference in New Issue
Block a user