diff --git a/examples/customized_models/HGT/hgt_nc.py b/examples/customized_models/HGT/hgt_nc.py index 7164266def..6da88e6870 100644 --- a/examples/customized_models/HGT/hgt_nc.py +++ b/examples/customized_models/HGT/hgt_nc.py @@ -393,7 +393,8 @@ def main(args): argparser.add_argument("--local_rank", type=int, help="The rank of the trainer. \ For customized models, MUST have this argument!!") - args = argparser.parse_args() + # Ignore unknown args to make script more robust to input arguments + args, _ = argparser.parse_known_args() print(args) main(args) diff --git a/examples/temporal_graph_learning/main_nc.py b/examples/temporal_graph_learning/main_nc.py index cf3f360874..20fe18889b 100644 --- a/examples/temporal_graph_learning/main_nc.py +++ b/examples/temporal_graph_learning/main_nc.py @@ -106,8 +106,8 @@ def generate_parser(): if __name__ == "__main__": arg_parser = generate_parser() - args = arg_parser.parse_args() - print(args) + # Ignore unknown args to make script more robust to input arguments + args, _ = arg_parser.parse_known_args() main(args) diff --git a/python/graphstorm/run/gsgnn_dt/distill_gnn.py b/python/graphstorm/run/gsgnn_dt/distill_gnn.py index 17c9b3becd..556ad9940e 100644 --- a/python/graphstorm/run/gsgnn_dt/distill_gnn.py +++ b/python/graphstorm/run/gsgnn_dt/distill_gnn.py @@ -92,6 +92,6 @@ def generate_parser(): if __name__ == '__main__': arg_parser=generate_parser() - args = arg_parser.parse_args() - print(args) - main(args) + # Ignore unknown args to make script more robust to input arguments + gs_args, _ = arg_parser.parse_known_args() + main(gs_args) diff --git a/python/graphstorm/run/gsgnn_emb/gsgnn_node_emb.py b/python/graphstorm/run/gsgnn_emb/gsgnn_node_emb.py index 4f402600b0..a4d6eee6a3 100644 --- a/python/graphstorm/run/gsgnn_emb/gsgnn_node_emb.py +++ b/python/graphstorm/run/gsgnn_emb/gsgnn_node_emb.py @@ -103,5 +103,6 @@ def generate_parser(): if __name__ == '__main__': arg_parser = generate_parser() - args = arg_parser.parse_args() - main(args) + # Ignore unknown args to make script more robust to input arguments + gs_args, _ = arg_parser.parse_known_args() + main(gs_args) diff --git a/python/graphstorm/run/gsgnn_ep/ep_infer_gnn.py b/python/graphstorm/run/gsgnn_ep/ep_infer_gnn.py index 7ae09cab29..8a6bd6b98b 100644 --- a/python/graphstorm/run/gsgnn_ep/ep_infer_gnn.py +++ b/python/graphstorm/run/gsgnn_ep/ep_infer_gnn.py @@ -99,5 +99,6 @@ def generate_parser(): if __name__ == '__main__': arg_parser=generate_parser() - args = arg_parser.parse_args() - main(args) + # Ignore unknown args to make script more robust to input arguments + gs_args, _ = arg_parser.parse_known_args() + main(gs_args) diff --git a/python/graphstorm/run/gsgnn_ep/ep_infer_lm.py b/python/graphstorm/run/gsgnn_ep/ep_infer_lm.py index 7e43ff18cb..e26d8a8118 100644 --- a/python/graphstorm/run/gsgnn_ep/ep_infer_lm.py +++ b/python/graphstorm/run/gsgnn_ep/ep_infer_lm.py @@ -89,5 +89,6 @@ def generate_parser(): if __name__ == '__main__': arg_parser=generate_parser() - args = arg_parser.parse_args() - main(args) + # Ignore unknown args to make script more robust to input arguments + gs_args, _ = arg_parser.parse_known_args() + main(gs_args) diff --git a/python/graphstorm/run/gsgnn_ep/gsgnn_ep.py b/python/graphstorm/run/gsgnn_ep/gsgnn_ep.py index aedfd5c83b..661c9e14d3 100644 --- a/python/graphstorm/run/gsgnn_ep/gsgnn_ep.py +++ b/python/graphstorm/run/gsgnn_ep/gsgnn_ep.py @@ -171,5 +171,6 @@ def generate_parser(): if __name__ == '__main__': arg_parser=generate_parser() - args = arg_parser.parse_args() - main(args) + # Ignore unknown args to make script more robust to input arguments + gs_args, _ = arg_parser.parse_known_args() + main(gs_args) diff --git a/python/graphstorm/run/gsgnn_ep/gsgnn_lm_ep.py b/python/graphstorm/run/gsgnn_ep/gsgnn_lm_ep.py index 2a85a49011..39c54c995c 100644 --- a/python/graphstorm/run/gsgnn_ep/gsgnn_lm_ep.py +++ b/python/graphstorm/run/gsgnn_ep/gsgnn_lm_ep.py @@ -148,5 +148,6 @@ def generate_parser(): if __name__ == '__main__': arg_parser=generate_parser() - args = arg_parser.parse_args() - main(args) + # Ignore unknown args to make script more robust to input arguments + gs_args, _ = arg_parser.parse_known_args() + main(gs_args) diff --git a/python/graphstorm/run/gsgnn_lp/gsgnn_lm_lp.py b/python/graphstorm/run/gsgnn_lp/gsgnn_lm_lp.py index 143fd58e06..cfd3d5fe3e 100644 --- a/python/graphstorm/run/gsgnn_lp/gsgnn_lm_lp.py +++ b/python/graphstorm/run/gsgnn_lp/gsgnn_lm_lp.py @@ -197,5 +197,6 @@ def generate_parser(): if __name__ == '__main__': arg_parser=generate_parser() - args = arg_parser.parse_args() - main(args) + # Ignore unknown args to make script more robust to input arguments + gs_args, _ = arg_parser.parse_known_args() + main(gs_args) diff --git a/python/graphstorm/run/gsgnn_lp/gsgnn_lp.py b/python/graphstorm/run/gsgnn_lp/gsgnn_lp.py index 92a40dc737..acc0c2fdbc 100644 --- a/python/graphstorm/run/gsgnn_lp/gsgnn_lp.py +++ b/python/graphstorm/run/gsgnn_lp/gsgnn_lp.py @@ -223,5 +223,6 @@ def generate_parser(): if __name__ == '__main__': arg_parser=generate_parser() - args = arg_parser.parse_args() - main(args) + # Ignore unknown args to make script more robust to input arguments + gs_args, _ = arg_parser.parse_known_args() + main(gs_args) diff --git a/python/graphstorm/run/gsgnn_lp/lp_infer_gnn.py b/python/graphstorm/run/gsgnn_lp/lp_infer_gnn.py index 50a2e97acc..0e95a89841 100644 --- a/python/graphstorm/run/gsgnn_lp/lp_infer_gnn.py +++ b/python/graphstorm/run/gsgnn_lp/lp_infer_gnn.py @@ -88,5 +88,6 @@ def generate_parser(): if __name__ == '__main__': arg_parser=generate_parser() - args = arg_parser.parse_args() - main(args) + # Ignore unknown args to make script more robust to input arguments + gs_args, _ = arg_parser.parse_known_args() + main(gs_args) diff --git a/python/graphstorm/run/gsgnn_lp/lp_infer_lm.py b/python/graphstorm/run/gsgnn_lp/lp_infer_lm.py index e196d3fd83..aa7c051b90 100644 --- a/python/graphstorm/run/gsgnn_lp/lp_infer_lm.py +++ b/python/graphstorm/run/gsgnn_lp/lp_infer_lm.py @@ -90,5 +90,6 @@ def generate_parser(): if __name__ == '__main__': arg_parser=generate_parser() - args = arg_parser.parse_args() - main(args) + # Ignore unknown args to make script more robust to input arguments + gs_args, _ = arg_parser.parse_known_args() + main(gs_args) diff --git a/python/graphstorm/run/gsgnn_np/gsgnn_np.py b/python/graphstorm/run/gsgnn_np/gsgnn_np.py index 4306dac1b0..2292f65955 100644 --- a/python/graphstorm/run/gsgnn_np/gsgnn_np.py +++ b/python/graphstorm/run/gsgnn_np/gsgnn_np.py @@ -182,5 +182,6 @@ def generate_parser(): if __name__ == '__main__': arg_parser=generate_parser() - args = arg_parser.parse_args() - main(args) + # Ignore unknown args to make script more robust to input arguments + gs_args, _ = arg_parser.parse_known_args() + main(gs_args) diff --git a/python/graphstorm/run/gsgnn_np/np_infer_gnn.py b/python/graphstorm/run/gsgnn_np/np_infer_gnn.py index 3c58f33a6b..10a84e9108 100644 --- a/python/graphstorm/run/gsgnn_np/np_infer_gnn.py +++ b/python/graphstorm/run/gsgnn_np/np_infer_gnn.py @@ -94,5 +94,6 @@ def generate_parser(): if __name__ == '__main__': arg_parser=generate_parser() - args = arg_parser.parse_args() - main(args) + # Ignore unknown args to make script more robust to input arguments + gs_args, _ = arg_parser.parse_known_args() + main(gs_args) diff --git a/sagemaker/launch/launch_infer.py b/sagemaker/launch/launch_infer.py index 725d23da57..d47e588e51 100644 --- a/sagemaker/launch/launch_infer.py +++ b/sagemaker/launch/launch_infer.py @@ -92,6 +92,7 @@ def run_job(input_args, image, unknownargs): # We must handle cases like # --target-etype query,clicks,asin query,search,asin # --feat-name ntype0:feat0 ntype1:feat1 + # --column-names nid,~id emb,embedding unknow_idx = 0 while unknow_idx < len(unknownargs): print(unknownargs[unknow_idx])