Add support adding context instructions to basic block graphs.
- Update the graph builder and its Python bindings to add context instructions to basic block graphs and store context node mask to later be used by models.
- Add tests for the new graph builder functionality.
I have made some newer changes to the way context_node_mask_ is populated. Previously, only nodes having NodeType::kInstruction were ensured to have their corresponding entries in context_node_mask_ set correctly, as only these values mattered for usage in downstream models (and not checking the other values in BasicBlockGraphBuilderTest::MultipleBasicBlocksWithContext was to reflect this).
After this change, this behavior is better defined with context_node_mask_ set to true for non-instruction nodes connected exclusively to context instruction nodes.
Please have a look.
I have made some newer changes to the way
context_node_mask_is populated. Previously, only nodes havingNodeType::kInstructionwere ensured to have their corresponding entries incontext_node_mask_set correctly, as only these values mattered for usage in downstream models (and not checking the other values inBasicBlockGraphBuilderTest::MultipleBasicBlocksWithContextwas to reflect this).After this change, this behavior is better defined with
context_node_mask_set to true for non-instruction nodes connected exclusively to context instruction nodes.Please have a look.
I've added one technical comment, but otherwise this makes sense.