Views
No views yet
google/gemma-4-26B-A4B-it for generating small Python programs that exercise PyTorch APIs on tiny tensors. Quantized to GGUF for inference with llama.cpp / llama-cpp-python.| File | Quant | Size (approx.) | Suitable hardware |
|---|---|---|---|
gemma4-26b-a4b-qa.Q3_K_M.gguf | Q3_K_M | ~13 GB | Colab T4 16GB (full GPU) |
gemma4-26b-a4b-qa.Q4_K_M.gguf | Q4_K_M | ~17 GB | A100 40GB / T4 with offload |
google/gemma-4-26B-A4B-it (MoE, ~4B active params)SFTTrainer with assistant_only_loss=True<bos><start_of_turn>system
You are a PyTorch API testing assistant. Given a PyTorch API name, signature, and docstring, generate a small, deterministic Python program that exercises this API on tiny tensors. Output only Python code.<end_of_turn>
<start_of_turn>user
Muc tieu API: torch.matmul
Thong tin: {'input': 'Tensor', 'other': 'Tensor'}
Mo ta chi tiet: Matrix product of two tensors.
Hay viet ma Python kiem thu API nay.<end_of_turn>
<start_of_turn>modelllama-cpp-python1from llama_cpp import Llama
2
3llm = Llama.from_pretrained(
4 repo_id="trdgl/gemma4-26b-a4b-qa-GGUF",
5 filename="gemma4-26b-a4b-qa.Q3_K_M.gguf",
6 n_ctx=2048,
7 n_gpu_layers=-1,
8 verbose=False,
9)
10
11SYSTEM = (
12 "You are a PyTorch API testing assistant. "
13 "Given a PyTorch API name, signature, and docstring, "
14 "generate a small, deterministic Python program that exercises "
15 "this API on tiny tensors. Output only Python code."
16)
17
18out = llm.create_chat_completion(
19 messages=[
20 {"role": "system", "content": SYSTEM},
21 {"role": "user", "content":
22 "Muc tieu API: torch.matmul\n"
23 "Thong tin: {'input': 'Tensor', 'other': 'Tensor'}\n"
24 "Mo ta chi tiet: Matrix product of two tensors.\n"
25 "Hay viet ma Python kiem thu API nay."},
26 ],
27 max_tokens=300,
28 temperature=0.0,
29 stop=["<end_of_turn>", "<start_of_turn>"],
30)
31print(out["choices"][0]["message"]["content"])| Hardware | Quant | Speed |
|---|---|---|
| NVIDIA H200 | Q3_K_M / Q4_K_M | ~140-160 tok/s |
| Colab T4 16GB | Q3_K_M (full GPU) | ~15-25 tok/s |
| Colab T4 16GB | Q4_K_M (with offload) | ~8-15 tok/s |
<end_of_turn>, <start_of_turn>.adapter/ for further stacking or full-precision merging.