Skip to content

[windows] Convert symlinks to hardlinks during tarfile expansion. - #990

Merged
ScottTodd merged 1 commit into
mainfrom
users/scotttodd/sdk-devel-hardlink
Jul 10, 2025
Merged

ScottTodd merged 1 commit into
mainfrom
users/scotttodd/sdk-devel-hardlink

Conversation

@ScottTodd

Copy link
Copy Markdown
Member

Progress on #827.

This replaces symlinks in the _rocm_sdk_devel folder of a Python install on Windows with hardlinks. Symlinks are not supported in Python wheels (see https://pep-previews--3786.org.readthedocs.build/pep-0778/ for a proposal to change that) so we expand a directory structure containing symlinks from a tarfile on demand. However, Windows has patchy support for symlinks (dependent on registry/policy settings), while hardlinks are more broadly available. For more background information on symlinks vs hardlinks, see https://stackoverflow.com/questions/185899/what-is-the-difference-between-a-symbolic-link-and-a-hard-link .

Tested:

  • Locally on my gfx1100 machine with a source build

    # Build
    python .\build_tools\build_python_packages.py --artifact-dir=D:\projects\TheRock\build/artifacts --dest-dir=D:\projects\TheRock\build/packages --version=7.0.0.dev0
    
    # Generate local index for easy installation (one time)
    pip install piprepo
    piprepo build %HOME%/.therock/packages/dist
    
    # Install, overwriting existing
    pip install rocm[libraries,devel]==7.0.0.dev0 --extra-index-url D:\projects\TheRock\build\packages\dist\simple --force-reinstall --no-cache-dir
    
    # Test
    rocm-sdk test
  • On CI to build a "dev" release: https://github.com/ROCm/TheRock/actions/runs/16177150195

  • On my gfx1151 machine with that dev release

    python -m pip install --index-url https://d25kgig7rdsyks.cloudfront.net/v2/gfx1151/ rocm[libraries,devel]==7.0.0.dev0+98ed4ad77f79822694ec01a36180ec3b95f4bd00
    
    rocm-sdk test
  • On CI with a PyTorch wheel build using that dev release (based on a branch with workflow changes): https://github.com/ROCm/TheRock/actions/runs/16179933739/job/45673986615

@stellaraccident stellaraccident left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Some day I would still love a root cause, but I agree this is likely the least bad option. It does create some possibilities of different failure modes on windows vs linux with respect to canonical paths and such: the end result will be that linux will be more strict with respect to package layering and windows will be more permissive. So in the future, we may see layering issues only on the one OS. If it has to be that way, having Linux be the canary is better, given that Windows is so sensitive and hard to debug anyway.

@ScottTodd
ScottTodd merged commit c1278de into main Jul 10, 2025
@ScottTodd
ScottTodd deleted the users/scotttodd/sdk-devel-hardlink branch July 10, 2025 00:06
@github-project-automation github-project-automation Bot moved this from TODO to Done in TheRock Triage Jul 10, 2025
ScottTodd added a commit that referenced this pull request Jul 10, 2025
Progress on #827 (!!)

Tested at https://github.com/ROCm/TheRock/actions/runs/16185309410,
which triggered these:

* https://github.com/ROCm/TheRock/actions/runs/16186383600 (gfx1151)
* https://github.com/ROCm/TheRock/actions/runs/16186941663 (gfx120X-all)
* https://github.com/ROCm/TheRock/actions/runs/16186966931
(gfx110X-dgpu)

Some next steps after this, roughly in order:

* Monitor scheduled jobs to check that wheels are successfully built and
uploaded
* Download/install and test the wheels on various systems, exercising
components like hipBLASLt
* Update support status:
  * https://github.com/ROCm/TheRock?tab=readme-ov-file#support-status
*
https://github.com/ROCm/TheRock/blob/main/RELEASES.md#python-packages-support-status
* Build torchvision and torchaudio (need some patches)
* Connect with other build/test/release workflows so we get pre-submit,
post-submit, and scheduled coverage for these builds/releases/tests
* Rebase patches onto PyTorch 2.8 (and/or HEAD), land patches upstream
* Add features like Triton support (aotriton?) for optimized flash
attention kernels, etc.
* Expand the list of supported gfx targets

---

~~This depends on some other open PRs, but I have tested parts of it all
the way through to dev wheel publishing and then installation and
testing on a dev machine:
https://github.com/ROCm/TheRock/actions/runs/16181411431/job/45678668536,
#827 (comment)

~~See the other PRs:~~

* ~~#783
* ~~#980
* ~~#988
* ~~#990
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants