Skip to content

Commit

Permalink
Revert "Update builtin train/inference entries to accept unknown argu…
Browse files Browse the repository at this point in the history
…ments (#681)"

This reverts commit ca0ed1f.
  • Loading branch information
jalencato committed Dec 15, 2023
1 parent 009ff4f commit a54c829
Show file tree
Hide file tree
Showing 15 changed files with 28 additions and 41 deletions.
3 changes: 1 addition & 2 deletions examples/customized_models/HGT/hgt_nc.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,7 @@ 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)
4 changes: 2 additions & 2 deletions examples/temporal_graph_learning/main_nc.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ def generate_parser():
if __name__ == "__main__":
arg_parser = generate_parser()

# Ignore unknown args to make script more robust to input arguments
args, _ = arg_parser.parse_known_args()
args = arg_parser.parse_args()
print(args)
main(args)


6 changes: 3 additions & 3 deletions python/graphstorm/run/gsgnn_dt/distill_gnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,6 @@ def generate_parser():
if __name__ == '__main__':
arg_parser=generate_parser()

# Ignore unknown args to make script more robust to input arguments
gs_args, _ = arg_parser.parse_known_args()
main(gs_args)
args = arg_parser.parse_args()
print(args)
main(args)
5 changes: 2 additions & 3 deletions python/graphstorm/run/gsgnn_emb/gsgnn_node_emb.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,5 @@ def generate_parser():
if __name__ == '__main__':
arg_parser = generate_parser()

# Ignore unknown args to make script more robust to input arguments
gs_args, _ = arg_parser.parse_known_args()
main(gs_args)
args = arg_parser.parse_args()
main(args)
5 changes: 2 additions & 3 deletions python/graphstorm/run/gsgnn_ep/ep_infer_gnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,5 @@ def generate_parser():
if __name__ == '__main__':
arg_parser=generate_parser()

# Ignore unknown args to make script more robust to input arguments
gs_args, _ = arg_parser.parse_known_args()
main(gs_args)
args = arg_parser.parse_args()
main(args)
5 changes: 2 additions & 3 deletions python/graphstorm/run/gsgnn_ep/ep_infer_lm.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,5 @@ def generate_parser():
if __name__ == '__main__':
arg_parser=generate_parser()

# Ignore unknown args to make script more robust to input arguments
gs_args, _ = arg_parser.parse_known_args()
main(gs_args)
args = arg_parser.parse_args()
main(args)
5 changes: 2 additions & 3 deletions python/graphstorm/run/gsgnn_ep/gsgnn_ep.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,5 @@ def generate_parser():
if __name__ == '__main__':
arg_parser=generate_parser()

# Ignore unknown args to make script more robust to input arguments
gs_args, _ = arg_parser.parse_known_args()
main(gs_args)
args = arg_parser.parse_args()
main(args)
5 changes: 2 additions & 3 deletions python/graphstorm/run/gsgnn_ep/gsgnn_lm_ep.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,5 @@ def generate_parser():
if __name__ == '__main__':
arg_parser=generate_parser()

# Ignore unknown args to make script more robust to input arguments
gs_args, _ = arg_parser.parse_known_args()
main(gs_args)
args = arg_parser.parse_args()
main(args)
5 changes: 2 additions & 3 deletions python/graphstorm/run/gsgnn_lp/gsgnn_lm_lp.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,5 @@ def generate_parser():
if __name__ == '__main__':
arg_parser=generate_parser()

# Ignore unknown args to make script more robust to input arguments
gs_args, _ = arg_parser.parse_known_args()
main(gs_args)
args = arg_parser.parse_args()
main(args)
5 changes: 2 additions & 3 deletions python/graphstorm/run/gsgnn_lp/gsgnn_lp.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,5 @@ def generate_parser():
if __name__ == '__main__':
arg_parser=generate_parser()

# Ignore unknown args to make script more robust to input arguments
gs_args, _ = arg_parser.parse_known_args()
main(gs_args)
args = arg_parser.parse_args()
main(args)
5 changes: 2 additions & 3 deletions python/graphstorm/run/gsgnn_lp/lp_infer_gnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,5 @@ def generate_parser():
if __name__ == '__main__':
arg_parser=generate_parser()

# Ignore unknown args to make script more robust to input arguments
gs_args, _ = arg_parser.parse_known_args()
main(gs_args)
args = arg_parser.parse_args()
main(args)
5 changes: 2 additions & 3 deletions python/graphstorm/run/gsgnn_lp/lp_infer_lm.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,5 @@ def generate_parser():
if __name__ == '__main__':
arg_parser=generate_parser()

# Ignore unknown args to make script more robust to input arguments
gs_args, _ = arg_parser.parse_known_args()
main(gs_args)
args = arg_parser.parse_args()
main(args)
5 changes: 2 additions & 3 deletions python/graphstorm/run/gsgnn_np/gsgnn_np.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,5 @@ def generate_parser():
if __name__ == '__main__':
arg_parser=generate_parser()

# Ignore unknown args to make script more robust to input arguments
gs_args, _ = arg_parser.parse_known_args()
main(gs_args)
args = arg_parser.parse_args()
main(args)
5 changes: 2 additions & 3 deletions python/graphstorm/run/gsgnn_np/np_infer_gnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,5 @@ def generate_parser():
if __name__ == '__main__':
arg_parser=generate_parser()

# Ignore unknown args to make script more robust to input arguments
gs_args, _ = arg_parser.parse_known_args()
main(gs_args)
args = arg_parser.parse_args()
main(args)
1 change: 0 additions & 1 deletion sagemaker/launch/launch_infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ 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])
Expand Down

0 comments on commit a54c829

Please sign in to comment.