Instructions to use chienhsinlin/helioslm-hdl-e4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use chienhsinlin/helioslm-hdl-e4b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="chienhsinlin/helioslm-hdl-e4b") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("chienhsinlin/helioslm-hdl-e4b") model = AutoModelForMultimodalLM.from_pretrained("chienhsinlin/helioslm-hdl-e4b", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use chienhsinlin/helioslm-hdl-e4b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "chienhsinlin/helioslm-hdl-e4b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "chienhsinlin/helioslm-hdl-e4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/chienhsinlin/helioslm-hdl-e4b
- SGLang
How to use chienhsinlin/helioslm-hdl-e4b 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 "chienhsinlin/helioslm-hdl-e4b" \ --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": "chienhsinlin/helioslm-hdl-e4b", "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 "chienhsinlin/helioslm-hdl-e4b" \ --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": "chienhsinlin/helioslm-hdl-e4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use chienhsinlin/helioslm-hdl-e4b with Docker Model Runner:
docker model run hf.co/chienhsinlin/helioslm-hdl-e4b
羲和 HeliosLM HDL E4B
發佈者 Published by: Bitstar Inc.
羲和 HDL E4B 是以 Google Gemma 4 E4B-it 為基礎、針對 Verilog / SystemVerilog 硬體設計調整的模型。用途是寫 RTL、修改既有 RTL、依錯誤訊息或測試結果修 bug,撰寫 UPF 低功耗描述,以及撰寫 UVM / SystemVerilog 測試平台。
HeliosLM HDL E4B is a model for Verilog / SystemVerilog hardware design, based on Google Gemma 4 E4B-it. It is meant for writing RTL, editing existing RTL, fixing bugs from compiler messages or failing test logs, writing UPF power intent, and writing UVM / SystemVerilog testbenches.
- 參數量 Parameters: about 8B (Gemma 4 E4B architecture, text only)
- 授權 License: Apache-2.0, same as Google Gemma 4
- 單張 16 GB 以上 GPU 可跑 bf16;8 GB 顯卡請用 GGUF 版 helioslm-hdl-e4b-GGUF。 bf16 runs on one 16 GB+ GPU; for 8 GB cards use the GGUF build linked above.
怎麼做的 How it was made
在 Gemma 4 E4B 上,用公開、可合成的 Verilog / SystemVerilog 專案做持續訓練與強化學習(以模擬測試結果當獎勵)。
把上一步與 Gemma 4 E4B 的差異,以 0.5 倍加回 Gemma 4 E4B-it(chat vector),保留原本的對話與指令能力。
再用 LoRA 做一輪小規模微調,資料是「修改既有 RTL」與「依錯誤訊息修 bug」的練習題,以及 Verilog 題目與解答。最後把 LoRA 合併進權重。
再用一輪 LoRA 加入 UPF(IEEE 1801)低功耗描述的練習題,同時重放前一輪的 RTL 資料以保留原本能力,也合併進權重。
第三輪 LoRA 加入 UVM 測試平台、VIP、依規格寫 RTL 與測試平台的練習題,每一筆都經過我們自己的模擬器實際編譯執行並通過才收;同樣重放前面的 RTL 與 UPF 資料,再合併進權重。
第四輪 LoRA 加入撰寫 SVA 斷言、coverage 收斂、regression 與失敗分析、以及在不改變行為下縮小面積與功耗的 RTL 改寫練習題;每一筆都經過我們自己的模擬、coverage 與合成/功耗工具檢查才收,並重放前面的資料。
Continued training and reinforcement learning (simulation pass/fail as reward) on Gemma 4 E4B with public, synthesizable Verilog / SystemVerilog projects.
The difference from Gemma 4 E4B was added back to Gemma 4 E4B-it at 0.5x (chat vector), keeping its instruction-following ability.
A small LoRA fine-tune on RTL-editing and bug-fixing exercises plus Verilog instruction data, merged into the weights.
A second LoRA round adding UPF (IEEE 1801) power-intent exercises, with replay of the earlier RTL data, also merged.
A third LoRA round adding UVM testbench, VIP, and spec-to-RTL / spec-to-testbench exercises, each one compiled and run on our own simulator and kept only if it passed, with replay of the earlier RTL and UPF data, also merged.
A fourth LoRA round adding exercises for writing SVA assertions, coverage closure, regression runs with failure triage, and behaviour-preserving RTL rewrites for smaller area and power, each checked with our own simulation, coverage and synthesis/power tools, with replay of the earlier data.
訓練資料 Training data (all public):
- OpenTitan (Apache-2.0), Ibex and CV32E40P (Solderpad) RTL. 編輯/修 bug 練習題是從這些程式自動產生的。Editing and bug-fix exercises were generated automatically from this code.
- 公開 GitHub Verilog / SystemVerilog 專案(The Stack 中寬鬆授權的部分,以及公開的 Verilog GitHub 資料集),只收通過 Verilator lint 與 Yosys 合成的專案。Public GitHub HDL projects (the permissively licensed part of The Stack and a public Verilog GitHub corpus), kept only when they pass Verilator lint and Yosys synthesis.
- 我們自己以 Apache-2.0 公開的 IP / VIP 程式與其測試平台。Our own IP / VIP code and testbenches published under Apache-2.0.
- UPF 練習題:我們自己寫的產生器,加上 GitHub 上寬鬆授權的 UPF 檔案,全部經過語法與語意檢查。UPF exercises from our own generator plus permissively licensed UPF files from GitHub, all syntax- and rule-checked.
- 其他寬鬆授權的開源處理器與 SoC 設計(例如 XiangShan,Mulan PSL v2)自動產生的修 bug/補完練習題。Bug-fix and completion exercises generated from other permissively licensed open CPU / SoC designs (for example XiangShan, Mulan PSL v2).
- 開放權重模型寫出的測試平台,只收在我們模擬器上通過的。Testbenches written by open-weight models, kept only when they passed on our simulator.
- CodeV-R1-dataset (CC-BY-SA-4.0) Verilog instruction data.
評測用的題目(VerilogEval、RTLLM、CVDP、我們保留的 OpenTitan 測試題與保留的 IP 題目)已從訓練資料中排除。 Benchmark problems (VerilogEval, RTLLM, CVDP, our held-out OpenTitan tasks and held-out IP tasks) were removed from the training data.
使用方式 Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
name = "chienhsinlin/helioslm-hdl-e4b"
tok = AutoTokenizer.from_pretrained(name)
model = AutoModelForCausalLM.from_pretrained(name, dtype="bfloat16", device_map="auto")
msgs = [{"role": "user", "content": "Write a synthesizable Verilog module for a 4-bit up/down counter with synchronous reset."}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(ids, max_new_tokens=2048, do_sample=False)
print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True))
vLLM: vllm serve chienhsinlin/helioslm-hdl-e4b --max-model-len 16384
建議 Tips:
- 修 bug 時,把整個模組原始碼和錯誤訊息/測試 log 一起貼上,並要求輸出完整模組。Paste the whole module plus the error message or failing log, and ask for the complete fixed module.
- 產生的 RTL 一定要用自己的模擬與合成流程驗證。Always check generated RTL with your own simulation and synthesis flow.
限制 Limitations
- 這是 HDL 專用模型,不適合一般聊天或事實問答。It is specialized for HDL and is not meant for general chat or factual Q&A.
- UVM 測試平台通常要搭配模擬器錯誤訊息修幾輪才會通過;從規格一次寫出完整 IP 或完整測試平台,能力仍有限;UPF 的 level shifter 指令偶爾會寫錯。UVM testbenches usually need a few repair rounds with simulator messages; writing a whole IP or a whole testbench from a spec in one pass is still weak; UPF level-shifter commands are sometimes wrong.
- 輸出可能有語法或功能錯誤,請勿未經驗證直接用於量產設計。Outputs can contain syntax or functional errors; do not use them in production silicon without verification.
- Downloads last month
- 326