Skip to content

[LLM:Bugfix] Fix QNN export chunk-size and per-task workdir handling#4611

Merged
Qxinyu merged 1 commit into
alibaba:masterfrom
LudovicoYIN:fix/qnn-chunk-size-only
Jul 15, 2026
Merged

[LLM:Bugfix] Fix QNN export chunk-size and per-task workdir handling#4611
Qxinyu merged 1 commit into
alibaba:masterfrom
LudovicoYIN:fix/qnn-chunk-size-only

Conversation

@LudovicoYIN

@LudovicoYIN LudovicoYIN commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Description

This PR contains two small bug fixes in the LLM QNN export path.

1. Honor --chunk_size when generating prefill IO

transformers/llm/export/npu/generate_llm_qnn.py exposed --chunk_size, but convert_llm() always called:

makeIOJson(args, 128, hidden_size, mask_type)

This meant the prefill QNN graph could still be generated against 128-token IO even when --chunk_size 256/512 was requested.

2. Run QNN compile subprocesses inside the per-task workdir

source/backend/qnn/npu_convert.py invoked the compile subprocess without setting cwd=workdir.
For parallel conversions, this could make multiple tasks share the same process working directory assumptions and increase the chance of temporary/output path collisions.

Why this matters

In the MNN QNN offline export path, these issues can make generated artifacts inconsistent with runtime expectations:

  • prefill graph shape may not match the requested chunk size
  • runtime chunk_limits and generated graphs may diverge
  • ppl_eval results can become misleading
  • parallel export jobs are more fragile than they need to be

Module

LLM

Type

  • Feature
  • Bugfix
  • Perf
  • Refact
  • Style
  • Doc
  • Test
  • Chore

Checklist

  • Commit message follows [Module:Type] Description format
  • Code compiles without errors
  • Tested on relevant platform(s)
  • No unrelated format or style changes included

Fixed

#4612

@LudovicoYIN LudovicoYIN changed the title [LLM:Bugfix] Honor --chunk_size when generating QNN prefill IO [LLM:Bugfix] Fix QNN export chunk-size and per-task workdir handling Jul 10, 2026
@Qxinyu
Qxinyu merged commit e1e6111 into alibaba:master Jul 15, 2026
9 checks passed
@LudovicoYIN

Copy link
Copy Markdown
Contributor Author

thanks your review.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants