pytorch / pytorch/executorch

Facing an issue with weird model sizes for *.pte model when compared to corresponding torch script model (*.pt)

Open
#11,637 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hi,

I have a KWS model that is based on "State space representation" (the model is confidential, so I couldn't give much info).
I have managed to generate a torch script (.pt) model which is around ~200 KB.
Then I tried generating the executorch model (
.pte) by using torch.export.export() and I observed that the generated model size is coming out larger than the *.pt model

More info on model:
My model can accept any input of size (1 * 1 * x), where x should be a multiple of 32.
During export :

- If I try x = 32 for dummy input, *.pte size is ~400 KB !
- If I try x = 64 for dummy input, *.pte size is ~800 KB ! (Why is it doubling with input size?)

And one more weird issue is, my model can have max value of x at 16000 and if I try such value, the torch.export.export() just freezes at that point, it neither proceeds further nor it throws any exception

So, here are my queries that I want to understand :

- Why model size is varying with huge difference for different dummy input shapes?
- Why for larger input shapes, export() not proceeding further?

Can you please help me in gaining some insights on these issues?
(I know the info provided will not point out root cause, but I am looking for any pointers that I should consider so that I can fix them in my model)

cc @JacobSzwejbka @angelayi

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

No source files, tests, or reproducible model are provided. Start with the torch.export.export() calls described in the issue and compare the 32-, 64-, and 16000-length inputs, along with the resulting .pte sizes and export progress. Done would require a reproducible explanation or actionable diagnosis for the input-size-dependent output and the apparent export hang.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
embedded-iot, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.