Skip to content

users[ith].kwargs index issue #17550

@zzy82518996

Description

@zzy82518996

🐛 Describe the bug

#https://github.com/pytorch/executorch/blob/main/exir/backend/canonical_partitioners/duplicate_constant_node_pass.py#L120

Somehow my program triggers this ERROR:

Traceback (most recent call last):
  File "/prj/corp/airesearch/morpheus/sandiego/chipsets-scratch/users/zhozh/exectorch_ci/executorch/backends/qualcomm/hexnn/examples/2bit_qat/test_2layer_2bit_qat_qwen34b_from_ej.py", line 145, in <module>
  File "/prj/corp/airesearch/morpheus/sandiego/chipsets-scratch/users/zhozh/exectorch_ci/venv/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 120, in decorate_context
    return func(*args, **kwargs)
  File "/prj/corp/airesearch/morpheus/sandiego/chipsets-scratch/users/zhozh/exectorch_ci/executorch/backends/qualcomm/hexnn/tests/llm_libs.py", line 903, in wrapper
    return func(*args, **kwargs)
  File "/prj/corp/airesearch/morpheus/sandiego/chipsets-scratch/users/zhozh/exectorch_ci/executorch/backends/qualcomm/hexnn/examples/2bit_qat/test_2layer_2bit_qat_qwen34b_from_ej.py", line 128, in test_16a4w_1layer_qwen253b_from_ej
    )
  File "/prj/corp/airesearch/morpheus/sandiego/chipsets-scratch/users/zhozh/exectorch_ci/executorch/backends/qualcomm/hexnn/tests/history_tracer/graph_history.py", line 1044, in wrapper
    res = fn(*args, **kwargs)
  File "/prj/corp/airesearch/morpheus/sandiego/chipsets-scratch/users/zhozh/exectorch_ci/executorch/backends/qualcomm/hexnn/tests/test_utils.py", line 896, in ontarget_validation
    final_program = to_backend(
  File "/usr/lib/python3.10/functools.py", line 889, in wrapper
    return dispatch(args[0].__class__)(*args, **kw)
  File "/prj/corp/airesearch/morpheus/sandiego/chipsets-scratch/users/zhozh/exectorch_ci/executorch/exir/backend/backend_api.py", line 741, in _
    _maybe_duplicate_constant_nodes(tagged_exported_program, tag)
  File "/prj/corp/airesearch/morpheus/sandiego/chipsets-scratch/users/zhozh/exectorch_ci/executorch/exir/backend/utils.py", line 244, in _maybe_duplicate_constant_nodes
    duplicate_constant_node(tagged_exported_program, candidate_node)
  File "/prj/corp/airesearch/morpheus/sandiego/chipsets-scratch/users/zhozh/exectorch_ci/executorch/exir/backend/canonical_partitioners/duplicate_constant_node_pass.py", line 111, in duplicate_constant_node
    {
  File "/prj/corp/airesearch/morpheus/sandiego/chipsets-scratch/users/zhozh/exectorch_ci/executorch/exir/backend/canonical_partitioners/duplicate_constant_node_pass.py", line 120, in <setcomp>
    for key, value in users[ith].kwargs
ValueError: too many values to unpack (expected 2)

Is this code should be

for key, value in users[ith].kwargs.items() instead if kwargs is always dictionary ?

Versions

Collecting environment information...
PyTorch version: 2.9.0+cpu
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.5 LTS (x86_64)
GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version: Could not collect
CMake version: version 3.31.6
Libc version: glibc-2.35

Python version: 3.10.12 (main, May 27 2025, 17:12:29) [GCC 11.4.0] (64-bit runtime)
Python platform: Linux-5.15.0-156-generic-x86_64-with-glibc2.35
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
Is XPU available: False
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True
Caching allocator config: N/A

CPU:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 52 bits physical, 57 bits virtual
Byte Order: Little Endian
CPU(s): 384
On-line CPU(s) list: 0-383
Vendor ID: AuthenticAMD
Model name: AMD EPYC 9965 192-Core Processor
CPU family: 26
Model: 17
Thread(s) per core: 2
Core(s) per socket: 192
Socket(s): 1
Stepping: 0
Frequency boost: enabled
CPU max MHz: 2250.0000
CPU min MHz: 1500.0000
BogoMIPS: 4492.79
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 invpcid_single hw_pstate ssbd mba ibrs ibpb stibp ibrs_enhanced vmmcall fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local avx_vnni avx512_bf16 clzero irperf xsaveerptr rdpru wbnoinvd amd_ppin cppc arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq la57 rdpid bus_lock_detect movdiri movdir64b overflow_recov succor smca fsrm avx512_vp2intersect flush_l1d
Virtualization: AMD-V
L1d cache: 9 MiB (192 instances)
L1i cache: 6 MiB (192 instances)
L2 cache: 192 MiB (192 instances)
L3 cache: 384 MiB (12 instances)
NUMA node(s): 1
NUMA node0 CPU(s): 0-383
Vulnerability Gather data sampling: Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Enhanced / Automatic IBRS; IBPB conditional; STIBP always-on; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds: Not affected
Vulnerability Tsa: Not affected
Vulnerability Tsx async abort: Not affected

Versions of relevant libraries:
[pip3] executorch==1.0.0a0+92079e6
[pip3] mypy_extensions==1.1.0
[pip3] numpy==1.26.4
[pip3] nvidia-cublas-cu12==12.8.4.1
[pip3] nvidia-cuda-cupti-cu12==12.8.90
[pip3] nvidia-cuda-nvrtc-cu12==12.8.93
[pip3] nvidia-cuda-runtime-cu12==12.8.90
[pip3] nvidia-cudnn-cu12==9.10.2.21
[pip3] nvidia-cufft-cu12==11.3.3.83
[pip3] nvidia-curand-cu12==10.3.9.90
[pip3] nvidia-cusolver-cu12==11.7.3.90
[pip3] nvidia-cusparse-cu12==12.5.8.93
[pip3] nvidia-cusparselt-cu12==0.7.1
[pip3] nvidia-nccl-cu12==2.27.3
[pip3] nvidia-nvjitlink-cu12==12.8.93
[pip3] nvidia-nvtx-cu12==12.8.90
[pip3] onnx==1.18.0
[pip3] onnx-ir==0.1.10
[pip3] onnxscript==0.5.3
[pip3] pytorch_tokenizers==0.1.0
[pip3] torch==2.9.0+cpu
[pip3] torchao==0.14.0+gitb99904b34
[pip3] torchaudio==2.9.0+cpu
[pip3] torchdata==0.11.0+cpu
[pip3] torchsr==1.0.4
[pip3] torchtune==0.7.0+cpu
[pip3] torchvision==0.24.0+cpu
[pip3] triton==3.4.0
[conda] Could not collect

cc @JacobSzwejbka @angelayi

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: exirIssues related to Export IR and the code under exir/

    Type

    No type

    Projects

    Status

    To triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions