RichardErkhov commited on
Commit
9d0627c
·
verified ·
1 Parent(s): 6c8b24f

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +203 -0
README.md ADDED
@@ -0,0 +1,203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Quantization made by Richard Erkhov.
2
+
3
+ [Github](https://github.com/RichardErkhov)
4
+
5
+ [Discord](https://discord.gg/pvy7H8DZMG)
6
+
7
+ [Request more models](https://github.com/RichardErkhov/quant_request)
8
+
9
+
10
+ dbrx-instruct - GGUF
11
+ - Model creator: https://huggingface.co/databricks/
12
+ - Original model: https://huggingface.co/databricks/dbrx-instruct/
13
+
14
+
15
+ | Name | Quant method | Size |
16
+ | ---- | ---- | ---- |
17
+ | [dbrx-instruct.Q2_K.gguf](https://huggingface.co/RichardErkhov/databricks_-_dbrx-instruct-gguf/tree/main/) | Q2_K | 44.65GB |
18
+ | [dbrx-instruct.IQ3_XS.gguf](https://huggingface.co/RichardErkhov/databricks_-_dbrx-instruct-gguf/tree/main/) | IQ3_XS | 50.13GB |
19
+ | [dbrx-instruct.IQ3_S.gguf](https://huggingface.co/RichardErkhov/databricks_-_dbrx-instruct-gguf/tree/main/) | IQ3_S | 52.9GB |
20
+ | [dbrx-instruct.Q3_K_S.gguf](https://huggingface.co/RichardErkhov/databricks_-_dbrx-instruct-gguf/tree/main/) | Q3_K_S | 52.9GB |
21
+ | [dbrx-instruct.IQ3_M.gguf](https://huggingface.co/RichardErkhov/databricks_-_dbrx-instruct-gguf/tree/main/) | IQ3_M | 53.99GB |
22
+ | [dbrx-instruct.Q3_K.gguf](https://huggingface.co/RichardErkhov/databricks_-_dbrx-instruct-gguf/tree/main/) | Q3_K | 58.81GB |
23
+ | [dbrx-instruct.Q3_K_M.gguf](https://huggingface.co/RichardErkhov/databricks_-_dbrx-instruct-gguf/tree/main/) | Q3_K_M | 58.81GB |
24
+ | [dbrx-instruct.Q3_K_L.gguf](https://huggingface.co/RichardErkhov/databricks_-_dbrx-instruct-gguf/tree/main/) | Q3_K_L | 63.66GB |
25
+ | [dbrx-instruct.IQ4_XS.gguf](https://huggingface.co/RichardErkhov/databricks_-_dbrx-instruct-gguf/tree/main/) | IQ4_XS | 66.05GB |
26
+ | [dbrx-instruct.Q4_0.gguf](https://huggingface.co/RichardErkhov/databricks_-_dbrx-instruct-gguf/tree/main/) | Q4_0 | 69.1GB |
27
+ | [dbrx-instruct.IQ4_NL.gguf](https://huggingface.co/RichardErkhov/databricks_-_dbrx-instruct-gguf/tree/main/) | IQ4_NL | 69.71GB |
28
+ | [dbrx-instruct.Q4_K_S.gguf](https://huggingface.co/RichardErkhov/databricks_-_dbrx-instruct-gguf/tree/main/) | Q4_K_S | 69.71GB |
29
+ | [dbrx-instruct.Q4_K.gguf](https://huggingface.co/RichardErkhov/databricks_-_dbrx-instruct-gguf/tree/main/) | Q4_K | 74.41GB |
30
+ | [dbrx-instruct.Q4_K_M.gguf](https://huggingface.co/RichardErkhov/databricks_-_dbrx-instruct-gguf/tree/main/) | Q4_K_M | 74.41GB |
31
+ | [dbrx-instruct.Q4_1.gguf](https://huggingface.co/RichardErkhov/databricks_-_dbrx-instruct-gguf/tree/main/) | Q4_1 | 76.72GB |
32
+ | [dbrx-instruct.Q5_0.gguf](https://huggingface.co/RichardErkhov/databricks_-_dbrx-instruct-gguf/tree/main/) | Q5_0 | 84.35GB |
33
+ | [dbrx-instruct.Q5_K_S.gguf](https://huggingface.co/RichardErkhov/databricks_-_dbrx-instruct-gguf/tree/main/) | Q5_K_S | 84.35GB |
34
+ | [dbrx-instruct.Q5_K.gguf](https://huggingface.co/RichardErkhov/databricks_-_dbrx-instruct-gguf/tree/main/) | Q5_K | 87.21GB |
35
+ | [dbrx-instruct.Q5_K_M.gguf](https://huggingface.co/RichardErkhov/databricks_-_dbrx-instruct-gguf/tree/main/) | Q5_K_M | 87.21GB |
36
+ | [dbrx-instruct.Q5_1.gguf](https://huggingface.co/RichardErkhov/databricks_-_dbrx-instruct-gguf/tree/main/) | Q5_1 | 91.97GB |
37
+ | [dbrx-instruct.Q6_K.gguf](https://huggingface.co/RichardErkhov/databricks_-_dbrx-instruct-gguf/tree/main/) | Q6_K | 100.55GB |
38
+ | [dbrx-instruct.Q8_0.gguf](https://huggingface.co/RichardErkhov/databricks_-_dbrx-instruct-gguf/tree/main/) | Q8_0 | 130.23GB |
39
+
40
+
41
+
42
+
43
+ Original model description:
44
+ ---
45
+ extra_gated_heading: You need to share contact information with Databricks to access this model
46
+ extra_gated_prompt: >-
47
+
48
+ ### DBRX Terms of Use
49
+
50
+ Use of DBRX is governed by the [Databricks Open Model License](https://www.databricks.com/legal/open-model-license) and the [Databricks Open Model Acceptable Use Policy](https://www.databricks.com/legal/acceptable-use-policy-open-model).
51
+
52
+ extra_gated_fields:
53
+ First Name: text
54
+ Last Name: text
55
+ Organization: text
56
+ By clicking 'Submit' below, I accept the terms of the license and acknowledge that the information I provide will be collected, stored, processed, and shared in accordance with Databricks' Privacy Notice and I understand I can update my preferences at any time: checkbox
57
+ extra_gated_description: >-
58
+ The information you provide will be collected, stored, processed, and shared in accordance with Databricks [Privacy Notice](https://www.databricks.com/legal/privacynotice).
59
+ extra_gated_button_content: Submit
60
+ inference: false
61
+ license: other
62
+ license_name: databricks-open-model-license
63
+ license_link: https://www.databricks.com/legal/open-model-license
64
+ ---
65
+
66
+ # DBRX Instruct
67
+
68
+ * DBRX Instruct is a mixture-of-experts (MoE) large language model trained from scratch by Databricks. DBRX Instruct specializes in few-turn interactions.
69
+ * We are releasing both DBRX Instruct and DBRX Base, the pretrained base model which underlies it, under [an open license](https://www.databricks.com/legal/open-model-license).
70
+ * This is the repository for DBRX Instruct. DBRX Base can be found [here](https://huggingface.co/databricks/dbrx-base).
71
+ * For full details on the DBRX models, please read our [technical blog post](https://www.databricks.com/blog/introducing-dbrx-new-state-art-open-llm).
72
+
73
+
74
+ ## Model Overview
75
+ DBRX is a [transformer-based](https://www.isattentionallyouneed.com/) decoder-only large language model (LLM) that was trained using next-token prediction.
76
+ It uses a *fine-grained* mixture-of-experts (MoE) architecture with 132B total parameters of which 36B parameters are active on any input.
77
+ It was pre-trained on 12T tokens of text and code data.
78
+ Compared to other open MoE models like Mixtral-8x7B and Grok-1, DBRX is fine-grained, meaning it uses a larger number of smaller experts. DBRX has 16 experts and chooses 4, while Mixtral-8x7B and Grok-1 have 8 experts and choose 2.
79
+ This provides 65x more possible combinations of experts and we found that this improves model quality.
80
+ DBRX uses rotary position encodings (RoPE), gated linear units (GLU), and grouped query attention (GQA).
81
+ It uses a converted version of the GPT-4 tokenizer as defined in the [tiktoken](https://github.com/openai/tiktoken) repository.
82
+ We made these choices based on exhaustive evaluation and scaling experiments.
83
+
84
+ DBRX was pretrained on 12T tokens of carefully curated data and a maximum context length of 32K tokens.
85
+ We estimate that this data is at least 2x better token-for-token than the data we used to pretrain the MPT family of models.
86
+ This new dataset was developed using the full suite of Databricks tools, including Apache Spark™ and Databricks notebooks for data processing, and Unity Catalog for data management and governance.
87
+ We used curriculum learning for pretraining, changing the data mix during training in ways we found to substantially improve model quality.
88
+
89
+ * **Inputs:** DBRX only accepts text-based inputs and accepts a context length of up to 32768 tokens.
90
+ * **Outputs:** DBRX only produces text-based outputs.
91
+ * **Model Architecture:** More detailed information about DBRX Instruct and DBRX Base can be found in our [technical blog post](https://www.databricks.com/blog/introducing-dbrx-new-state-art-open-llm).
92
+ * **License:** [Databricks Open Model License](https://www.databricks.com/legal/open-model-license)
93
+ * **Acceptable Use Policy:** [Databricks Open Model Acceptable Use Policy](https://www.databricks.com/legal/acceptable-use-policy-open-model)
94
+ * **Version:** 1.0
95
+ * **Owner:** Databricks, Inc.
96
+
97
+
98
+ ## Usage
99
+ These are several general ways to use the DBRX models:
100
+ * DBRX Base and DBRX Instruct are available for download on HuggingFace (see our Quickstart guide below). This is the HF repository for DBRX Instruct; DBRX Base can be found [here](https://huggingface.co/databricks/dbrx-base).
101
+ * The DBRX model repository can be found on GitHub [here](https://github.com/databricks/dbrx).
102
+ * DBRX Base and DBRX Instruct are available with [Databricks Foundation Model APIs](https://docs.databricks.com/en/machine-learning/foundation-models/index.html) via both *Pay-per-token* and *Provisioned Throughput* endpoints. These are enterprise-ready deployments.
103
+ * For more information on how to fine-tune using LLM-Foundry, please take a look at our LLM pretraining and fine-tuning [documentation](https://github.com/mosaicml/llm-foundry/blob/main/scripts/train/README.md).
104
+
105
+
106
+ ## Quickstart Guide
107
+ **NOTE: This is DBRX Instruct, and has been instruction finetuned.**
108
+ If you are looking for the base model, please use [DBRX Base](https://huggingface.co/databricks/dbrx-base).
109
+
110
+ Getting started with DBRX models is easy with the `transformers` library. The model requires ~264GB of RAM and the following packages:
111
+
112
+ ```bash
113
+ pip install "transformers>=4.40.0"
114
+ ```
115
+
116
+ If you'd like to speed up download time, you can use the `hf_transfer` package as described by Huggingface [here](https://huggingface.co/docs/huggingface_hub/en/guides/download#faster-downloads).
117
+ ```bash
118
+ pip install hf_transfer
119
+ export HF_HUB_ENABLE_HF_TRANSFER=1
120
+ ```
121
+
122
+ You will need to request access to this repository to download the model. Once this is granted,
123
+ [obtain an access token](https://huggingface.co/docs/hub/en/security-tokens) with `read` permission, and supply the token below.
124
+
125
+
126
+ ### Run the model on multiple GPUs:
127
+ ```python
128
+ from transformers import AutoTokenizer, AutoModelForCausalLM
129
+ import torch
130
+
131
+ tokenizer = AutoTokenizer.from_pretrained("databricks/dbrx-instruct", token="hf_YOUR_TOKEN")
132
+ model = AutoModelForCausalLM.from_pretrained("databricks/dbrx-instruct", device_map="auto", torch_dtype=torch.bfloat16, token="hf_YOUR_TOKEN")
133
+
134
+ input_text = "What does it take to build a great LLM?"
135
+ messages = [{"role": "user", "content": input_text}]
136
+ input_ids = tokenizer.apply_chat_template(messages, return_dict=True, tokenize=True, add_generation_prompt=True, return_tensors="pt").to("cuda")
137
+
138
+ outputs = model.generate(**input_ids, max_new_tokens=200)
139
+ print(tokenizer.decode(outputs[0]))
140
+ ```
141
+ If your GPU system supports [FlashAttention2](https://huggingface.co/docs/transformers/perf_infer_gpu_one#flashattention-2), you can add `attn_implementation=”flash_attention_2”` as a keyword to `AutoModelForCausalLM.from_pretrained()` to achieve faster inference.
142
+
143
+
144
+ ## Limitations and Ethical Considerations
145
+ ### Training Dataset Limitations
146
+ The DBRX models were trained on 12T tokens of text, with a knowledge cutoff date of December 2023.
147
+
148
+ The training mix used for DBRX contains both natural-language and code examples. The vast majority of our training data is in the English language. We did not test DBRX for non-English proficiency. Therefore, DBRX should be considered a generalist model for text-based use in the English language.
149
+
150
+ DBRX does not have multimodal capabilities.
151
+
152
+ ### Associated Risks and Recommendations
153
+ All foundation models are novel technologies that carry various risks, and may output information that is inaccurate, incomplete, biased, or offensive.
154
+ Users should exercise judgment and evaluate such output for accuracy and appropriateness for their desired use case before using or sharing it.
155
+ Databricks recommends [using retrieval augmented generation (RAG)](https://www.databricks.com/glossary/retrieval-augmented-generation-rag) in scenarios where accuracy and fidelity are important.
156
+ We also recommend that anyone using or fine-tuning either DBRX Base or DBRX Instruct perform additional testing around safety in the context of their particular application and domain.
157
+
158
+
159
+ ## Intended Uses
160
+ ### Intended Use Cases
161
+ The DBRX models are open, general-purpose LLMs intended and licensed for both commercial and research applications.
162
+ They can be further fine-tuned for various domain-specific natural language and coding tasks.
163
+ DBRX Instruct can be used as an off-the-shelf model for few-turn question answering related to general English-language and coding tasks.
164
+
165
+ Please review the Associated Risks section above, as well as the [Databricks Open Model License](https://www.databricks.com/legal/open-model-license) and [Databricks Open Model Acceptable Use Policy](https://www.databricks.com/legal/acceptable-use-policy-open-model) for further information about permissible uses of DBRX Base and its derivatives.
166
+
167
+ ### Out-of-Scope Use Cases
168
+ DBRX models are not intended to be used out-of-the-box in non-English languages and do not support native code execution, or other forms of function-calling.
169
+ DBRX models should not be used in any manner that violates applicable laws or regulations or in any other way that is prohibited by the [Databricks Open Model License](https://www.databricks.com/legal/open-model-license) and [Databricks Open Model Acceptable Use Policy](https://www.databricks.com/legal/acceptable-use-policy-open-model).
170
+
171
+
172
+ ## Training Stack
173
+ MoE models are complicated to train, and the training of DBRX Base and DBRX Instruct was heavily supported by Databricks’ infrastructure for data processing and large-scale LLM training (e.g., [Composer](https://github.com/mosaicml/composer), [Streaming](https://github.com/mosaicml/streaming), [Megablocks](https://github.com/stanford-futuredata/megablocks), and [LLM Foundry](https://github.com/mosaicml/llm-foundry)).
174
+
175
+ Composer is our core library for large-scale training.
176
+ It provides an optimized training loop, easy [checkpointing](https://docs.mosaicml.com/projects/composer/en/latest/trainer/checkpointing.html) and [logging](https://docs.mosaicml.com/projects/composer/en/latest/trainer/logging.html#wood-logging),
177
+ [FSDP](https://pytorch.org/docs/stable/fsdp.html)-based [model sharding](https://docs.mosaicml.com/projects/composer/en/latest/notes/distributed_training.html#fullyshardeddataparallel-fsdp),
178
+ convenient [abstractions](https://docs.mosaicml.com/projects/composer/en/latest/trainer/time.html), extreme customizability via [callbacks](https://docs.mosaicml.com/projects/composer/en/latest/trainer/callbacks.html), and more.
179
+
180
+ Streaming enables fast, low cost, and scalable training on large datasets from cloud storage. It handles a variety of challenges around deterministic resumption as node counts change, avoiding redundant downloads across devices, high-quality shuffling at scale, sample-level random access, and speed.
181
+
182
+ Megablocks is a lightweight library for MoE training. Crucially, it supports “dropless MoE,” which avoids inefficient padding and is intended to provide deterministic outputs for a given sequence no matter what other sequences are in the batch.
183
+
184
+ LLM Foundry ties all of these libraries together to create a simple LLM pretraining, fine-tuning, and inference experience.
185
+
186
+ DBRX was trained using proprietary optimized versions of the above open source libraries, along with our [LLM training platform](https://www.databricks.com/product/machine-learning/mosaic-ai-training).
187
+
188
+
189
+ ## Evaluation
190
+ We find that DBRX outperforms established open-source and open-weight base models on the [Databricks Model Gauntlet](https://www.databricks.com/blog/llm-evaluation-for-icl), the [Hugging Face Open LLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard), and HumanEval.
191
+ The Databricks Model Gauntlet measures performance on more than 30 tasks across six categories: world knowledge, common sense reasoning, language understanding, reading comprehension, symbolic problem solving, and programming.
192
+ The Hugging Face Open LLM Leaderboard measures the average of ARC-Challenge, HellaSwag, MMLU, TruthfulQA, Winogrande and GSM8k.
193
+ HumanEval measures coding ability.
194
+
195
+ Full evaluation details can be found in our [technical blog post](https://www.databricks.com/blog/introducing-dbrx-new-state-art-open-llm).
196
+
197
+
198
+ ## Acknowledgements
199
+ The DBRX models were made possible thanks in large part to the open-source community, especially:
200
+ * The [MegaBlocks](https://arxiv.org/abs/2211.15841) library, which established a foundation for our MoE implementation.
201
+ * [PyTorch FSDP](https://arxiv.org/abs/2304.11277), which we built on for distributed training.
202
+
203
+