Spire-27B
compute shader generation and debugging
2 min read
The Spire-27B model is built for writing, debugging, and translating low-level compute shaders in Vulkan GLSL (#version 450) and WebGPU WGSL. It is based on the Qwen/Qwen3.5-27B architecture, with fine-tuning that sharply improves the reliability of code generation for graphics APIs. This new release is useful for game developers, graphics engineers, and GPU optimization specialists who need to quickly generate working shaders from text descriptions.
Key features
- High reliability: achieves 96.6% successful compilations and runs with zero runtime crashes.
- Metric growth: overall Pass@1 rose to 59.1%, while Vulkan GLSL accuracy jumped by 36.5pp.
- WGSL leader: shows the best results in the family for WebGPU WGSL tasks (66.4%), quantization, and matrix operations.
- Multitasking: can write code from scratch based on a specification, fix errors using compiler logs, and translate code between GLSL and WGSL.
What you can do
- Generate shaders: create ready-to-run compute blocks (such as normalization or matrix multiplication) for WebGPU and Vulkan directly from text prompts.
- Fix errors: feed compiler or validator error text to the model to automatically fix problematic shaders.
- Translate code: rewrite existing compute shaders from Vulkan GLSL to WebGPU WGSL and vice versa.
- Deploy locally: run the model via Hugging Face Transformers or set up an OpenAI-compatible server using vLLM.
Example
Running generation via the transformers library:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "sarimahsan101/Spire-27B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
inputs = tokenizer("Write a WebGPU WGSL compute shader...", return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=1536, do_sample=False)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Read more
Details• Evaluation: 104 tests on Vulkan GLSL and 104 on WebGPU WGSL (208 tasks in total).
• Key figures: compilation 96.6% (+20.2pp over baseline), execution 96.6% (+34.1pp).
• License: Apache 2.0 (inherited from the base Qwen model).
• Limitations: strictly specializes in compute shaders; graphics pipeline stages are out of scope.










Comments