Skip to content

Commit af553c7

Browse files
msluszniakchmjkb
andauthored
Add glossary of terms (#780)
## Description This PR adds glossary of terms to documentation that explains some key concepts that are frequent in our ecosystem ### Introduces a breaking change? - [ ] Yes - [x] No ### Type of change - [ ] Bug fix (change which fixes an issue) - [ ] New feature (change which adds functionality) - [x] Documentation update (improves or adds clarity to existing documentation) - [ ] Other (chores, tests, code style improvements etc.) ### Tested on - [ ] iOS - [ ] Android ### Testing instructions <!-- Provide step-by-step instructions on how to test your changes. Include setup details if necessary. --> ### Screenshots <!-- Add screenshots here, if applicable --> ### Related issues Closes #210 ### Checklist - [ ] I have performed a self-review of my code - [ ] I have commented my code, particularly in hard-to-understand areas - [x] I have updated the documentation accordingly - [ ] My changes generate no new warnings ### Additional notes <!-- Include any additional information, assumptions, or context that reviewers might need to understand this PR. --> --------- Co-authored-by: Jakub Chmura <92989966+chmjkb@users.noreply.github.com>
1 parent 3b379f1 commit af553c7

2 files changed

Lines changed: 60 additions & 0 deletions

File tree

.cspell-wordlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,4 @@ ocurred
9898
libfbjni
9999
libc
100100
gradlew
101+
TTFT
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Glossary of Terms
2+
3+
This glossary defines key concepts used throughout the React Native ExecuTorch ecosystem, covering high-level machine learning terms and library-specific components.
4+
5+
## Backend
6+
7+
The execution engine responsible for running the actual computations of a model on specific hardware.
8+
9+
- **XNNPACK:** A highly optimized library for floating-point neural network inference on ARM, x86, and WebAssembly. It is the default CPU backend for ExecuTorch.
10+
11+
- **Core ML:** Apple's framework for optimizing and running machine learning models on iOS, macOS, and iPadOS devices. Using the Core ML backend allows ExecuTorch to delegate operations to the Apple Neural Engine (ANE) for significantly faster and more energy-efficient inference.
12+
13+
## Forward Function
14+
15+
The primary method of a PyTorch module (usually `forward()`) that defines the computation performed at every call. In the context of ExecuTorch, this is the logic that gets exported and compiled. When you run inference in React Native, you are essentially invoking this compiled forward function with new inputs.
16+
17+
## Inference
18+
19+
The process of using a trained machine learning model to make predictions or generate outputs for given input data.
20+
21+
## Out-of-the-Box Support
22+
23+
Refers to features, models, or architectures that work immediately with React Native ExecuTorch without requiring custom compilation, manual kernel registration, or complex configuration. For example, standard Llama architectures have out-of-the-box support, meaning you can download the `.pte` file and run it instantly.
24+
25+
## Prefill
26+
27+
The initial phase of generating text with an LLM (Large Language Model) where the model processes the entire input prompt (context) at once.
28+
29+
- **Why it matters:** This step is computationally intensive because the model must "understand" all provided tokens simultaneously.
30+
31+
- **Performance Metric:** "Time to First Token" (TTFT) usually measures the speed of the prefill phase.
32+
33+
## Quantization
34+
35+
A technique to reduce the size of a model and speed up inference by representing weights and activations with lower-precision data types (e.g., converting 32-bit floating-point numbers to 8-bit integers).
36+
37+
- **Benefits:** Drastically lowers memory usage (RAM) and saves battery life on mobile devices.
38+
39+
- **Trade-off:** Slight reduction in model accuracy, though often negligible for deployment.
40+
41+
## Tensor
42+
43+
The fundamental data structure in PyTorch and ExecuTorch. A tensor is a multi-dimensional array (like a matrix) that holds the inputs, weights, and outputs of a model.
44+
45+
- **Example:** An image might be represented as a tensor of shape `[3, 224, 224]` (3 color channels, 224 pixels high, 224 pixels wide).
46+
47+
## Token
48+
49+
The basic unit of text that an LLM reads and generates. A token can be a word, part of a word, or even a single character.
50+
51+
- **Rule of thumb:** 1,000 tokens is roughly equivalent to 750 words in English.
52+
53+
- **Context:** Models have a "Context Window" limit (e.g., 2048 tokens), which is the maximum number of tokens they can remember from the conversation history.
54+
55+
## Tokenization
56+
57+
The process of converting raw text (strings) into a sequence of numerical IDs (tokens) that the model can understand.
58+
59+
- **TokenizerModule (Component):** In React Native ExecuTorch, the `Tokenizer` is a utility class that handles encoding text into tensors and decoding output tensors back into readable text strings.

0 commit comments

Comments
 (0)