Laya β ExecuTorch (.pte) for on-device / React Native
ExecuTorch exports of convaiinnovations/laya
(the typed-decisions checkpoint: ModernBERT-large encoder + Laya's from-scratch decision head),
ready to run on-device via the ExecuTorch XNNPACK backend β
e.g. from react-native-executorch.
Laya is a System-1 decision model: you give it a state (JSON/text) plus a typed question
(choice / score / noul) and it returns a calibrated answer in one forward pass β it does not
generate text.
Files
| File | Size | What |
|---|---|---|
laya_xnnpack_int8wo.pte |
603 MB | int8 weight-only quantized, XNNPACK β recommended for mobile (iOS + Android) |
laya_xnnpack.pte |
1.69 GB | fp32, XNNPACK β reference / desktop |
laya_vulkan_int8.pte |
603 MB | int8, Vulkan (Android GPU) β experimental, see BACKENDS.md |
laya_vulkan.pte |
1.69 GB | fp32, Vulkan (Android GPU) β experimental |
*.meta.json |
β | runtime contract (I/O shapes, temperatures, qtype map) |
laya_testcases.json |
β | 4 tokenized test cases + reference answers for verification |
See BACKENDS.md for the per-platform backend matrix (XNNPACK / Vulkan / Core ML) and how to build
the iOS Core ML variant.
Runtime contract (static shapes)
The graph is exported with fixed shapes for mobile:
Inputs (in order):
input_ids[1, 192]int64attention_mask[1, 192]int64marker_pos[1, 12]int64 β token index of each option's[MASK]markermarker_mask[1, 12]bool β which of the 12 option slots are realqtype[1]int64 β0=choice,1=score,2=noul
Outputs:
logits[1, 12]float32 β per-option scores (take the firstk= #real options)act_logits[1, 2]float32 β auxiliary escalate/answer head
Post-processing (see rl_agent_api.py in the base repo): divide the k logits by the
temperature for the (qtype, k) bucket (in the .meta.json), softmax, then:
choice β argmax option; score β Ξ£ iΒ·pα΅’; noul β p[1] = P(true).
Input construction mirrors Laya's build_sequence:
[CLS] "<type> question: <instructions>" [SEP] [MASK] opt0 [MASK] opt1 β¦ [SEP] <state> [SEP]
(tokenizer: the base repo's ModernBERT tokenizer; CLS=50281 SEP=50282 MASK=50284 PAD=50283).
Verification
Device-verified on a physical Android phone (ModernBERT-large int8, XNNPACK CPU): all 4
laya_testcases.json cases reproduced the desktop int8 reference exactly. int8 vs fp32: argmax and
probabilities agree to ~1e-3. Use laya_testcases.json (tokenized inputs + reference answers) to
verify your own integration.
Reproduce the export
See export/export_laya_pte.py in the
laya-for-react-native project: rebuild DecisionModel, load the
typed-decisions weights, torch.export β XNNPACK lower β .pte, with
torchao Int8WeightOnlyConfig for the int8 build. (torch>=2.11, executorch>=1.5.)
License
Apache-2.0, inherited from the base model convaiinnovations/laya.
- Downloads last month
- -
Model tree for ksanjiv05/laya-for-rn-executorch
Base model
convaiinnovations/laya