PARATRANS
收藏资源简介:
PARATRANS数据集是一个为评估大型语言模型(LLMs)在并行编程语言之间进行代码翻译能力的基准数据集。该数据集包含序列到并行翻译和跨范例翻译,涵盖了序列代码、CUDA和OpenMP三种并行编程范式。数据集由898对训练样本和76对测试样本组成,每个样本都包含相同内核在不同并行编程语言中的实现,用于评估LLMs的编译率和验证率。PARATRANS数据集的创建过程包括源代码抓取、预处理、代码验证、Token计数剪枝和划分训练集和测试集等步骤。
The PARATRANS dataset is a benchmark dataset for evaluating the code translation capabilities of Large Language Models (LLMs) between parallel programming languages. This dataset covers sequence-to-parallel translation and cross-paradigm translation, including three parallel programming paradigms: sequential code, CUDA, and OpenMP. It consists of 898 training sample pairs and 76 test sample pairs, where each sample contains implementations of the same kernel across different parallel programming languages, and is used to evaluate the compilation rate and validation rate of LLMs. The creation process of the PARATRANS dataset includes steps such as source code crawling, preprocessing, code verification, Token counting and pruning, and training/test set partitioning.
UniPar 数据集概述
数据集名称
UniPar - Unified LLM-Based Framework for Parallel Code Translation in HPC
核心功能
多智能体系统,用于在并行编程API之间进行代码翻译(例如CUDA到OpenMP),使用语言模型和错误纠正反馈循环。
系统组成
- 评估LLaMA模型的流水线(或使用vllm运行的模型)
- 使用API运行GPT模型的类似流水线
- 初始模型运行后可运行的多智能体流水线
- 比较编译率的脚本
- 运行验证率的脚本
多智能体流水线组件
- QuestionerAgent:制定模型翻译请求,包括可选的少样本示例
- ModelAgent:与语言模型API接口,生成翻译并修复代码错误
- ExecutionAgent:测试翻译后的代码是否能正确编译,提供错误反馈
反馈循环流程
- QuestionerAgent将源代码发送给ModelAgent进行翻译
- ExecutionAgent尝试编译和运行翻译后的代码
- 如果编译失败,ExecutionAgent将错误发送给ModelAgent
- ModelAgent尝试根据错误修复代码
- 循环重复直到编译成功或达到最大迭代次数
数据集位置
HeCBench数据集位于多智能体流水线文件夹中
可用脚本
- full_run.sh:基本推理Python脚本使用
- full_evaluation_script.sh:运行所有必要脚本的完整评估脚本
- full_run_topic.sh:使用特定主题配置执行翻译任务
- full_run_with_agent.sh:执行初始推理并调用剩余流水线步骤
环境要求
需要安装env.yaml文件中列出的所有必需依赖项
故障排除
- 内存问题:减少
--max_tokens值,增加--num_workers,分批处理数据集 - 编译失败:检查编译结果文件中的错误消息,调整
--temperature参数,增加--max_iterations - 运行时错误:检查运行时错误消息,确保执行环境安装了必要的库,验证目标硬件支持目标API




