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

Fix argument passing #312

Merged
merged 1 commit into from
Dec 11, 2024
Merged

Fix argument passing #312

merged 1 commit into from
Dec 11, 2024

Conversation

zherczeg
Copy link
Collaborator

Unfortunately there was an incorrect subtraction in the original patch. Buffer is only updated if the execution is successful.

A Clang compiled coremark now runs with Walrus. Release, x86 results:

Interp:

2K performance run parameters for coremark.
CoreMark Size    : 666
Total ticks      : 464668
Total time (secs): 464.668000
Iterations/Sec   : 860.829668
Iterations       : 400000
Compiler version : Clang 18.1.2-wasi-sdk (https://github.com/llvm/llvm-project 26a1d6601d727a96f4301d0d8647b5a42760ae0c)
Compiler flags   : -O3 -DPERFORMANCE_RUN=1
Memory location  : Please put data memory location here
                        (e.g. code in flash, data on heap etc)
seedcrc          : 0xe9f5
[0]crclist       : 0xe714
[0]crcmatrix     : 0x1fd7
[0]crcstate      : 0x8e3a
[0]crcfinal      : 0x65c5
Correct operation validated. See README.md for run and reporting rules.
CoreMark 1.0 : 860.829668 / Clang 18.1.2-wasi-sdk (https://github.com/llvm/llvm-project 26a1d6601d727a96f4301d0d8647b5a42760ae0c) -O3 -DPERFORMANCE_RUN=1 / Heap

JIT:

2K performance run parameters for coremark.
CoreMark Size    : 666
Total ticks      : 57659
Total time (secs): 57.659000
Iterations/Sec   : 6937.338491
Iterations       : 400000
Compiler version : Clang 18.1.2-wasi-sdk (https://github.com/llvm/llvm-project 26a1d6601d727a96f4301d0d8647b5a42760ae0c)
Compiler flags   : -O3 -DPERFORMANCE_RUN=1
Memory location  : Please put data memory location here
                        (e.g. code in flash, data on heap etc)
seedcrc          : 0xe9f5
[0]crclist       : 0xe714
[0]crcmatrix     : 0x1fd7
[0]crcstate      : 0x8e3a
[0]crcfinal      : 0x65c5
Correct operation validated. See README.md for run and reporting rules.
CoreMark 1.0 : 6937.338491 / Clang 18.1.2-wasi-sdk (https://github.com/llvm/llvm-project 26a1d6601d727a96f4301d0d8647b5a42760ae0c) -O3 -DPERFORMANCE_RUN=1 / Heap

It looks like it validates its result, which is very good for correctness testing!

@@ -118,17 +118,17 @@ void WASI::args_get(ExecutionState& state, Value* argv, Value* result, Instance*

TemporaryData<void*, 8> pointers(argc);

if (pointers.data() == nullptr) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These checks are unnecessary, because uvwasi checks its input pointers. Instead, we check that the result is success.

Signed-off-by: Zoltan Herczeg [email protected]
Copy link
Collaborator

@clover2123 clover2123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@clover2123
Copy link
Collaborator

BTW Are you going to add coremark benchmark?

@clover2123 clover2123 merged commit e31ecbc into Samsung:main Dec 11, 2024
15 checks passed
@zherczeg zherczeg deleted the args_fixes branch December 11, 2024 05:33
@zherczeg
Copy link
Collaborator Author

It is not a fast benchmark, but it is popular. I am not sure what is the best decision. Maybe it can be part of it, but not always run. What do you think?

@clover2123
Copy link
Collaborator

It seems that the total time taken for this benchmark is not that substantial.
What about adding this benchmark to our CI?

Interp Total time (secs): 464.668000
JIT Total time (secs): 57.659000

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

Successfully merging this pull request may close these issues.

2 participants