pytorch / pytorch/executorch

Is dynamic weight update / fine-tuning supported in QNN / XNNPACK backends?

Open
#16,123 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

module: training
Dominant language
Python
Stars
5k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
581

Description

šŸš€ The feature, motivation and pitch

I’m working on a research project to fine-tune a model on Android devices. I am exploring using ExecuTorch + QNN or XNNPACK backend for inference acceleration, but need to ensure that the backend can support dynamic modification of weights (i.e., after initialization, allow updating weights / biases, and then run forward again).

What I found

  • In executorch/extension/training/examples/XOR/train.cpp, training code based on executorch is provided, but it does not mention the supported backends.
  • The official XNNPACK backend documentation describes that, during runtime initialization, weights / biases are ā€œpackedā€ (i.e. weight packing) into XNNPACK’s internal data structures, and the original preprocessed blob’s data is freed. This seems to imply that weights become static / immutable from the perspective of the backend’s execute graph.
  • I did not find description in the docs or runtime API of any mechanism to ā€œunlockā€ or ā€œupdateā€ those packed weights at runtime.
  • There is an existing issue (#11355) reporting that even dynamic quantization + XNNPACK + Android may fail to load ā€œforwardā€ method, which suggests that non-static quantization / dynamic behavior is fragile or unsupported.
  • For QNN backend, I saw open / triaged issues about compilation or binary loading, but none that explicitly mention support for runtime weight update.

My questions

  1. Does ExecuTorch (any of its backends: QNN, XNNPACK, Vulkan, etc.) currently support runtime in-place weight updates (i.e. treat model weights as mutable parameters, allow updating them between forward calls, as required in fine-tuning / training / zeroth-order optimization)?
  2. If not supported, is there a recommended workflow / workaround for on-device fine-tuning with ExecuTorch? Or is this explicitly out of scope?
  3. If it’s not currently supported, would the maintainers be open to considering such a feature in future (e.g. a ā€œmutable weightā€ delegate, or mechanism to reload new weights into backend graph)?

Thank you for your time and for developing ExecuTorch — it is a great tool for on-device inference / deployment, and I hope it can support on-device fine-tuning in the future.

Alternatives

No response

Additional context

No response

RFC (Optional)

No response

cc @JacobSzwejbka

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading executorch/extension/training/examples/XOR/train.cpp and the XNNPACK backend documentation, then compare the runtime-weight behavior described there with the QNN questions in this issue. Done means documenting whether any listed backend supports in-place weight updates and, if not, recording a recommended workflow or whether the feature is out of scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
android
Domain
machine-learning, mobile-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.