Repository navigation
fix(paro): index fused rotation rows in 64 bits (#5196) - #5253
Merged
Merged
Conversation
Qubitium
added a commit
that referenced
this pull request
Nov 19, 2026
Keep the stable-ABI surfaces while taking main's changes: - marlin: adopt the MXFP4/MXFP8 microscaling fix (#5193): the e8m0 type is always available through torch_stable_compat.h, fp16 MXFP4 is rejected with the bfloat16-compute error, and the bf16 path keeps the e8m0 scale pointer. - marlin: take the thread_k/thread_n/num_threads tile override (#5281) in the core schema and the torch-version adapter schema, so the boxed forward keeps matching arity. - paro: keep main's 64-bit row indexing (#5253) and port its Meta kernels (#5225) to STABLE_TORCH_LIBRARY_IMPL, allocating with at::options(). - compat: do not take the AOTI empty fast path for Meta tensors, which have no accelerator index. - exllamav3: register main's bf16 prescale/rescale wrappers with TORCH_BOX.
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.
Fixes #5196.
Problem
gptqmodel_ext/paro/rotation.cuhaddressed activations and outputs with a 32-bitrow(row * h), androtation.cunarrowedseq_len/htointbefore thekernel launch. A long prefill whose
rows * in_featuresproduct exceeds 2^31therefore wrapped to a negative element offset, producing
HSA MEMORY_FAULT/illegal addresson every Paro layer that runs the fused rotation — on bothParoLinear (CUDA) and ParoTritonLinear (ROCm).
#5164 widened only the GEMM; this is the activation-side half of #5096.
Change
rotation.cuh:s/hareint64_tinload_group/store_group/load_coeffsfor all access structs (float, half, bf16-float-workspace), androwis computed in 64 bits before therow * haddress.rotation.cu:int64_t s/h/seq_leninrotate_kernel,rotate_kernel_bf16_float_workspace,rotate_pair_kernelandrotate_pair_grad_kernel; launchers widenh/seq_len, cast the gridextent, and size/scan
partialsin 64 bits. The pair-grad launcher no longertruncates
seq_lentoint.Test
New
tests/kernels/test_paro.py::test_paro_rotation_addresses_rows_above_int32_element_countrotates a 8192-wide tensor with
2**31 // 8192 + 1rows and a non-identitytheta, checks only the populated tail, and compares it to
apply_paro_rotation_reference. Note: the fused rotation extension cannot bebuilt on the development host (no CUDA toolkit /
CUDA_HOME), so the new nodeskips locally and runs in CI where the extension is available. The existing
Paro kernel tests were run on this host: 6 fail / 51 pass both before and after
this change, identically to a clean
origin/maincheckout, because they needthe same CUDA toolkit.