facebookresearch / CompilerGym

Reinforcement learning environments for compiler and program optimization tasks
https://compilergym.ai/
MIT License
880 stars 123 forks source link

the dataset for runtime reward #794

Closed anthony0727 closed 1 year ago

anthony0727 commented 1 year ago

❓ Questions and Help

Q1. what is the dataset that's fed to exeucution? e.g. what is the array that's fed to benchmark://cbench-v1/qsort?

Q2. what's the unit for RuntimeReward? it's seconds right?

anthony0727 commented 1 year ago

is the dataset from following link? https://sourceforge.net/projects/cbenchmark/files/cDatasets/V1.1/

ChrisCummins commented 1 year ago

Hey @anthony0727!

Q1: Each of the cbench programs have 20 inputs that can be fed into them (from the link you posted above). You specify which of the 20 you want to use by adding a ?dataset=n query parameter when constructing the benchmark. For example:

https://github.com/facebookresearch/CompilerGym/blob/9e0c0beb12da1e1ea82ae6ce920713ee28dda4c9/tests/llvm/datasets/cbench_test.py#L87-L93

If you don't specify a dataset, it defaults to 0.

Q2: Yes, RuntimeReward is in seconds.

Cheers, Chris