Views
No views yet

| Base Model | GEMMV | |
|---|---|---|
| 8B | deepseek-ai/DeepSeek-R1-Distill-Llama-8B | bxsk2024/GEMMV-DS-8b |
| 8B | meta-llama/Llama-3.1-8B-Instruct | bxsk2024/GEMMV-Llama-8b |
1import os
2import torch
3from transformers import AutoTokenizer, AutoModelForCausalLM
4
5# Load the model and tokenizer
6device = 'cuda' if torch.cuda.is_available() else 'cpu'
7model_name = "/home/python/transformers/GEMMV-DS-8b"
8tokenizer = AutoTokenizer.from_pretrained(model_name)
9model = AutoModelForCausalLM.from_pretrained(model_name).to(device)
10prompt = "FILL IN THE QUESTION"
11input_ids = tokenizer(prompt, return_tensors="pt").input_ids.to(device)
12# Generate sample with sampling enabled and necessary parameters
13sample = model.generate(
14 input_ids,
15 max_length=4096,
16 temperature=0.8,
17 top_p=0.9,
18 do_sample=True # Enable sampling to use temperature and top_p
19)
20response = tokenizer.decode(sample[0], truncate_before_pattern=[r"endmodule"]) + "endmodule"
21print("Response:", response)1@ARTICLE{10994474,
2 author={Zhang, Gaoche and Zou, Dingyang and Sun, Kairui and Chen, Zhihuan and Wang, Meiqi and Wang, Zhongfeng},
3 journal={IEEE Journal on Emerging and Selected Topics in Circuits and Systems},
4 title={GEMMV: An LLM-Based Automated Performance-Aware Framework for GEMM Verilog Generation},
5 year={2025},
6 volume={15},
7 number={2},
8 pages={325-336},
9 keywords={Adders;Hardware design languages;Codes;Hardware;Artificial intelligence;AI accelerators;Register transfer level;Training;Syntactics;Optimization;AI accelerators;design automation;LLMs;fine-tuning;GEMM},
10 doi={10.1109/JETCAS.2025.3568712}
11}