Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: HG: context * we want to add compound module support for the IR export function * here is the first step, to add test about compound module * and validate the deserialized module can produce the same output as the original module HG: details * graph ``` (Pdb) print(ep.graph) graph(): %p_ebc_embedding_bags_t1_weight : [num_users=0] = placeholder[target=p_ebc_embedding_bags_t1_weight] %p_ebc_embedding_bags_t2_weight : [num_users=0] = placeholder[target=p_ebc_embedding_bags_t2_weight] %p_ebc_embedding_bags_t3_weight : [num_users=0] = placeholder[target=p_ebc_embedding_bags_t3_weight] %p_comp_ebc_embedding_bags_t1_weight : [num_users=0] = placeholder[target=p_comp_ebc_embedding_bags_t1_weight] %p_comp_ebc_embedding_bags_t2_weight : [num_users=0] = placeholder[target=p_comp_ebc_embedding_bags_t2_weight] %p_comp_ebc_embedding_bags_t3_weight : [num_users=0] = placeholder[target=p_comp_ebc_embedding_bags_t3_weight] %p_comp_comp_ebc_embedding_bags_t1_weight : [num_users=0] = placeholder[target=p_comp_comp_ebc_embedding_bags_t1_weight] %p_comp_comp_ebc_embedding_bags_t2_weight : [num_users=0] = placeholder[target=p_comp_comp_ebc_embedding_bags_t2_weight] %p_comp_comp_ebc_embedding_bags_t3_weight : [num_users=0] = placeholder[target=p_comp_comp_ebc_embedding_bags_t3_weight] %b_ebc_ir_metadata : [num_users=0] = placeholder[target=b_ebc_ir_metadata] %b_comp_ebc_ir_metadata : [num_users=0] = placeholder[target=b_comp_ebc_ir_metadata] %b_comp_comp_ebc_ir_metadata : [num_users=0] = placeholder[target=b_comp_comp_ebc_ir_metadata] %features__values : [num_users=3] = placeholder[target=features__values] %features__weights : [num_users=0] = placeholder[target=features__weights] %features__lengths : [num_users=3] = placeholder[target=features__lengths] %features__offsets : [num_users=3] = placeholder[target=features__offsets] %embedding_bag_collection_12 : [num_users=1] = call_function[target=torch.ops.custom.EmbeddingBagCollection_12.default](args = ([%features__values, None, %features__lengths, %features__offsets], 2), kwargs = {}) %getitem_4 : [num_users=1] = call_function[target=operator.getitem](args = (%embedding_bag_collection_12, 0), kwargs = {}) %embedding_bag_collection_13 : [num_users=1] = call_function[target=torch.ops.custom.EmbeddingBagCollection_12.default](args = ([%features__values, None, %features__lengths, %features__offsets], 2), kwargs = {}) %getitem_10 : [num_users=1] = call_function[target=operator.getitem](args = (%embedding_bag_collection_13, 0), kwargs = {}) %embedding_bag_collection_14 : [num_users=1] = call_function[target=torch.ops.custom.EmbeddingBagCollection_12.default](args = ([%features__values, None, %features__lengths, %features__offsets], 2), kwargs = {}) %getitem_16 : [num_users=1] = call_function[target=operator.getitem](args = (%embedding_bag_collection_14, 0), kwargs = {}) return (getitem_4, getitem_10, getitem_16) ``` * tabular ``` (Pdb) ep.graph.print_tabular() opcode name target args kwargs ------------- ---------------------------------------- ---------------------------------------- ------------------------------------------------------------------- -------- placeholder p_ebc_embedding_bags_t1_weight p_ebc_embedding_bags_t1_weight () {} placeholder p_ebc_embedding_bags_t2_weight p_ebc_embedding_bags_t2_weight () {} placeholder p_ebc_embedding_bags_t3_weight p_ebc_embedding_bags_t3_weight () {} placeholder p_comp_ebc_embedding_bags_t1_weight p_comp_ebc_embedding_bags_t1_weight () {} placeholder p_comp_ebc_embedding_bags_t2_weight p_comp_ebc_embedding_bags_t2_weight () {} placeholder p_comp_ebc_embedding_bags_t3_weight p_comp_ebc_embedding_bags_t3_weight () {} placeholder p_comp_comp_ebc_embedding_bags_t1_weight p_comp_comp_ebc_embedding_bags_t1_weight () {} placeholder p_comp_comp_ebc_embedding_bags_t2_weight p_comp_comp_ebc_embedding_bags_t2_weight () {} placeholder p_comp_comp_ebc_embedding_bags_t3_weight p_comp_comp_ebc_embedding_bags_t3_weight () {} placeholder b_ebc_ir_metadata b_ebc_ir_metadata () {} placeholder b_comp_ebc_ir_metadata b_comp_ebc_ir_metadata () {} placeholder b_comp_comp_ebc_ir_metadata b_comp_comp_ebc_ir_metadata () {} placeholder features__values features__values () {} placeholder features__weights features__weights () {} placeholder features__lengths features__lengths () {} placeholder features__offsets features__offsets () {} call_function embedding_bag_collection_12 custom.EmbeddingBagCollection_12.default ([features__values, None, features__lengths, features__offsets], 2) {} call_function getitem_4 <built-in function getitem> (embedding_bag_collection_12, 0) {} call_function embedding_bag_collection_13 custom.EmbeddingBagCollection_12.default ([features__values, None, features__lengths, features__offsets], 2) {} call_function getitem_10 <built-in function getitem> (embedding_bag_collection_13, 0) {} call_function embedding_bag_collection_14 custom.EmbeddingBagCollection_12.default ([features__values, None, features__lengths, features__offsets], 2) {} call_function getitem_16 <built-in function getitem> (embedding_bag_collection_14, 0) {} output output output ((getitem_4, getitem_10, getitem_16),) {} ``` Differential Revision: D58220170
- Loading branch information