mozilla / sccache

Sccache is a ccache-like tool. It is used as a compiler wrapper and avoids compilation when possible. Sccache has the capability to utilize caching in remote storage environments, including various cloud storage options, or alternatively, in local storage.
Apache License 2.0
5.85k stars 552 forks source link

Fix non-strict HIP device lib order #2217

Open Snektron opened 4 months ago

Snektron commented 4 months ago

In https://github.com/mozilla/sccache/pull/2045 initial support for HIP was added. While trying it out, I noticed that different runs across different machines did not yield an expected cache hit. After some investigation, it turns out that the list of bitcode device libraries is not sorted after discovering them from the file system, and this resulted in a different order across those machines. I've added a fix that simply sorts those libraries after discovering them, that seems to be similar to how its handled elsewhere.

sylvestre commented 4 months ago

could you please add a test for this ? thanks

codecov-commenter commented 4 months ago

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 40.82%. Comparing base (0cc0c62) to head (48d6ed7). Report is 99 commits behind head on main.

Files with missing lines Patch % Lines
src/compiler/c.rs 0.00% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2217 +/- ## ========================================== + Coverage 30.91% 40.82% +9.91% ========================================== Files 53 55 +2 Lines 20112 20675 +563 Branches 9755 9801 +46 ========================================== + Hits 6217 8440 +2223 - Misses 7922 8100 +178 + Partials 5973 4135 -1838 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Snektron commented 4 months ago

Im not 100% sure what the best way is to add the tests, considering that fully testing that issue requires deleting and then re-adding a file from the HIP bitcode directory (/opt/rocm/amdgcn/bitcode usually). Regardless, I'm away for a few weeks and will finish this when I get back.

Snektron commented 2 days ago

bump

sylvestre commented 1 day ago

still need tests, sorry :)