-
Notifications
You must be signed in to change notification settings - Fork 666
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
add sequantial callback instruction #4503
Conversation
This comment has been minimized.
This comment has been minimized.
哦哦,看到了 441 行的 break 处理了这个顺序依赖关系 |
如果指令序列是 A B C,B 是 sequential 指令,C 应该等待 B 的 callback 执行结束再执行吗 |
oneflow/core/vm/instruction.msg.h
Outdated
@@ -219,6 +221,8 @@ OBJECT_MSG_BEGIN(Instruction); | |||
// links | |||
OBJECT_MSG_DEFINE_LIST_LINK(instruction_link); | |||
OBJECT_MSG_DEFINE_LIST_LINK(pending_instruction_link); | |||
OBJECT_MSG_DEFINE_LIST_LINK(sequantial_infer_instr_link); |
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.
这里有个 typo,sequential
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.
ok
不等待,所以才叫回调,否则应该叫barrier。 |
@@ -72,7 +84,8 @@ void VirtualMachine::FilterAndRunSourceInstructions(TmpPendingInstrMsgList* inst | |||
OBJECT_MSG_LIST_FOR_EACH_PTR(instr_msg_list, instr_msg) { | |||
const auto& instr_type_id = instr_msg->instr_type_id(); | |||
const StreamType& stream_type = instr_type_id.stream_type_id().stream_type(); | |||
if (stream_type.SharingVirtualMachineThread() && IsSourceInstruction(*instr_msg)) { | |||
if (stream_type.SharingVirtualMachineThread() | |||
&& !instr_type_id.instruction_type().IsSequential() && IsSourceInstruction(*instr_msg)) { |
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.
sequential指令基本都是source instruction。但是此处的source instruction执行一定要排除它,否则就是失去了sequential的意义。
…ow into sequantial_instruction
* add sequantial callback instruction * add a test_case for sequential instruction type * refactor RunLogicalInstruction/RunPhysicalInstruction * refactor RunLogicalInstruction/RunPhysicalInstruction Former-commit-id: a6d0307
本pr提供顺序化回调指令。
原本的设计里,由于虚拟机是数据驱动的,指令之间只有简单的数据依赖关系,并没有谁先来谁后来的关系。现在加入了诸如RankSequantialInferCallback/RankSequantialComputeCallback专门用于同步推导和计算。