[torch] Streamline sccache setup and enable for HIP on Windows #9744
<!-- therock-pr-bot-policy-check -->
✅ All Checks Passed — Ready for Review
| Check | Status | Details |
|---|:---:|---|
| 📝 PR Description | ✅ Pass | — |
| ⛔ Forbidden Files | ✅ Pass | — |
| 🧪 Unit Test | ⚠️ Warning | Error: Source/code files changed without an accompanying unit test.<br>Expected: add at least one test file named like test_<name>.py / test_<name>.cpp (or <name>_test.*).<br>Current: code file(s) changed: external-builds/pytorch/build_prod_wheels.py; no test file found |
| 🔎 pre-commit | ✅ Pass | — |
| 🚫 Draft PR | 🔜 To Be Enabled | — |
| 🚩 Feature Flag | 🔜 To Be Enabled | — |
| 📊 Code Coverage | 🔜 To Be Enabled | — |
| 🤖 therock-pr-bot | ✅ Pass | — |
🎉 All checks passed! This PR is ready for review.
📖 Need help? See the Policy FAQ for details on every check and how to fix failures.
<!-- therock-pr-bot-fix-policies -->
🎉 All checks passed! This PR is ready for review.
Ping?
Did we mean to change it from 100755 to 100644? Approving
Approved these changes.
No, I can change it back.
https://github.com/ROCm/TheRock/pull/9590 also changed another test script, I wonder if coding agents just started doing that 🤔
ethanwee1
ScottTodd
Motivation
We were setting:
We can now just set these options for both platforms:
This will improve build performance (especially on Windows) and allows us to remove layers of indirection in
build_tools/setup_sccache_rocm.py.See also:
Progress on https://github.com/ROCm/TheRock/issues/9091
Follow-up to https://github.com/ROCm/TheRock/pull/8783
Follow-up to https://github.com/ROCm/TheRock/pull/8824
This will improve time to signal for https://github.com/ROCm/TheRock/issues/3291
Related to https://github.com/ROCm/TheRock/pull/9560
Docs: https://github.com/ROCm/TheRock/blob/main/docs/development/hipcc_migration.md
Technical Details
The remote cache server we use is still configured directly in workflow .yml files such as https://github.com/ROCm/TheRock/blob/466276391eb1cef8ac82b550a7dd3180c5951852/.github/workflows/multi_arch_build_portable_linux_pytorch_wheels.yml#L253-L265
This PR deletes
build_tools/setup_sccache_rocm.pyas it reduced down to 3 lines of code, but we could add it back or merge withbuild_tools/github_actions/compute_pytorch_cache_type.pyin the style ofbuild_tools/setup_ccache.py- having the script write the _configuration_ (server to use, other settings).Test Plan
Local testing on Windows
<details><summary>Expand for repro commands</summary>
<p>
</p>
</details>
Cache status | Build time | C/C++ cache hit rate | HIP cache hit rate
-- | -- | -- | --
Cold cache | 24 minutes | 0.00% | 0.00%
Warm cache without
CMAKE_HIP_COMPILER_LAUNCHER| 11 minutes | 72.30% | 0.00%Warm cache with
CMAKE_HIP_COMPILER_LAUNCHER| 6 minutes | 72.30% | 100.00%CI testing on Linux and Windows
I re-ran CI jobs to check cache behavior:
https://github.com/ROCm/TheRock/actions/runs/41889393295/attempts/1?pr=9744 cold cache.
Platform | Build time | C/C++ cache hit rate | HIP cache hit rate
-- | -- | -- | --
Linux | 36m 0s | 99.10% | 0.00%
Windows | 1h 9m 29s | 99.34 % | 0.00%
https://github.com/ROCm/TheRock/actions/runs/41889393295/attempts/2?pr=9744 warm cache
Platform | Build time | C/C++ cache hit rate | HIP cache hit rate
-- | -- | -- | --
Linux | 7m 1s | 99.80% | 100.00%
Windows | 26m 47s | 99.34 % | 100.00%
Submission Checklist