chakra-old
chakra-old copied to clipboard
[ETFeeder] Resolve deps based on not only data_deps, but also ctrl_deps
Summary
In ETFeederNode, add fields of all_deps, which is a complete set of data_deps and ctrl_deps. Add unreleased_deps to track the parents of a node which is not issued yet. Update deps resolving reference to all_deps instead of data_deps.
Test Plan
Add following function to et_generator
def two_comp_nodes_ctrl_dependent(num_npus: int, runtime: int) -> None:
for npu_id in range(num_npus):
output_filename = f"two_comp_nodes_ctrl_dependent.{npu_id}.et"
with open(output_filename, "wb") as et:
encode_message(et, GlobalMetadata(version="0.0.4"))
parent_node = get_node("COMP_NODE", COMP_NODE)
parent_node.duration_micros = runtime
parent_node.attr.append(ChakraAttr(name="is_cpu_op", bool_val=False))
encode_message(et, parent_node)
child_node = get_node("COMP_NODE", COMP_NODE)
child_node.duration_micros = runtime
child_node.ctrl_deps.append(parent_node.id)
child_node.attr.append(ChakraAttr(name="is_cpu_op", bool_val=False))
encode_message(et, child_node)
register this function in main as follows
def main():
...
two_comp_nodes_ctrl_dependent(args.num _npus, args.default_runtime)
...
Run et_generator and get two_comp_nodes_ctrl_dependent.{npu_id}.et
, then run with astrasim.
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅