Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advice for reducing test binary size #54

Open
troibe opened this issue Nov 2, 2024 · 4 comments
Open

Advice for reducing test binary size #54

troibe opened this issue Nov 2, 2024 · 4 comments

Comments

@troibe
Copy link
Contributor

troibe commented Nov 2, 2024

We are considering committing the generated testcases into our repository as the generation and compilation takes quite some time.
Currently the 256bit test cases for 64bit and 32bit are around 2G each.
Is this expected?
Are there any special flags enabled that especially increase the binary size?
Do you have any suggestions with regards to reducing binary size?

@jerryz123
Copy link
Contributor

My stage2 Zvl256b_Zve64d test cases are only 56 M. I'm guessing its because I am running in "cosim" mode.

This is my build script: https://github.com/ucb-bar/saturn-vectors/blob/master/build-tests.sh

This script takes 5 minutes on a 72 thread machine.

@jerryz123
Copy link
Contributor

Cosim mode assumes you have lockstep cosimulation of your DUT, so the binary no longer needs to contain the reference results.

@troibe
Copy link
Contributor Author

troibe commented Nov 4, 2024

Thanks for the data points that sounds really promising.
I guess one reason I was considering committing the binaries was getting around the Spike/Go installs.
So with cosim and the required Spike install I'm not sure how much I'd be saving in terms of compute time/space.

I'll definitely try out the cosim mode though for some experiments.
Is cosim mode more compute intensive when running the tests themselves?

@ksco
Copy link
Member

ksco commented Nov 4, 2024

(Sorry for the late reply, I missed this one)

The binary size is mainly contributed by the self-checking stuff, which contains scalar-checking code and a random data section in every elf file, this makes the tests self-contained and easy to use but sacrifices the binary size.

The "cosim" mode removes all the self-checking and relies on the user to check via a Co-simulator, so it can be much smaller in size.

as the generation and compilation takes quite some time

Did you integrate this in the CI? If so, might be a good idea to cache the build outputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants