Text Generation
Transformers
Safetensors
PyTorch
Turkish
llama
legal
turkish
llama-3.1
fp8
bfloat16
mixed-precision
question-answering
fsdp-v2
distributed-training
conversational
text-generation-inference
Instructions to use newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp") model = AutoModelForCausalLM.from_pretrained("newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp
- SGLang
How to use newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
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 "newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp with Docker Model Runner:
docker model run hf.co/newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp
Update README.md
Browse files
README.md
CHANGED
|
@@ -93,6 +93,21 @@ model = convert_to_float8_training(model, config=config)
|
|
| 93 |
| tensorboard-data-server | 0.7.2 |
|
| 94 |
| wandb | 0.22.1 |
|
| 95 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
### *Training Time Analysision*
|
| 97 |
| Model | Training Time (mins) | Memory Allocated (avg %) | GPU Utilization (avg %) | Speed vs bf16 |
|
| 98 |
| :-------------------------------------------------- | --------------------: | -----------------------: | -----------------------: | -------------: |
|
|
|
|
| 93 |
| tensorboard-data-server | 0.7.2 |
|
| 94 |
| wandb | 0.22.1 |
|
| 95 |
|
| 96 |
+
## Job Details
|
| 97 |
+
| model | Job ID | Runtime (mins) | Nodes | GPUs | Node-hour | GPU-hour | micro-batch | batch-size | gradient_accumulation | total_batch_size |
|
| 98 |
+
| ---------------------------------------- | -------- | -------------- | ----- | ---- | --------- | ---------- | ----------- | ---------- | --------------------- | ---------------- |
|
| 99 |
+
| Llama-3.1-8B-Instruct_w16a8_rw | 31768103 | 115.75 | 1 | 4 | **1.929** | **7.716** | 2 | 2 | 4 | 32 |
|
| 100 |
+
| Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp| 31837629 | 109.00 | 1 | 4 | **1.816** | **7.266** | 2 | 2 | 4 | 32 |
|
| 101 |
+
| Llama-3.1-8B-Instruct-w16a8-mxtw | 31768031 | 64.00 | 4 | 4 | **1.066** | **4.266** | 2 | 2 | 4 | 32 |
|
| 102 |
+
| Llama-3.1-8B-Instruct-w16a16-tw | 31768074 | 138.75 | 1 | 4 | **0.858** | **3.433** | 2 | 2 | 4 | 32 |
|
| 103 |
+
| Llama-3.1-8B-Instruct-w16a8-1node-bs8 | 31768093 | 123.75 | 1 | 4 | **0.788** | **3.151** | 2 | 2 | 4 | 32 |
|
| 104 |
+
| Llama-3.1-8B-Instruct-w16a16-4nodes-bs32 | 31478433 | 31.75 | 4 | 4 | **2.117** | **8.467** | 4 | 4 | 8 | 512 |
|
| 105 |
+
| Llama-3.1-8B-Instruct-w16a8-4nodes-bs32 | 31478468 | 39.75 | 4 | 4 | **2.650** | **10.600** | 4 | 4 | 8 | 512 |
|
| 106 |
+
| Llama-3.1-8B-Instruct-w16a16-8nodes-bs32 | 31476914 | 22.00 | 8 | 4 | **2.933** | **11.733** | 4 | 4 | 8 | 1024 |
|
| 107 |
+
| Llama-3.1-8B-Instruct-w16a8-8nodes-bs32 | 31476844 | 23.50 | 8 | 4 | **3.133** | **12.533** | 4 | 4 | 8 | 1024 |
|
| 108 |
+
| Llama-3.1-8B-Instruct-w16a16-8nodes-bs64 | 31476914 | 22.00 | 8 | 4 | **2.933** | **11.733** | 4 | 4 | 8 | 1024 |
|
| 109 |
+
| Llama-3.1-8B-Instruct-w16a8-8nodes-bs64 | 31476844 | 23.50 | 8 | 4 | **3.133** | **12.533** | 4 | 4 | 8 | 1024 |
|
| 110 |
+
|
| 111 |
### *Training Time Analysision*
|
| 112 |
| Model | Training Time (mins) | Memory Allocated (avg %) | GPU Utilization (avg %) | Speed vs bf16 |
|
| 113 |
| :-------------------------------------------------- | --------------------: | -----------------------: | -----------------------: | -------------: |
|