Text Generation
Transformers
Safetensors
Korean
English
exaone_moe
Mixture of Experts
awq
quantized
w4a16
compressed-tensors
vllm
llm-compressor
conversational
Instructions to use Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128") model = AutoModelForCausalLM.from_pretrained("Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128") 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 Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128
- SGLang
How to use Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128 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 "Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128" \ --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": "Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128", "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 "Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128" \ --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": "Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128 with Docker Model Runner:
docker model run hf.co/Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128
Update README.md
Browse files
README.md
CHANGED
|
@@ -90,7 +90,8 @@ The EXAONE specific MoE-aware AWQ recipe was developed in [SqueezeBits/llm-compr
|
|
| 90 |
| This model (W4A16) | ~120 GB |
|
| 91 |
| Original BF16 | ~480 GB |
|
| 92 |
|
| 93 |
-
**CUDA / driver requirement:** vLLM 0.19.0 wheels are compiled with the CUDA 12.9 toolkit, so you need **CUDA β₯ 12.9** (NVIDIA driver β₯ 575.x) to run without issues. If your driver is older, follow the monkey-patch workaround in the inference section below.
|
|
|
|
| 94 |
|
| 95 |
---
|
| 96 |
|
|
@@ -126,14 +127,15 @@ from vllm import LLM, SamplingParams
|
|
| 126 |
|
| 127 |
MODEL_PATH = "Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128"
|
| 128 |
|
| 129 |
-
|
| 130 |
-
#
|
|
|
|
| 131 |
# PTX and crash with "cudaErrorUnsupportedPtxVersion" during weight loading.
|
| 132 |
# This patch forces vLLM to use WNA16MoEMethod (no Marlin CUDA kernels) instead
|
| 133 |
# of MarlinMoEMethod. Safe to keep even after upgrading the driver.
|
| 134 |
import vllm.model_executor.layers.quantization.compressed_tensors.compressed_tensors_moe as _ct_moe
|
| 135 |
_ct_moe.check_moe_marlin_supports_layer = lambda *args, **kwargs: False
|
| 136 |
-
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 137 |
|
| 138 |
|
| 139 |
def main():
|
|
|
|
| 90 |
| This model (W4A16) | ~120 GB |
|
| 91 |
| Original BF16 | ~480 GB |
|
| 92 |
|
| 93 |
+
**CUDA / driver requirement:** for H200(sm_90), vLLM 0.19.0 wheels are compiled with the CUDA 12.9 toolkit, so you need **CUDA β₯ 12.9** (NVIDIA driver β₯ 575.x) to run without issues. If your driver is older, follow the monkey-patch workaround in the inference section below.
|
| 94 |
+
* It is okay for A100(sm_80)
|
| 95 |
|
| 96 |
---
|
| 97 |
|
|
|
|
| 127 |
|
| 128 |
MODEL_PATH = "Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128"
|
| 129 |
|
| 130 |
+
|
| 131 |
+
"""# ββ Monkey-patch required if NVIDIA driver < 575.x (CUDA < 12.9) βββββββββββββ
|
| 132 |
+
# for H200, vLLM 0.19.0 is compiled with CUDA 12.9; older drivers cannot JIT-compile its
|
| 133 |
# PTX and crash with "cudaErrorUnsupportedPtxVersion" during weight loading.
|
| 134 |
# This patch forces vLLM to use WNA16MoEMethod (no Marlin CUDA kernels) instead
|
| 135 |
# of MarlinMoEMethod. Safe to keep even after upgrading the driver.
|
| 136 |
import vllm.model_executor.layers.quantization.compressed_tensors.compressed_tensors_moe as _ct_moe
|
| 137 |
_ct_moe.check_moe_marlin_supports_layer = lambda *args, **kwargs: False
|
| 138 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ"""
|
| 139 |
|
| 140 |
|
| 141 |
def main():
|