@wetron/executorch
v0.0.35
Published
ExecuTorch model parser - extracts graph structure from .pte flatbuffer files
Downloads
647
Maintainers
Readme
@wetron/executorch
ExecuTorch model parser for wetron. Reads .pte FlatBuffers files and returns a ModelGraph IR. Graph structure only - no weight tensors are deserialized.
Install
pnpm add @wetron/executorchIncluded automatically when you install @wetron/core or @wetron/react.
API
import { parseExecutorch } from "@wetron/executorch";
const bytes = new Uint8Array(await file.arrayBuffer());
const graph = parseExecutorch(bytes); // synchronousThrows ParseError from @wetron/common/ir on malformed input or missing ET12 identifier.
What gets parsed
- First
ExecutionPlanfrom the rootProgramtable - Operator list -> op type strings
EValuetensor entries -> shapes and dtypesKernelCallinstructions -> operator calls
dtype mapping
| ExecuTorch enum | dtype |
| --------------- | --------- |
| 0 | uint8 |
| 1 | int8 |
| 2 | int16 |
| 3 | int32 |
| 4 | int64 |
| 5 | float16 |
| 6 | float32 |
| 7 | float64 |
| 11 | bool |
Notes
- Only the first execution plan is parsed.
ModelGraph.initializersis always empty.- Non-fatal per-instruction errors are attached as
warnings.
