def setUp(self): self.gem5art = artifact.Artifact( { "_id": uuid4(), "name": "test-gem5", "type": "test-binary", "documentation": "This is a description of gem5 artifact", "command": "scons build/X86/gem5.opt", "path": "/", "hash": hashlib.md5().hexdigest(), "git": artifact.getGit(Path(".")), "cwd": "/", "inputs": [], } ) self.gem5gitart = artifact.Artifact( { "_id": uuid4(), "name": "test-gem5-git", "type": "test-git", "documentation": "This is a description of gem5 git artifact", "command": "git clone something", "path": "/", "hash": hashlib.md5().hexdigest(), "git": artifact.getGit(Path(".")), "cwd": "/", "inputs": [], } ) self.runscptart = artifact.Artifact( { "_id": uuid4(), "name": "test-runscript", "type": "test-git", "documentation": "This is a description of runscript aritfact", "command": "git clone something", "path": "/", "hash": hashlib.md5().hexdigest(), "git": artifact.getGit(Path(".")), "cwd": "/", "inputs": [], } ) self.run = gem5Run.createSERun( "test SE run", "gem5/build/X86/gem5.opt", "configs-tests/run_test.py", "results/run_test/out", self.gem5art, self.gem5gitart, self.runscptart, "extra", "params", )
def setUp(self): self.gem5art = artifact.Artifact({ '_id': uuid4(), 'name': 'test-gem5', 'type': 'test-binary', 'documentation': "This is a description of gem5 artifact", 'command': 'scons build/X86/gem5.opt', 'path': '/', 'hash': hashlib.md5().hexdigest(), 'git': artifact.getGit(Path('.')), 'cwd': '/', 'inputs': [], }) self.gem5gitart = artifact.Artifact({ '_id': uuid4(), 'name': 'test-gem5-git', 'type': 'test-git', 'documentation': "This is a description of gem5 git artifact", 'command': 'git clone something', 'path': '/', 'hash': hashlib.md5().hexdigest(), 'git': artifact.getGit(Path('.')), 'cwd': '/', 'inputs': [], }) self.runscptart = artifact.Artifact({ '_id': uuid4(), 'name': 'test-runscript', 'type': 'test-git', 'documentation': "This is a description of runscript aritfact", 'command': 'git clone something', 'path': '/', 'hash': hashlib.md5().hexdigest(), 'git': artifact.getGit(Path('.')), 'cwd': '/', 'inputs': [], }) self.run = gem5Run.createSERun( 'test SE run', 'gem5/build/X86/gem5.opt', 'configs-tests/run_test.py', 'results/run_test/out', self.gem5art, self.gem5gitart, self.runscptart, 'extra','params' )
path = f'{gcc_ver}-microbench' # Register the each benchmark used for test as an artifact for bm in bms: bm = Artifact.registerArtifact( command=''' cd {}/{}; make X86; '''.format(path, bm), typ='binary', name=bm, cwd='{}/{}'.format(path, bm), path='{}/{}/bench.X86'.format(path, bm), inputs=[ experiments_repo, ], documentation= 'microbenchmark ({}) binary for X86 ISA compiled with {}'.format( bm, gcc_ver)) for config in configs: for bm in bms: run = gem5Run.createSERun( f'gem5_validation_skylake_{gcc_ver}_{config}_{bm}', 'gem5/build/X86/gem5.opt', 'gem5-configs/run-se.py', f'results/microbenchmarks/{gcc_ver}/{config}/{bm}', gem5_binary, gem5_repo, experiments_repo, config, os.path.join(path, bm, 'bench.X86')) run.run()
name=bm, cwd='microbench/{}'.format(bm), path='microbench/{}/bench.X86'.format(bm), inputs=[ experiments_repo, ], documentation='microbenchmark ({}) binary for X86 ISA'.format(bm)) if config == 'config_base': for mem in mem_latency: for bm in bm_list: for cpu in cpu_types: run = gem5Run.createSERun( 'X86_config_base_{}'.format(args.bm_list), 'gem5/build/X86/gem5.opt', 'configs-microbench-tests/run_allbenchmarks.py', 'results/X86/run_allbenchmarks/{}/{}/{}'.format( mem, bm, cpu), gem5_binary, gem5_repo, experiments_repo, cpu, mem, os.path.join(path, bm, 'bench.X86')) run.run() elif config == 'config_controlbenchmarks': for mem in mem_latency: for bm in bm_list: if cpu_bp == 'Simple': for config_cpu in Simple_bp: run = gem5Run.createSERun( 'X86_config_control_{}_{}'.format( args.bm_list, cpu_bp), 'gem5/build/X86/gem5.opt', 'configs-microbench-tests/run_controlbenchmarks.py',
) for version in linuxes }""" if __name__ == "__main__": boot_types = ['init', 'systemd'] num_cpus = ['1', '2', '4', '8'] cpu_types = ['Simple'] #mem_types = ['classic']#, 'ruby'] mem_types = ['Slow'] # [SingleCycle][Inf] bm_list = ['MC', 'MCS', 'CCa', 'CCe', 'CCh', 'CCh_st'] #Architecture to run with. arch = 'X86' #'ARM' if arch == 'X86': bm = 'bench.X86' elif arch == 'ARM': bm = 'bench.ARM' path = 'microbench' for bms in bm_list: for cpu in cpu_types: for mem in mem_types: run = gem5Run.createSERun('gem5/build/X86/gem5.opt', 'configs-boot-tests/run_config1.py', gem5_binary, gem5_repo, experiments_repo, cpu, mem, os.path.join(path, bms, bm)) #run_gem5_instance.apply_async((run,)) run.run()
else: cpus = [args.cpu] path = 'microbench' # Register the each benchmark used for test as an artifact for bm in micro_bm_list: bm = Artifact.registerArtifact( command=''' cd microbench/{}; make X86; '''.format(bm), typ='binary', name=bm, cwd='microbench/{}'.format(bm), path='microbench/{}/bench.X86'.format(bm), inputs=[ experiments_repo, ], documentation='microbenchmark ({}) binary for X86 ISA'.format(bm)) for cpu in cpus: for bm in micro_bm_list: run = gem5Run.createSERun( 'skylake_micro-benchmarks_run_{}_{}'.format(cpu, bm), 'gem5/build/X86/gem5.opt', 'gem5-configs/run.py', 'stats/microbenchmark-experiments/{}/{}'.format(cpu, bm), gem5_binary, gem5_repo, experiments_repo, cpu, os.path.join(path, bm, 'bench.X86')) run.run()
'ML2_BW_ldst' 'ML2_BW_st', 'ML2_st', 'MM', 'MM_st', 'STc', 'STL2', 'STL2b' ] for bm in bm_list: bm = Artifact.registerArtifact( command=''' cd microbench/{}; make X86; '''.format(bm), typ='binary', name=bm, cwd='microbench/{}'.format(bm), path='microbench/{}/bench.X86'.format(bm), inputs=[ experiments_repo, ], documentation='microbenchmark ({}) binary for X86 ISA'.format(bm)) for mem in mem_types: for bm in bm_list: for cpu in cpu_types: run = gem5Run.createSERun( 'X86_microbenchmarks_gem5-19'.format(mem, bm, cpu), 'gem5/build/X86/gem5.opt', 'configs-microbench-tests/run_micro.py', 'results/X86/run_micro/{}/{}/{}'.format(mem, bm, cpu), gem5_binary, gem5_repo, experiments_repo, cpu, mem, os.path.join(path, bm, bma)) run.run()
#For configuration 3: #Cache_type: cache_type = 'L1_cache' #'L2_cahe' #L1Cache_sizes. L1D = ['32kB', '128kB', '64kB'] #L2Cache_sizes. L2C = ['1MB', '512kB'] if config == 'config1': if benchmark == 'microbenchmark': for mem in mem_types: for bms in bm_list: for cpu in cpu_types: run = gem5Run.createSERun( 'gem5/build/X86/gem5.opt', 'configs-boot-tests/run_config1.py', gem5_binary, gem5_repo, experiments_repo, cpu, mem, '../benchmarks/microbench/bms/bm') run_gem5_instance.apply_async((run, )) elif benchmark == 'spec': for mem in mem_types: for bms in bm_list: for cpu in cpu_types: run = gem5Run.createSERun( 'gem5/build/X86/gem5.opt', 'configs-boot-tests/run_spec.py', gem5_binary, gem5_repo, experiments_repo, cpu, mem, '../benchmarks/microbench/bms/bm') run_gem5_instance.apply_async((run, )) elif config == 'config2':
for filename in os.listdir('microbench'): if os.path.isdir(f'microbench/{filename}') and filename != '.git': bm_list.append(filename) # create an artifact for each single microbenchmark for bm in bm_list: bm = Artifact.registerArtifact( command=''' cd microbench/{}; make X86; '''.format(bm), typ='binary', name=bm, cwd='microbench/{}'.format(bm), path='microbench/{}/bench.X86'.format(bm), inputs=[ experiments_repo, ], documentation='microbenchmark ({}) binary for X86 ISA'.format(bm)) for bm in bm_list: for cpu in cpu_types: for mem in mem_types: run = gem5Run.createSERun( 'microbench_tests', 'gem5/build/X86/gem5.opt', 'configs-micro-tests/run_micro.py', 'results/X86/run_micro/{}/{}/{}'.format(bm, cpu, mem), gem5_binary, gem5_repo, experiments_repo, cpu, mem, os.path.join('microbench', bm, 'bench.X86')) run_gem5_instance.apply_async((run, os.getcwd()))
], documentation='microbenchmark ({}) binary for X86 ISA'.format(bm)) if (run_opt == 'all'): mems = mem_types cpu_configs = Simple_bp + DefaultO3_bp elif (run_opt == 'sel'): if (cpu_opt == 'Simple'): cpu_configs = Simple_bp elif (cpu_opt == 'O3'): cpu_configs = DefaultO3_bp if (mem_opt == 'all'): mems = mem_types else: mems = [mem_opt] for mem in mems: for bm in control_bm_list: for cpu_config in cpu_configs: idx = cpu_config.find('_') cpu = cpu_config[:idx] bp = cpu_config[idx + 1:] run = gem5Run.createSERun( 'X86_micro-benchmarks_control_flow__run_{}_{}_{}_{}'. format(bp, cpu, mem, bm), 'gem5/build/X86/gem5.opt', 'gem5-configs/configs-microbench-tests/run_controlbenchmarks.py', 'results/microbenchmark-experiments/control-flow/dev1/X86/{}/{}/{}/{}' .format(bp, cpu, mem, bm), gem5_binary, gem5_repo, experiments_repo, cpu_config, mem, os.path.join(path, bm, 'bench.X86')) jobs.append(run) with mp.Pool(mp.cpu_count() // 8) as pool: pool.map(worker, jobs)