Upload README.md with huggingface_hub
Browse files
README.md
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
library_name: pytorch
|
3 |
+
license: apache-2.0
|
4 |
+
tags:
|
5 |
+
- llm
|
6 |
+
- generative_ai
|
7 |
+
- quantized
|
8 |
+
- android
|
9 |
+
pipeline_tag: text-generation
|
10 |
+
|
11 |
+
---
|
12 |
+
|
13 |
+

|
14 |
+
|
15 |
+
# IBM-Granite-v3.1-8B-Instruct: Optimized for Mobile Deployment
|
16 |
+
## State-of-the-art large language model useful on a variety of code understanding and generation tasks
|
17 |
+
|
18 |
+
|
19 |
+
Granite-3.1-8B-Instruct is a 8B parameter long-context instruct model finetuned from Granite-3.1-8B-Base using a combination of open source instruction datasets with permissive license and internally collected synthetic datasets tailored for solving long context problems. This model is developed using a diverse set of techniques with a structured chat format, including supervised finetuning, model alignment using reinforcement learning, and model merging.
|
20 |
+
|
21 |
+
This model is an implementation of IBM-Granite-v3.1-8B-Instruct found [here](https://huggingface.co/ibm-granite/granite-3.1-8b-instruct).
|
22 |
+
|
23 |
+
|
24 |
+
More details on model performance across various devices, can be found [here](https://aihub.qualcomm.com/models/ibm_granite_v3_1_8b_instruct_quantized).
|
25 |
+
|
26 |
+
### Model Details
|
27 |
+
|
28 |
+
- **Model Type:** Text generation
|
29 |
+
- **Model Stats:**
|
30 |
+
- Input sequence length for Prompt Processor: 128
|
31 |
+
- Context length: 4096
|
32 |
+
- Number of parameters: 8B
|
33 |
+
- Precision: w4a16 + w8a16 (few layers)
|
34 |
+
- Num of key-value heads: 8
|
35 |
+
- Information about the model parts: Prompt Processor and Token Generator are split into 5 parts each. Each corresponding Prompt Processor and Token Generator part share weights.
|
36 |
+
- Prompt processor model size: 4.8 GB
|
37 |
+
- Prompt processor input (part1): 128 tokens
|
38 |
+
- Prompt processor output (part1): Embeddings output
|
39 |
+
- Prompt processor input (other parts): 128 tokens + KVCache initialized with pad token
|
40 |
+
- Prompt processor output (other parts): 128 output tokens + KVCache for token generator
|
41 |
+
- Token generator model size: 4.8 GB
|
42 |
+
- Token generator input (part1): 1 token
|
43 |
+
- Token generator output (part1): Embeddings output
|
44 |
+
- Token generator input (other parts): 1 input token + past KVCache
|
45 |
+
- Token generator output (other parts): 1 output token + KVCache for next iteration
|
46 |
+
- Use: Initiate conversation with prompt-processor and then token generator for subsequent iterations.
|
47 |
+
- Supported natural languages: English
|
48 |
+
- Supported programming languages: The Granite code foundation models support 116 programming languages including Python, Javascript, Java, C++, Go, and Rust.
|
49 |
+
- Minimum QNN SDK version required: 2.3
|
50 |
+
- TTFT: Time To First Token is the time it takes to generate the first response token. This is expressed as a range because it varies based on the length of the prompt. The lower bound is for a short prompt (up to 128 tokens, i.e., one iteration of the prompt processor) and the upper bound is for a prompt using the full context length (2048 tokens).
|
51 |
+
- Response Rate: Rate of response generation after the first response token.
|
52 |
+
|
53 |
+
| Model | Device | Chipset | Target Runtime | Response Rate (tokens per second) | Time To First Token (range, seconds)
|
54 |
+
|---|---|---|---|---|---|
|
55 |
+
| IBM-Granite-v3.1-8B-Instruct | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 11.01293 | 0.19679249999999998 - 6.297359999999999 | -- | -- |
|
56 |
+
| IBM-Granite-v3.1-8B-Instruct | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN | 8.01724 | 0.2953902 - 9.4524864 | -- | -- |
|
57 |
+
|
58 |
+
## Deploying IBM Granite 3.1 on-device
|
59 |
+
|
60 |
+
Please follow the [LLM on-device deployment](https://github.com/quic/ai-hub-apps/tree/main/tutorials/llm_on_genie) tutorial.
|
61 |
+
|
62 |
+
|
63 |
+
|
64 |
+
## License
|
65 |
+
* The license for the original implementation of IBM-Granite-v3.1-8B-Instruct can be found
|
66 |
+
[here](https://huggingface.co/datasets/choosealicense/licenses/blob/main/markdown/apache-2.0.md).
|
67 |
+
* The license for the compiled assets for on-device deployment can be found [here](https://huggingface.co/datasets/choosealicense/licenses/blob/main/markdown/apache-2.0.md)
|
68 |
+
|
69 |
+
|
70 |
+
|
71 |
+
## References
|
72 |
+
* [Granite Code Models: A Family of Open Foundation Models for Code Intelligence](https://arxiv.org/abs/2405.04324)
|
73 |
+
* [Source Model Implementation](https://huggingface.co/ibm-granite/granite-3.1-8b-instruct)
|
74 |
+
|
75 |
+
|
76 |
+
|
77 |
+
## Community
|
78 |
+
* Join [our AI Hub Slack community](https://qualcomm-ai-hub.slack.com/join/shared_invite/zt-2d5zsmas3-Sj0Q9TzslueCjS31eXG2UA#/shared-invite/email) to collaborate, post questions and learn more about on-device AI.
|
79 |
+
* For questions or feedback please [reach out to us](mailto:[email protected]).
|
80 |
+
|
81 |
+
## Usage and Limitations
|
82 |
+
|
83 |
+
Model may not be used for or in connection with any of the following applications:
|
84 |
+
|
85 |
+
- Accessing essential private and public services and benefits;
|
86 |
+
- Administration of justice and democratic processes;
|
87 |
+
- Assessing or recognizing the emotional state of a person;
|
88 |
+
- Biometric and biometrics-based systems, including categorization of persons based on sensitive characteristics;
|
89 |
+
- Education and vocational training;
|
90 |
+
- Employment and workers management;
|
91 |
+
- Exploitation of the vulnerabilities of persons resulting in harmful behavior;
|
92 |
+
- General purpose social scoring;
|
93 |
+
- Law enforcement;
|
94 |
+
- Management and operation of critical infrastructure;
|
95 |
+
- Migration, asylum and border control management;
|
96 |
+
- Predictive policing;
|
97 |
+
- Real-time remote biometric identification in public spaces;
|
98 |
+
- Recommender systems of social media platforms;
|
99 |
+
- Scraping of facial images (from the internet or otherwise); and/or
|
100 |
+
- Subliminal manipulation
|