ComPile
收藏资源简介:
ComPile数据集是由加州大学戴维斯分校等机构合作创建的一个大规模的中间表示(IR)数据集,专门从生产环境中收集的代码中提取。该数据集包含了2.8TB的文本中间表示,涵盖了Rust, Swift, Julia, 和C/C++等多种编程语言。通过直接接入语言的包管理器或编译器,ComPile从生产级程序中提取了这些中间表示。数据集的创建旨在支持编译器优化和机器学习模型的训练,特别是在编译器中间表示层面的分析和优化。ComPile的应用领域包括编译器优化、代码分析和生成,以及机器学习在编译器设计中的应用,旨在提高编译器的性能和效率。
The ComPile dataset is a large-scale intermediate representation (IR) dataset co-created by institutions including the University of California, Davis. It is specifically extracted from code sourced from production environments, containing 2.8 TB of textual intermediate representations covering multiple programming languages such as Rust, Swift, Julia, and C/C++. ComPile extracts these intermediate representations from production-grade programs by directly interfacing with the package managers or compilers of the corresponding programming languages. The dataset is developed to support compiler optimization and the training of machine learning models, particularly for analysis and optimization at the compiler intermediate representation level. Its application domains include compiler optimization, code analysis and generation, as well as the application of machine learning in compiler design, with the goal of enhancing the performance and efficiency of compilers.
数据集卡片:ComPile
数据集描述
数据集摘要
ComPile 包含超过 2.7TB 的许可源代码,编译为(文本)LLVM 中间表示(IR),涵盖 C/C++、Rust、Swift 和 Julia。该数据集是通过钩入 LLVM 代码生成,通过语言的包管理器或编译器直接提取生产级程序的中间表示,使用我们的数据集收集工具创建的。
语言
数据集包含 5 种编程语言 作为 v1.0 版本:
- "c++"
- "c"
- "rust"
- "swift"
- "julia"
数据集大小
公共发布的 ComPile 包含超过 2.7TB 的文本 LLVM-IR,使用 Llama 分词器分词后为 1.3+T 个令牌。
| 语言 | 位码大小 | 文本 IR 大小 | Llama 令牌计数 | BPE 令牌计数 (10k 词汇) | BPE 令牌计数 (50k 词汇) |
|---|---|---|---|---|---|
| C | 2.47GB | 10.19GB | 5.31B | 0.91B | 0.58B |
| C++ | 28.87GB | 102.76GB | 46.75B | 11.20B | 6.27B |
| Julia | 164.16GB | 1088.39GB | 547.60B | 41.91B | 23.49B |
| Rust | 399.94GB | 1523.84GB | 735.90B | 137.37B | 90.01B |
| Swift | 6.95GB | 35.93GB | 19.78B | 3.36B | 1.75B |
| 总计 | 602.39GB | 2761.11GB | 1355.34B | 194.75B | 122.10B |
ComPile 以位码形式分发,这是一种压缩格式,可以轻松转换为 LLVM-IR 的文本表示。为了收集令牌计数,我们将位码反汇编为文本 IR,然后对其进行分词。我们使用了标准的 Llama 分词器,然后使用在多 GB 文本 IR 样本上训练的自定义词汇运行 fastBPE,特别是 10k 和 50k 词汇大小。
数据集结构
数据字段
数据集中的每一行由一个单独的 LLVM-IR 模块和一些元数据组成。每个行有六个列:
content(字符串): 包含组成模块的原始位码。license_expression(字符串): 包含描述模块来源项目许可证的 SPDX 表达式。license_source(字符串): 描述license_expression的确定方式。license_files: 包含许可证文件的数组。package_source(字符串): 包含模块来源的包信息。language(字符串): 指示模块编译的源语言。
许可证约束和去重
| 语言 | 原始大小 | 许可证约束 | 去重 + 许可证约束 |
|---|---|---|---|
| C/C++ | 126GB | 46GB | 31GB |
| C | 16GB | N/A | 2GB |
| C++ | 109GB | N/A | 29GB |
| Julia | 201GB | 179GB | 164GB |
| Swift | 8GB | 7GB | 7GB |
| Rust | 656GB | 443GB | 400GB |
| 总计 | 990GB | 675GB | 602GB |
原始大小是从构建所有项目直接获得的大小。许可证约束列显示了在考虑许可证信息后的每种语言的大小。最后一列显示了在考虑许可证约束和去重后的数据集大小。
许可证
数据集中的各个模块受其来源项目的许可证约束。许可证信息在每一行中可用,包括 SPDX 许可证表达式、许可证文件以及指向包源的链接,以进一步验证许可证信息。
数据集的整理工作在 CC-BY-4.0 许可证下发布。
- 1ComPile: A Large IR Dataset from Production Sources加州大学戴维斯分校, 美国 · 2024年



