/ Модель

Характеристики

Контекст
8 192 токена
Размер весов
59,9 ГБ
Лицензия
Apache 2.0
Архитектура
mpt · dense
Опубликована
26 июн 2023

mpt-30b-peft-compatible

Генерация текстаТекст → текст3 профессии

Базовая англоязычная модель MPT-30B с поддержкой PEFT/QLoRA для генерации текста и кода и дальнейшего дообучения.

210скачиваний за 30 дней8лайковвеса обновлены27 июн 2023

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

eluzhnica/mpt-30b-peft-compatible — версия базовой языковой модели MPT-30B от MosaicML, в которой добавлена совместимость с дообучением через PEFT, проверенная автором на QLoRA. Веса не изменены и совпадают с оригинальной MPT-30B; сама исходная модель — плотный декодерный трансформер с 29,95 млрд параметров, обученный MosaicML с нуля на 1 трлн токенов английского текста и кода.

Модель предназначена для генерации текста и кода, а также для использования как основы для дальнейшего дообучения. Она поддерживает контекст до 8 тыс. токенов; архитектура использует ALiBi и FlashAttention для обработки длинных последовательностей и эффективного обучения и инференса. Репозиторий распространяется по лицензии Apache-2.0, а для загрузки через Transformers требуется trust_remote_code=True.

Это базовая, не настроенная на инструкции модель: она может выдавать фактически неверные, предвзятые или оскорбительные ответы и не предназначена для прямого использования в диалогах с пользователями без дообучения и защитных механизмов. Разработчик репозитория отмечает, что проверял работу PEFT/QLoRA, но не проводил полного аудита интеграции со стеком Hugging Face.

Сценарии применения

  • генерация продолжения англоязычного текста
  • генерация фрагментов кода
  • дообучение базовой модели с помощью QLoRA
  • эксперименты с PEFT для больших языковых моделей
  • обработка длинных текстовых контекстов до 8 тыс. токенов

Ограничения

Модель не настроена на выполнение инструкций и может генерировать фактически неверный, предвзятый или оскорбительный текст; для взаимодействия с пользователями нужны дообучение и защитные механизмы. Автор репозитория не проводил полного аудита совместимости PEFT со стеком Hugging Face.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

MPT-30B

This is the MPT-30B but with added support to finetune using peft (tested with qlora). It is not finetuned further, the weights are the same as the original MPT-30b.

I have not traced through the whole huggingface stack to see if this is working correctly but it does finetune with qlora and outputs are reasonable. Inspired by implementations here https://huggingface.co/cekal/mpt-7b-peft-compatible/commits/main https://huggingface.co/mosaicml/mpt-7b/discussions/42.

The original description for MosaicML team below:

MPT-30B is a decoder-style transformer pretrained from scratch on 1T tokens of English text and code. This model was trained by MosaicML.

MPT-30B is part of the family of Mosaic Pretrained Transformer (MPT) models, which use a modified transformer architecture optimized for efficient training and inference.

MPT-30B comes with special features that differentiate it from other LLMs, including an 8k token context window (which can be further extended via finetuning; see MPT-7B-StoryWriter), support for context-length extrapolation via ALiBi, and efficient inference + training via FlashAttention. It also has strong coding abilities thanks to its pretraining mix. MPT models can also be served efficiently with both standard HuggingFace pipelines and NVIDIA's FasterTransformer. The size of MPT-30B was also specifically chosen to make it easy to deploy on a single GPU—either 1xA100-80GB in 16-bit precision or 1xA100-40GB in 8-bit precision.

This model uses the MosaicML LLM codebase, which can be found in the llm-foundry repository. It was trained by MosaicML’s NLP team on the MosaicML platform for LLM pretraining, finetuning, and inference.

How is this model different?

MPT-30B is:

Models finetuned off MPT-30B:

The following models are finetuned on MPT-30B:

Model Date

June 22, 2023

Model License

Apache-2.0

Documentation

How to Use

This model is best used with the MosaicML llm-foundry repository for training and finetuning.

import transformers
model = transformers.AutoModelForCausalLM.from_pretrained(
  'mosaicml/mpt-30b',
  trust_remote_code=True
)

Note: This model requires that trust_remote_code=True be passed to the from_pretrained method. This is because we use a custom MPT model architecture that is not yet part of the Hugging Face transformers package. MPT includes options for many training efficiency features such as FlashAttention, ALiBi, QK LayerNorm, and more.

To use the optimized triton implementation of FlashAttention, you can load the model on GPU (cuda:0) with attn_impl='triton' and with bfloat16 precision:

import torch
import transformers

name = 'mosaicml/mpt-30b'

config = transformers.AutoConfig.from_pretrained(name, trust_remote_code=True)
config.attn_config['attn_impl'] = 'triton'  # change this to use triton-based FlashAttention
config.init_device = 'cuda:0' # For fast initialization directly on GPU!

model = transformers.AutoModelForCausalLM.from_pretrained(
  name,
  config=config,
  torch_dtype=torch.bfloat16, # Load model weights in bfloat16
  trust_remote_code=True
)

The model was trained initially with a sequence length of 2048 with an additional pretraining stage for sequence length adapation up to 8192. However, ALiBi enables users to increase the maximum sequence length even further during finetuning and/or inference. For example:

import transformers

name = 'mosaicml/mpt-30b'

config = transformers.AutoConfig.from_pretrained(name, trust_remote_code=True)
config.max_seq_len = 16384 # (input + output) tokens can now be up to 16384

model = transformers.AutoModelForCausalLM.from_pretrained(
  name,
  config=config,
  trust_remote_code=True
)

This model was trained with the MPT-30B tokenizer which is identical to the EleutherAI/gpt-neox-20b tokenizer.

from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained('mosaicml/mpt-30b')

The model can then be used, for example, within a text-generation pipeline.
Note: when running Torch modules in lower precision, it is best practice to use the torch.autocast context manager.

from transformers import pipeline

with torch.autocast('cuda', dtype=torch.bfloat16):
    inputs = tokenizer('Here is a recipe for vegan banana bread:\n', return_tensors="pt").to('cuda')
    outputs = model.generate(**inputs, max_new_tokens=100)
    print(tokenizer.batch_decode(outputs, skip_special_tokens=True))

# or using the HF pipeline
pipe = pipeline('text-generation', model=model, tokenizer=tokenizer, device='cuda:0')
with torch.autocast('cuda', dtype=torch.bfloat16):
    print(
        pipe('Here is a recipe for vegan banana bread:\n',
            max_new_tokens=100,
            do_sample=True,
            use_cache=True))

Model Description

The architecture is a modification of a standard decoder-only transformer.

The model has been modified from a standard transformer in the following ways:

HyperparameterValue
n_parameters29.95B
n_layers48
n_heads64
d_model7168
vocab size50432
sequence length8192

Training Data

Streaming Datasets

Data was formatted using the MosaicML StreamingDataset library to host our data in object storage and efficiently stream it to our compute cluster during training. StreamingDataset obviates the need to download the whole dataset before starting training, and allows instant resumption of training from any point in the dataset.

Data Mix

The model was trained for 1T tokens on the following data mix:

Data SourceNumber of Tokens in SourceProportionEffective Number of TokensEpochs
mC4 3.1.0 - English (200+ words)2417.99 B33.50%335 B0.14
c4 - English - SemDedup 80%100.42 B29.90%299 B2.98
RedPajama - CommonCrawl878.45 B8.50%85 B0.097
The Stack - Selected Languages463.78 B10.00%100 B0.22
RedPajama - Wikipedia4.87 B4.00%40 B8.21
The Stack - Markdown107.07 B4.50%45 B0.42
Semantic Scholar ORC48.95 B3.30%33 B0.67
RedPajama - Books26.02 B3.00%30 B1.15
RedPajama - arXiv28.10 B1.90%19 B0.68
RedPajama - StackExchange20.54 B1.40%14 B0.68

Samples for each batch were selected from one of the datasets with the probability specified above. The examples were shuffled within each dataset, and each example was constructed from as many sequences from that dataset as were necessary to fill the sequence length. To build 8k support into MPT-30B efficiently, we first pre-trained on 1T tokens using sequences that were 2k tokens long, and then trained for an additional 50B tokens using sequences that were 8k tokens long.

The data was tokenized using the EleutherAI/gpt-neox-20b tokenizer. This BPE tokenizer has a number of desirable characteristics, most of which are relevant for tokenizing code: (1) It was trained on a diverse mix of data that includes code (The Pile) (2) It applies consistent space delimitation, unlike the GPT2 tokenizer which tokenizes inconsistently depending on the presence of prefix spaces (3) It contains tokens for repeated space characters, which allows superior compression of text with large amounts of repeated space characters.

The model vocabulary size of 50432 was set to be a multiple of 128 (as in MEGATRON-LM).

Training Configuration

The model was trained in three stages using the MosaicML Platform: (i) First it was trained on 440 A100-40GBs with a batch size of 1760. (ii) Then, on 216 A100-40GBs with a batch size of 1728. (iii) Training was completed on 256 H100-80GBs with a batch size of 512 with 8k context length and 50B tokens. The model was trained with sharded data parallelism using FSDP and used the LION optimizer.

Limitations and Biases

The following language is modified from EleutherAI's GPT-NeoX-20B

MPT-30B (Base) is not intended for deployment without finetuning. It should not be used for human-facing interactions without further guardrails and user consent.

MPT-30B can produce factually incorrect output, and should not be relied on to produce factually accurate information. MPT-30B was trained on various public datasets. While great efforts have been taken to clean the pretraining data, it is possible that this model could generate lewd, biased or otherwise offensive outputs.

MosaicML Platform

If you're interested in training and deploying your own MPT or LLMs on the MosaicML Platform, sign up here.

Disclaimer

The license on this model does not constitute legal advice. We are not responsible for the actions of third parties who use this model. Please consult an attorney before using this model for commercial purposes.

Citation

Please cite this model using the following format:

@online{MosaicML2023Introducing,
    author    = {MosaicML NLP Team},
    title     = {Introducing MPT-30B: Raising the bar
for open-source foundation models},
    year      = {2023},
    url       = {www.mosaicml.com/blog/mpt-30b},
    note      = {Accessed: 2023-06-22},
    urldate   = {2023-06-22}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Можно запустить

Подбираем GPU…

Класс архитектуры
MPTForCausalLM
Ревизия весов
6e454c1

0 моделей