Skip to content

OpenXiangShan/Deterload

Repository files navigation

确定性负载(Deterload)

确定性负载(Deterload)是一个为香山生态(包括 香山处理器香山NEMU香山GEM5 )生成确定性工作负载的框架。

Deterload is a framework for generating Deterministic Workloads for the XiangShan ecosystem (including XiangShan Processor, XiangShan NEMU, and XiangShan GEM5 ).

背景(Background)

香山是一款开源的高性能RISC-V处理器,其核心理念是敏捷开发。 香山的工作负载指运行在香山处理器上的各类程序,是开发、调试、评估、研究时不可或缺的组件。

XiangShan is an open-source high-performance RISC-V processor, built around the core concept of agile development. XiangShan's workloads refer to various programs running on XiangShan processor, which are essential components for development, debugging, evaluation, and research.

为了能更加敏捷地生成各类工作负载,我们开发了Deterload项目。 Deterload在checkpoint_scripts框架上,引入了确定性。 此外,Deterload不仅支持生成切片镜像,还计划支持香山的各类工作负载,包括非切片镜像和裸机镜像。

To enable more agile generation of various workloads, we developed the Deterload project. Deterload is based on the checkpoint_scripts framework and adds the deterministic feature. Moreover, Deterload not only supports generating checkpoint images but also plans to support various workloads for XiangShan, including non-checkpoint images and bare-metal images.

关于“确定性”(About "Deterministic")

🤔什么是“确定性”? 😺无论何时何地,两次构建同一个工作负载,都应该得到完全相同的结果!

🤔为什么需要“确定性”? 😺它能让开发更敏捷。无论何时何地,你都能轻松重现bug和性能异常!

🤔如何实现“确定性”? 😺使用确定性包管理器Nix并且控制所有随机性!

🤔What is "Deterministic"? 😺It means that whenever and wherever building the workload twice should yield the same result!

🤔Why do we need "Deterministic"? 😺It enables more agile development. You can reproduce bugs and performance anomalies anytime, anywhere, without hassle!

🤔How to achieve "Deterministic"? 😺Using the deterministic package manager Nix and controlling all possible sources of randomness!

使用方法(Usage)

Deterload由Nix驱动。 如果你尚未安装Nix,请参考Nix官方安装指南

Deterload is powered by Nix. If you haven't installed Nix, please refer to the Nix official installation.

# 进入nix shell(推荐使用direnv自动进入nix shell):
# Enter the nix shell (direnv is recommended for auto entering the nix shell):
nix-shell

# 用10个线程为<benchmark>生成切片,切片存于result/:
# Generate checkpoints for <benchmark> using 10 threads, saved in result/:
nom-build -A <benchmark>.cpt -j10

# 通过命令行开启编译器的自动向量化,为<benchmark>生成切片,切片存于result/:
# Enable compiler's auto vectorization by CLI, generate checkpoints for <benchmark>, saved in result/:
nom-build --arg enableVector true -A <benchmark>.cpt

# 或者通过配置文件开启编译器的自动向量化,为<benchmark>生成切片,切片存于result/:
# Or enable compiler's auto vectorization by a config file, generate checkpoints for <benchmark>, saved in result/:
nom-build examples/vector.nix -A <benchmark>.cpt

# 显示帮助信息:
# Display help information:
h

更多文档(More Documentation)

请参考本仓库的GitHub Pages

Please refer to the GitHub Pages of this repo of this documentation.