Skip to content

Qualcomm AI Engine Direct - fix extra argument in static Mimi decoder call - #22586

Open
Anai-Guo wants to merge 1 commit into
pytorch:mainfrom
Anai-Guo:fix/mimi-static-decoder-extra-arg
Open

Qualcomm AI Engine Direct - fix extra argument in static Mimi decoder call#22586
Anai-Guo wants to merge 1 commit into
pytorch:mainfrom
Anai-Guo:fix/mimi-static-decoder-extra-arg

Conversation

@Anai-Guo

@Anai-Guo Anai-Guo commented Sep 7, 2026

Copy link
Copy Markdown

Problem

examples/qualcomm/oss_scripts/moshi/mimi.py defines the static decoder helper with five parameters:

def inference_static_mimi_decoder(
    args,
    qnn_config,
    encoded_results,
    pcm_chunk_size,
    static_decoder_pte_filename,
):

There are two call sites. The --pre_gen_pte branch (line 400) is correct, but the
default compile-and-run branch (line 416) inserts encoded_results_list as a fourth
positional argument:

qnn_decode_res = inference_static_mimi_decoder(
    args,
    qnn_config,
    encoded_results,
    encoded_results_list,   # <-- not a parameter
    pcm_chunk_size,
    static_decoder_pte_filename,
)

so running the script without --compile_only / --pre_gen_pte — the normal path —
fails at decode time with:

TypeError: inference_static_mimi_decoder() takes 5 positional arguments but 6 were given

Why the argument is dropped rather than added as a parameter

encoded_results_list is a newline-joined "input_N_0.raw" listing built in
export_mimi_decoder. It has no consumer:

  • inference_static_mimi_decoder builds its own runner_cmd (--model_path,
    --output_folder_path) with no input-list flag;
  • it pushes with adb.push(inputs=encoded_results), and SimpleADB.push
    (backends/qualcomm/export_utils.py) has signature
    push(self, inputs=None, files=None, backends=None, init_env=True) — no
    input-list parameter;
  • every other QNN OSS script likewise calls adb.push(inputs=inputs).

encoded_results_list is referenced nowhere else in the file, so this PR removes the
stray argument together with the two lines that build the now-unused string. The
encoded_results[index] = encoder_result.to(torch.int32) conversion in the same loop
is kept.

Verification

Signature replay against main (4ce2ec2):

[BEFORE] signature: (args, qnn_config, encoded_results, pcm_chunk_size, static_decoder_pte_filename)
  line 400: 5 args -> OK
  line 416: 6 args -> TypeError: too many positional arguments

[AFTER]  signature: (args, qnn_config, encoded_results, pcm_chunk_size, static_decoder_pte_filename)
  line 398: 5 args -> OK
  line 414: 5 args -> OK

Diff is three deleted lines; no behavior other than the crash changes.

🤖 Generated with Claude Code

`inference_static_mimi_decoder` takes five parameters:

    def inference_static_mimi_decoder(
        args, qnn_config, encoded_results, pcm_chunk_size,
        static_decoder_pte_filename,
    ):

The `--pre_gen_pte` branch calls it correctly, but the default
compile-and-run branch inserts `encoded_results_list` as a fourth
positional argument, so the normal path raises:

    TypeError: inference_static_mimi_decoder() takes 5 positional
    arguments but 6 were given

`encoded_results_list` is a newline-joined "input_N_0.raw" listing that
has no consumer: the decoder builds its own `runner_cmd` and calls
`adb.push(inputs=encoded_results)`, and `SimpleADB.push` has no
input-list parameter. The variable is only ever passed to this one call,
so it and its construction are removed along with the argument.

Signed-off-by: Tai An <antai12232931@outlook.com>
@pytorch-bot

pytorch-bot Bot commented Sep 7, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/22586

Note: Links to docs will display an error until the docs builds have been completed.

⚠️ 20 Awaiting Approval

As of commit 6d35fbb with merge base 4ce2ec2 (image):

AWAITING APPROVAL - The following workflows need approval before CI can run:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 7, 2026
@linux-foundation-easycla

Copy link
Copy Markdown

CLA Not Signed

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant