Repository navigation
Fix Windows ARM64 native build: portable noinline and alignCast on DXGI vtable casts - #4991
Open
niterider804 wants to merge 1 commit into
Open
niterider804 wants to merge 1 commit into
niterider804 wants to merge 1 commit into
Conversation
Contributor
|
I independently reproduced the Zig half on Apple silicon with Zig 0.17.0. I compiled a tiny exported wrapper around the production zig build-obj -lc -target aarch64-windows-gnu --dep sys \
-Mroot=zig/src/server/device/dxgi_compile_probe.zig \
-Msys=zig/src/platform/sys.zig -femit-bin=dxgi.objThe wrapper body was Igor Lessio - AIFLOW LABS |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Before:
zig build native -Dsm=121fails on Windows ARM64 (MSVC host compiler) at two places. After: it builds and the binary runs.zig/kernels/cuda/glm_index_rope.cuh:12: GCC's__attribute__((noinline))becomes CUDA's portable__noinline__(already used inwindow_rows.cuhandwindow_split.cuh). nvcc with MSVC rejects the GCC form, soglm_glue.fatbinandglm_index.fatbinfail.zig/src/server/device/read.zig(win.adapters): the four DXGI vtable casts become@ptrCast(@alignCast(...)). On aarch64-windows a function pointer has alignment 4, and Zig 0.17 rejects@ptrCastfrom*const anyopaquealone ("@ptrCast increases pointer alignment"). x86_64 needs no extra alignment, which is why the x86_64 CI check passes.ed70f71aa); one commit.atc overlap --json: not run, ATC isn't installed here. Issue Windows ARM64 (RTX Spark N1X) native build: two compile errors on v1.3.4 (glm_index_rope noinline, read.zig alignCast) #4967 is my own report, and the maintainer invited this PR in it.Checks on this head
fc7c16b5e3(one commit oned70f71aa)python3 tools/zig/lean_check.py, on the base and on this head: base 165 problems, head 165 problems,lean_new.py:0 new(all 165 inherited).zig build native -Dsm=121 -Dstrip=true -Dnvcc=<CUDA 13.4>\bin\nvcc.exeon baseed70f71aa: fails,nvcc (glm_glue.fatbin) failure,nvcc (glm_index.fatbin) failure, exit 1.tensorfold-native --versiongives1.3.4.tensorfold-native device --rescan(exercises the patched DXGI path) givesGPU 0: NVIDIA RTX Spark N1X ... sm_121 (from the driver).zig fmt --check zig/src/server/device/read.zig: pass.git diff --check: pass.zig build test test-golden: not run on this Windows ARM64 laptop. Neither change touches a host-test path that differs on Linux or macOS. CI covers those.kernel-contract: not run, because the GPU was busy with another long job. I can run it on the N1X if wanted.Receipt
__noinline__is CUDA's documented function qualifier for the same no-inline hint; nvcc handles it on every host compiler, and the CUDA kernels already use it (window_rows.cuh,window_split.cuh). I expect no codegen change on Linux, but I haven't checked that there.@alignCastadds only a safety assertion.ed70f71aa. Zig 0.17.0 (.zig-version), aarch64-windows. CUDA 13.4.92 Windows-on-Arm redist (nvcc V13.4.92). MSVC 14.44 HostARM64/arm64. NVIDIA RTX Spark N1X, sm_121, 128 GB unified. Windows 11 build 28000.tools/bench_concurrent.py --alone --serialortoken_shaagainst"draft": false: not run. No GLM checkpoint is on this machine, and the change doesn't alter arithmetic: the inlining hint keeps its meaning, and alignCast is an assertion.tools/bench_openai.py: n/a for the same reason. The v1.3.4 numbers with this patch are in Windows ARM64 (RTX Spark N1X) native build: two compile errors on v1.3.4 (glm_index_rope noinline, read.zig alignCast) #4967.Kernel contract, only when a GPU kernel is new or changed
glm_rope::turnis spelled portably.SUMMARYline and exit status: not run (see Not run).Checklist
The title and description match the head commit, including the receipt and the stack.
New tests fail before the change, pass after it, and skip cleanly without their dependency. (No new tests: this is a build fix. The base build failing and the head build passing are shown above.)
Comments and docstrings are one line. No measurements or history in the source.
No personal data, machine names, internal hosts or local paths in the diff or its commits. No AI attribution lines.
Every token still goes through the lane rounds. No serial path, and nothing that needs drafts off.
Drafted output equals
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (Not run, see Exactness.)No precision traded for speed. If the bits change, the description says which sums change and why.
Decode and prompt processing are no slower than main at one stream and the widest admitted; with
--drafter, no slower than without it, greedy and sampled. (n/a on this machine, see Receipt.)