FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precision
Paper • 2407.08608 • Published • 1
How to use ethanker/nanomind-step-002000 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="ethanker/nanomind-step-002000") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("ethanker/nanomind-step-002000")
model = AutoModelForCausalLM.from_pretrained("ethanker/nanomind-step-002000")How to use ethanker/nanomind-step-002000 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "ethanker/nanomind-step-002000"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "ethanker/nanomind-step-002000",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/ethanker/nanomind-step-002000
How to use ethanker/nanomind-step-002000 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "ethanker/nanomind-step-002000" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "ethanker/nanomind-step-002000",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "ethanker/nanomind-step-002000" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "ethanker/nanomind-step-002000",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use ethanker/nanomind-step-002000 with Docker Model Runner:
docker model run hf.co/ethanker/nanomind-step-002000
This is an early checkpoint (step 2,000) from a small decoder-only GPT-style experiment. It is shared primarily for transparency and to help others reproduce or build upon the setup. This checkpoint is not production-ready.
train_run1.py (included here) with the exact launch command in RUN_COMMAND.txt.These were implemented in the training/data pipeline for future iterations (beyond this checkpoint):
References:
from transformers import AutoTokenizer, LlamaForCausalLM
import torch
m = 'ethanker/nanomind-step-002000'
tok = AutoTokenizer.from_pretrained(m, use_fast=True)
model = LlamaForCausalLM.from_pretrained(m, torch_dtype=torch.bfloat16 if torch.cuda.is_available() else torch.float32)
model.eval().to('cuda' if torch.cuda.is_available() else 'cpu')
prompt = "Once upon a time,"
inputs = tok(prompt, return_tensors='pt').to(model.device)
out = model.generate(**inputs, do_sample=True, top_p=0.9, temperature=0.8, max_new_tokens=128)
print(tok.decode(out[0], skip_special_tokens=True))
model.safetensors, tokenizer/config filestrain_run1.py (training code snapshot)RUN_COMMAND.txt (exact command used)