Dynamo benchmarks direct arg passing doesn't work #126543
Labels
module: ci
Related to continuous integration
module: dynamo
oncall: pt2
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
馃悰 Describe the bug
I wanted to run the hugging face dynamo benchmark (
benchmarks/dynamo/huggingface.py
) multiple times with different arguments directly within Python and noticed that the function signature of the main running scriptdef main(runner, original_dir=None, args=None)
(inbenchmarks/dynamo/common.py
) supports passing in the commandline args as a list of strings. So I did as much using the following code:However, this doesn't actually work and yields an infinite subprocess loop where it keeps running the same model again and again:
The reason for this is that there are various calls in the benchmark code that use
sys.argv
directly instead of theargs
given toargparse
. E.g fromcommon.py
:Notably, there is a workaround which is to keep the
args
andsys.argv
in sync, but it is pretty ugly:I would suggest either replacing the
sys.argv
or updating the function signatures to not allow adding argument lists directly and removing related code.Versions
Collecting environment information...
PyTorch version: 2.3.0+cu121
Is debug build: False
CUDA used to build PyTorch: 12.1
ROCM used to build PyTorch: N/A
OS: Ubuntu 20.04.5 LTS (x86_64)
GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
Clang version: Could not collect
CMake version: version 3.29.2
Libc version: glibc-2.31
Python version: 3.10.14 (main, Apr 8 2024, 18:03:12) [GCC 9.4.0] (64-bit runtime)
Python platform: Linux-5.15.0-102-generic-x86_64-with-glibc2.31
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True
cc @seemethere @malfet @pytorch/pytorch-dev-infra @ezyang @msaroufim @bdhirsh @anijain2305 @chauhang @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng
The text was updated successfully, but these errors were encountered: