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

Update IREE third-party/benchmark for RISC-V Compatibility #19538

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

phoebesv
Copy link
Contributor

This PR updates the third-party/benchmark in IREE to address the use of the RDCYCLE instruction on RISC-V. Starting from Linux 6.6[1], RDCYCLE is a privileged instruction and cannot be directly accessed from user space. To ensure compatibility, this update transitions to using RDTIME instead.

Use RDTIME instead, which while less accurate has the advantage of being synchronized between CPU (and thus monotonic) and of constant frequency.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cc4c07c89aada16229084eeb93895c95b7eabaa3

Copy link
Member

@ScottTodd ScottTodd left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM, but we have a little infrastructure issue to work through first it looks like.

third_party/benchmark Show resolved Hide resolved
@ScottTodd ScottTodd self-requested a review December 21, 2024 00:09
ScottTodd added a commit that referenced this pull request Jan 2, 2025
Context:
#19538 (comment)

One workflow failed on a self-hosted runner after changing a submodule
pin:
```
+ git submodule update --init --jobs 8 --depth 1 third_party/benchmark third_party/cpuinfo third_party/flatcc third_party/googletest third_party/hip-build-deps third_party/hsa-runtime-headers third_party/musl third_party/spirv_cross third_party/tracy third_party/vulkan_headers third_party/webgpu-headers
From https://github.com/google/benchmark
 + c19cfee...f4f93b5 main       -> origin/main  (forced update)
From https://github.com/google/benchmark
 * branch            99bdb2127d1fa1cff444bbefb814e105c7d20c45 -> FETCH_HEAD
error: Your local changes to the following files would be overwritten by checkout:
	.github/workflows/pre-commit.yml
	.github/workflows/test_bindings.yml
       ...

Please commit your changes or stash them before you switch branches.
Aborting
fatal: Unable to checkout '99bdb2127d1fa1cff444bbefb814e105c7d20c45' in submodule path 'third_party/benchmark'
```

This adds the `--force` flag to try proceeding anyways. Anyone calling
this script is already delegating the submodule update behavior to it.
This PR updates the third-party/benchmark in IREE to address the use of
the RDCYCLE instruction on RISC-V. Starting from Linux 6.6[1], RDCYCLE is a
privileged instruction and cannot be directly accessed from user space.
To ensure compatibility, this update transitions to using RDTIME
instead.

Use RDTIME instead, which while less accurate has the advantage of being
synchronized between CPU (and thus monotonic) and of constant frequency.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cc4c07c89aada16229084eeb93895c95b7eabaa3

Signed-off-by: Phoebe Chen <[email protected]>
@ScottTodd ScottTodd merged commit c2d408f into iree-org:main Jan 3, 2025
37 checks passed
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