Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bigcode/tiny_starcoder_py · Hugging Face #324

Open
irthomasthomas opened this issue Jan 9, 2024 · 1 comment
Open

bigcode/tiny_starcoder_py · Hugging Face #324

irthomasthomas opened this issue Jan 9, 2024 · 1 comment
Labels
base-model llm base models not finetuned for chat finetuning Tools for finetuning of LLMs e.g. SFT or RLHF github gh tools like cli, Actions, Issues, Pages llm Large Language Models llm-inference-engines Software to run inference on large language models llm-serving-optimisations Tips, tricks and tools to speedup inference of large language models

Comments

@irthomasthomas
Copy link
Owner

Note:

bigcode/tiny_starcoder_py · Hugging Face

TinyStarCoderPy

This is a 164M parameters model with the same architecture as StarCoder (8k context length, MQA & FIM). It was trained on the Python data from StarCoderData for ~6 epochs which amounts to 100B tokens.

Use

Intended use

The model was trained on GitHub code, to assist with some tasks like Assisted Generation. For pure code completion, we advise using our 15B models StarCoder or StarCoderBase.

Generation

# pip install -q transformers
from transformers import AutoModelForCausalLM, AutoTokenizer

checkpoint = "bigcode/tiny_starcoder_py"
device = "cuda" # for GPU usage or "cpu" for CPU usage

tokenizer = AutoTokenizer.from_pretrained(checkpoint)
model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)

inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to(device)
outputs = model.generate(inputs)
print(tokenizer.decode(outputs[0]))

Fill-in-the-middle

Fill-in-the-middle uses special tokens to identify the prefix/middle/suffix part of the input and output:

input_text = "<fim_prefix>def print_one_two_three():\n    print('one')\n    <fim_suffix>\n    print('three')<fim_middle>"
inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
outputs = model.generate(inputs)
print(tokenizer.decode(outputs[0]))

Training

Model

  • Architecture: GPT-2 model with multi-query attention and Fill-in-the-Middle objective
  • Pretraining steps: 50k
  • Pretraining tokens: 100 billion
  • Precision: bfloat16

Hardware

  • GPUs: 32 Tesla A100
  • Training time: 18 hours

Software

  • Orchestration: Megatron-LM
  • Neural networks: PyTorch
  • BP16 if applicable: apex

License

The model is licensed under the BigCode OpenRAIL-M v1 license agreement. You can find the full agreement here.

Suggested labels

  • { "key": "llm-pretraining", "value": "Information related to the pretraining process of Large Language Models" }
@irthomasthomas irthomasthomas added github gh tools like cli, Actions, Issues, Pages llm Large Language Models finetuning Tools for finetuning of LLMs e.g. SFT or RLHF llm-inference-engines Software to run inference on large language models New-Label Choose this option if the existing labels are insufficient to describe the content accurately base-model llm base models not finetuned for chat llm-serving-optimisations Tips, tricks and tools to speedup inference of large language models and removed New-Label Choose this option if the existing labels are insufficient to describe the content accurately labels Jan 9, 2024
@irthomasthomas
Copy link
Owner Author

There is no technical reason why we can't use a second speculative decoder model. Making three models in total.

This model is 164M parameters. An order of magnitude larger would be 1.6B, and an order of magnitude again would still only be 16B parameters. At 8bit that makes about 18GB + the context window. I have a 12GB 3060, and an older, slower 8GB 1080. So this is doable in vram, but I'm not sure if that 1080 is actually faster than the GPU.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
base-model llm base models not finetuned for chat finetuning Tools for finetuning of LLMs e.g. SFT or RLHF github gh tools like cli, Actions, Issues, Pages llm Large Language Models llm-inference-engines Software to run inference on large language models llm-serving-optimisations Tips, tricks and tools to speedup inference of large language models
Projects
None yet
Development

No branches or pull requests

1 participant