Base model
Qwen/Qwen2.5-Coder-14B-Instruct
Training data
123 verified teacher completions (code-only, teacher reasoning stripped) over
19 PolyBench kernels × 2 arms (doc / nodoc), stratified-by-family train/test
split so no kernel family leaks into the 11-kernel holdout. Teachers:
DeepSeek-R1, Qwen3.8-Max, GLM-5.3, Nemotron-3-Super, Kimi-K2.7-Code,
Hermes-4-405B. Correctness flags re-verified end-to-end after the per-binary
cache collision bug fix (2026-12-01).
Hyperparameters
Table with columns: field, value| field | value |
|---|
| quantization | NF4 (bnb_4bit_quant_type), bf16 compute, double-quant |
| adapter | LoRA r=16, α=32, dropout=0.05, bias=none |
| target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| epochs | 6 |
| per-device bsz | 1 |
| grad accum | 4 |
| learning rate | 2e-4 |
| max length | 2048 tokens |
| loss | completion-only (user turn masked) |
| GPU | 1 × A100-SXM4 40 GB |
| wall time | ≈ 31 min |
Qwen chat template, system prompt:
"You are an expert HPC compiler optimization assistant."
User turn gives the serial C kernel; assistant emits a single c block
with the parallel implementation.
Evaluation (11-kernel holdout, pass@1 at T=0.2, Wilson 95% CI)
Table with columns: model, PASS, RUN, BUILD| model | PASS | RUN | BUILD |
|---|
| This adapter | 5/11 [0.21, 0.72] | 10/11 | 10/11 |
| Qwen2.5-Coder-14B-Instruct (vanilla) | 3/11 [0.10, 0.57] | 9/11 | 9/11 |
| 7B student (sibling) | 1/11 [0.02, 0.38] | 8/11 | 9/11 |
| Teacher ensemble ceiling | 10/10 [0.72, 1.00] | — | — |
Kernels solved: atax, heat-3d, nussinov, seidel-2d, syrk. PASS means
the compiled candidate matched the reference output (CORRECT or
CORRECT_NUMTOL) on a timed run; MISMATCH / RUNFAIL / BUILDFAIL otherwise.
McNemar mid-p vs vanilla base on 7 solvable kernels: p = 0.625 (n = 11 too
small for significance; the direction flip from 7B is the signal).
Intended use
Research / autotuning on PolyBench-shape kernels (serial affine loops →
OpenMP parallel C). Not production ready. Not evaluated outside the PolyBench
benchmark family; off-distribution behavior unknown.
Known limits
- One kernel (
gramschmidt) was unsolvable by the entire teacher ensemble —
expect no gain there.
- QLoRA inference requires
bitsandbytes (NF4) to match training-time
numerics exactly; adapter-only merge into fp16 base is possible but not
validated.
Load
from peft import PeftModelfrom transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfigimport torch bnb = BitsAndBytesConfig( load_in_4bit=True, bnb_4bit_quant_type="nf4", bnb_4bit_compute_dtype=torch.bfloat16, bnb_4bit_use_double_quant=True,)base = AutoModelForCausalLM.from_pretrained( "Qwen/Qwen2.5-Coder-14B-Instruct", quantization_config=bnb, device_map="auto",)tok = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-Coder-14B-Instruct")model = PeftModel.from_pretrained(base, "tuanamz/qwen2.5-coder-14b-polybench-lora")