Repository navigation
[HIP] [JIT] Add Windows support - #2699
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
bfa96cd to
6d207b9
Compare
|
Hello @0xDELUXA, thanks for your PR to AITER! I think it's fair to say this is a big change and we should add other AITER maintainers to the discussion. Can you please file a new feature request issue? You can link this PR as an initial draft and we can proceed with the discussion in the issue. We need to get support from more people and at least have an implementation plan if the idea is approved by AITER technical leadership team. FYI: @valarLip + @carlushuang |
This is not an idea, this is fundamental support for a package AMD is pushing to make a requirement for things like flash-attention. Not supporting an operating system that is currently fully supported by rocm is completely unacceptable. Forgive me for being rude but @stellaraccident @ScottTodd is it time to start pushing AMD consumers of rocm for Windows support? I'm getting really tired of having to fight this everywhere. I can only speak for myself, but it's unimaginably frustrating as a consumer to not only have to put in so much work to get things functional, but then also to watch others put in the same or more effort just to have AMD turn around and refuse or stall the contributions enabling support. |
No offense taken. @brunomazzottiamd this isn't a very complicated change. Pretty bread and butter for windows support stuff. Please have the owners ping me internally to discuss. In general, we do not reject platform support PRs like this or subject them to this level of ceremony. @ROCm/rocm-genies can you please do diligence on this and help me figure out the way to clear it to land and get at least a minimal ci job with it. |
989d35c to
4b15337
Compare
@stellaraccident Thank you very much! I've pushed a rebase onto current Worth noting how much smaller it got. In the ~3.5 months this sat, |
8664211 to
18add7c
Compare
Thank you. |
|
@brunomazzottiamd @valarLip @schung-amd Could I ask if there have been any updates over the past two weeks? I just wanted to check in since I haven’t received any feedback yet. Thank you! |
|
We intend to merge and provision hardware for Windows CI as well as ongoing support. |
|
this one still activite or not? |
It is. I just couldn't keep rebasing after every single commit upstream when this PR hasn't gotten a review comment in four months. I know the maintainers are really overwhelmed and that some users keep opening low-quality AI-generated PRs, but a single “this is bad, close it” comment would still be better than no comment at all. |
18add7c to
571dcd0
Compare
571dcd0 to
71182f9
Compare
71182f9 to
855cfcf
Compare
855cfcf to
78264d4
Compare
628c98d to
9bd0ae3
Compare
|
The latest CI run on 9bd0ae3 confirms the |
|
@ROCm/rocm-genies hey guys, can you all pop this to the top of your queue and work with @sunway513's team to get this landed. We're celebrating this PR's 6 month anniversary. Need to get this in. |
|
@zufayu The failing jobs look unrelated. The Atom accuracy jobs fail on |
|
@0xDELUXA — thanks for seeing this through; six months is a long time to keep a PR alive, and the final version is a careful piece of work. It's merged as We're now standing up Windows CI for aiter, and there's one gap where you're by far the best-placed person to help. Your test plan was TheRock ROCm 7 + Python 3.12. The CI runners we've been allocated ( I've checked the pieces statically and they look right: the If you still have the RDNA4 machine set up, would you be willing to re-run your five ops against it? In a fresh venv: pip install --index-url https://stable.repo.amd.com/rocm/whl-next/ `
--extra-index-url https://pypi.org/simple `
"torch[device-gfx1201]==2.14.0+rocm10.1.0" "rocm[devel]==10.1.0"then What would help most is knowing whether it works at all, and if not, where it breaks — ROCm 10.1 vs 7 is a large jump in HIP version, and a toolchain discovered from No obligation, and no rush — if you'd rather not, we'll find it ourselves on the runners. Also happy to hear if you think ROCm 7 via TheRock is the safer target for CI to start with; you've spent more time on this stack than we have. One small thing I noticed while reading through, unrelated to the above: |
|
One more ask, and this one may be easier than the last. Your test plan says each op runs in its own subprocess against a torch reference, both from the repo and from a We need exactly that for CI. Right now there is no committed test covering any of the five ops — #2699 touched It would also fold neatly into the ROCm 10.1 request above: same script, new toolchain, and we'd get both the harness and the answer in one go. If the script is rough, that's fine — we can clean it up on our side. Happy to review it as a PR, or to take it as a gist and open the PR ourselves with you credited. |
|
ROCm 10.1 + Python 3.13 works, with one bug and one setup step found along the way. The bug: ops using The setup step: the With that, all five ops pass on torch 2.14.0+rocm10.1.0 / rocm[devel] 10.1.0 / Python 3.13, both from the repo and from a The harness is
The pip route seems like the right CI target to me: nothing to preinstall on the runner, and it is how ROCm torch is distributed on Windows now. On |
Motivation
aiter has no Windows support:
__init__.pyforce-enablesAITER_TRITON_ONLYonwin32, and the JIT layer assumes Linux-only tooling (rocminfo,libamdhip64.so,/dev/null,rm -rf, ELF linker flags). This wires the JIT and Python layers up to the Windows ROCm stack so CK- and HIP-based ops compile and run there.Technical Details
Toolchain discovery - ROCm tools ship as
.exe/.batwrappers on Windows, so executable lookup goes through a suffix-aware_find_executable, and_find_rocm_homefalls back toHIP_PATH.get_cxx_compilerreturns hipcc, the only compiler on Windows that can build both the .cpp and .hip sources.GPU info -
chip_infouseshipinfoin place ofrocminfo, with a parser per output format, and loads the version-suffixedamdhip64*.dll.--offload-arch=nativeshells out to offload-arch, which cannot detect the GPU on Windows, sonativeresolves via_detect_native()instead.Build system - ELF/GNU-ld-only flags (
-fPIC,-mcmodel=large,--gc-sections,-fvisibility=*,_GLIBCXX_USE_CXX11_ABI) are excluded on Windows;_ninja_pathescapes drive-letter colons, which ninja otherwise reads as rule separators; PE links againstpythonXYZ.lib;-D_USE_MATH_DEFINESis added since the UCRT only declaresM_SQRT2& friends under it.compile_libdrives hipcc with ninja instead of make.Stale-lock fix -
FileBaton._pid_aliveno longer probes withos.kill(pid, 0)on Windows: CPython maps that ontoTerminateProcess, so the liveness check would kill the very builder it was checking on.Several shell idioms are also replaced with portable equivalents that are more robust on Linux too:
os.system("rm -rf"),os.popen("cat /proc/sys/kernel/numa_balancing"),echo ... | hipcc -, and the shelled-outhipccandhipconfigcalls incsrc/cpp_itfs/utils.py.check_LLVM_MAIN_REVISIONneeded more than the shell change. Its probe relies on CTAD, and at hipcc's default standard on Windows it failed on a template-argument error rather than on the__host__ __device__rule it is meant to measure, so the function returned the same value whatever the toolchain did. The probe is now pinned to-std=c++20, the standard the modules are built with. On Linux clang already defaults tognu++17, so the answer there is unchanged.arch_info.get_arch()now probes Triton on first call instead of at import. Since #5590 the flash-attention Triton backend importstuned_config_utils, which importsarch_info, so importing it on a host with no GPU driver raised and then fell through to thejaxfallback. This is what fails the Windows Smoke Test onmain.Test Plan
Windows 11, RDNA4, TheRock ROCm 7, Python 3.12. Each op runs in its own subprocess against a torch reference, both from the repo and from a
pip install .'d wheel.Test Result
rms_normrmsnorm2d_fwdsilu_and_multopk_softmaxrotary_embedding_fwdimport aiterbuilds and loads the full CK/HIP path - previously Windows exited before any op was loaded.Not covered: ops whose modules run a CK-tile blob generator (layernorm2d, the CK GEMMs, flash-attn). Those generators emit hundreds of specializations and dominate build time on Linux equally, so this is not a Windows-specific gap, but that path is untested here.
Submission Checklist