Facing an issue with weird model sizes for *.pte model when compared to corresponding torch script model (*.pt)
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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