Repository navigation
Commit 068c08e
authored
[QNN] Fix DiT checkpoint loading (#23718)
### Summary
The QNN DiT export test fails while loading
`microsoft/dit-base-finetuned-rvlcdip`: an upstream model-card update
made Transformers reject the existing safetensors conversion, and
requesting a fresh conversion returns HTTP 405 and raises `KeyError:
'event_id'`. See the [failing main
job](https://github.com/pytorch/executorch/actions/runs/38305497935/job/114998525268).
Set `use_safetensors=False` to load the model's published
`pytorch_model.bin` directly, removing the synchronous conversion
dependency from model loading.
### Test plan
With PyTorch `2.13.0+cpu` and CI's pinned Transformers `5.0.0rc1`, the
real checkpoint loads and CPU inference produces finite logits with
shape `(1, 16)`. The loading check can be repeated with:
```bash
DISABLE_SAFETENSORS_CONVERSION=true python - <<'PY'
import torch
from transformers import AutoModelForImageClassification
model = AutoModelForImageClassification.from_pretrained(
"microsoft/dit-base-finetuned-rvlcdip", use_safetensors=False
).eval()
with torch.inference_mode():
logits = model(torch.rand(1, 3, 224, 224)).logits
assert logits.shape == (1, 16)
assert torch.isfinite(logits).all()
print(logits.shape)
PY
```
Also verified that loading succeeds with the default
background-conversion settings when `spawn_conversion` is mocked to
raise the same `KeyError`. `python -m black --check
examples/qualcomm/oss_scripts/dit.py` and `git diff --check` passed.
Full QNN export was not rerun locally.
Authored with AI assistance using OpenAI Codex.
cc @cbilgin @psiddh1 parent dfc4730 commit 068c08e
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
0 commit comments