You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
new_exe = _StandaloneExecutor(place, plan, scope)
File "/workspace/env3.8/lib/python3.8/site-packages/paddle/fluid/executor.py", line 673, in __init__
self._new_exe = self._create_new_executor()
File "/workspace/env3.8/lib/python3.8/site-packages/paddle/fluid/executor.py", line 697, in _create_new_executor
new_exe = core.StandaloneExecutor(self._place, self._plan, self._scope)
RuntimeError: Error occured at: /workspace/paddle-fork/paddle/fluid/ir_adaptor/translator/op_translator.cc:307 :
Op mul should have corresponding OpInfo pd.matmul_with_flatten
对应的报错代码在 op_translator.cc:307 :
ir::OpInfo OpTranscriber::LoopkUpOpInfo(ir::IrContext* ctx,
const OpDesc& op_desc) {
std::string target_op_name =
kTargetDialectPrefix + OpNameCompatibleMapping(op_desc.Type());
if (IsInplace(op_desc) && *target_op_name.rbegin() != '_') {
target_op_name += "_";
}
VLOG(6) << "[op name normalizing]: " << op_desc.Type() << " to "
<< target_op_name;
auto op_info = ctx->GetRegisteredOpInfo(target_op_name);
if (!op_info) {
IR_THROW("Op %d should have corresponding OpInfo %d",
op_desc.Type(),
target_op_name);
}
return op_info;
}
一、需求描述
为了兼容支持旧的 Program 与新 IR Dialect 之间的用户模型,框架在
op_translator.cc
添加了OpTranscriber
组件,来支持OpDesc → New IR Op 的映射转换。在旧的 Program 体系下,有 mul 算子,已经被标记为「废弃状态」,其功能可以通过 matmul 算子来替换。但目前在
op_compat.yaml
中,是将其映射到matmul_with_flatten
上的:这导致在执行框架部分单测时,会在「转换」模块报错,比如在
test/legacy_test
目录下执行:FLAGS_enable_new_ir_in_executor=1 python test_mul_op.py
会报如下错误:对应的报错代码在
op_translator.cc:307
:二、 一些思路
可以像
op_translator.cc
里的类似TrilAndTriuOpTranscriber
其他子类一样,派生一个MulOpTranscriber
,来单独处理mul→matmul 的映射,也需要处理MulGradOpTranscriber
,重写LoopkUpOpInfo
等方法。三、 验证修复
FLAGS_enable_new_ir_in_executor=1 python test_mul_op.py
执行成功The text was updated successfully, but these errors were encountered: