Skip to content

Bunch of small community fixes - #3935

Open
pggPL wants to merge 10 commits into
NVIDIA:mainfrom
pggPL:small_community_fixes
Open

pggPL wants to merge 10 commits into
NVIDIA:mainfrom
pggPL:small_community_fixes

Conversation

@pggPL

@pggPL pggPL commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Aggregates several small, self-contained community fixes (bug fixes, test fixes, and a docs fix) with original commit authorship preserved so they can be validated and landed together.

Fixes #3914, #3882, #3888

Type of change

  • Documentation change (change only to the documentation, either a fix or a new content)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Infra/Build change
  • Code refactoring

Changes

Checklist:

  • I have read and followed the contributing guidelines
  • The functionality is complete
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@pggPL
pggPL force-pushed the small_community_fixes branch from 8e87d75 to 87a3694 Compare November 24, 2026 15:37
rlaope and others added 9 commits November 24, 2026 16:39
cast_gated_tma rejected outputs that also request column-wise data, but
the delayed-scaling dispatcher already fills column-wise data with a
transpose of the row-wise output after either kernel runs. On SM 12.0,
which needs both usages because it has no non-TN FP8 GEMM, every
delayed-scaling gated activation with an FP8 output hit this assertion.

Require row-wise data instead, which is what the kernel writes.

Signed-off-by: rlaope <105429536+rlaope@users.noreply.github.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
On SM 12.0/12.1 the exact RHT test takes the column-wise reference from
TE's unfused kernel, including the padded scale rows and columns that
the reference quantizer does not compute. That padding is not
initialized, so the test failed whenever the column-wise scale tensor is
padded (e.g. 256x272, 304x304, 32x128).

Slice the native reference to the shape of the reference quantizer's
scales, as the test already does for the kernel under test.

Signed-off-by: rlaope <105429536+rlaope@users.noreply.github.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
TE runs pure FP32 GEMMs with CUBLAS_COMPUTE_32F_FAST_TF32, while the
PyTorch reference modules in test_numerics.py use TF32 only when
torch.backends.cuda.matmul.allow_tf32 is set. NGC containers set it via
TORCH_ALLOW_TF32_CUBLAS_OVERRIDE=1, so CI passes; on a plain PyTorch
install it is False and 72 FP32 cases of test_linear_accuracy,
test_layernorm_linear_accuracy and test_layernorm_mlp_accuracy fail.

Enable TF32 matmul for the PyTorch references through an autouse
fixture, next to the existing BF16 reduced-precision fixture, and
restore the previous value afterwards.

Signed-off-by: rlaope <105429536+rlaope@users.noreply.github.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
…12.x

FusedMLAQUpProjRopeQuant.is_supported() only checks for compute
capability major >= 10, so it returns True on SM 12.0. The cuDNN
frontend gemm_proj_rope_mxfp8 kernel needs tcgen05, which SM 12.x does
not have, and run() then raises "GemmProjRopeMxfp8 requires SM100+
compute capability with tcgen05 (not cc 12.x)". Callers that use
is_supported() to choose the fused path crash instead of falling back.

Return False for major == 12, matching the cuDNN frontend has_tcgen05()
check.

Signed-off-by: rlaope <105429536+rlaope@users.noreply.github.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
…sts as xfail

Five hybrid quantization tests quantize per-tensor FP8 columnwise-only
(NVFP4 rowwise + FP8 columnwise, or columnwise_source=rowwise_dequantized)
but lack the _XFAIL_HOPPER_COLUMNWISE_PER_TENSOR_FP8 marker that the
other tests on this path carry. Where non-TN FP8 GEMM is unsupported
(Hopper, SM 12.x) they fail with "Columnwise-only per-tensor FP8
quantization is not implemented" instead of xfailing.

Add the marker to those tests and mention SM 12.x in its reason. The
marker is strict and conditioned on is_non_tn_fp8_gemm_supported(), so
the tests still run and must pass on SM 10.x.

Signed-off-by: rlaope <105429536+rlaope@users.noreply.github.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Linear._load_from_state_dict added state_dict["bias"] = None when the op
had no bias. torch leaves None parameters out of the keys it expects, so
a strict load reported the added key as unexpected, and a bias-free
te.ops.Linear could not load the state dict it had just saved. Add the
bias key only when the op has a bias.

Run TestCheckpointing.test_linear with bias=False as well as bias=True.

Signed-off-by: Bindu Bhargava R Chintam <bindubhargavareddy@gmail.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
The installation guide tells users to set NVTE_CUDA_INCLUDE_PATH when
CUDA headers are not in a standard location, but nothing reads that
variable. The runtime header lookup in common/util/cuda_runtime.cpp
(used for NVRTC) reads NVTE_CUDA_INCLUDE_DIR, which is also the name
documented in envvars.rst and set by transformer_engine/common/__init__.py.

Use the correct name and link it to its envvars.rst entry.

Fixes NVIDIA#3882

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: ArchanaChetan07 <apatil@sandiego.edu>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
…hape is omitted

Fixes NVIDIA#3888

Signed-off-by: lxcxjxhx <lxcxjxhx@users.noreply.github.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
@pggPL
pggPL force-pushed the small_community_fixes branch from 87a3694 to 163a8eb Compare November 24, 2026 15:40
@pggPL
pggPL marked this pull request as ready for review November 24, 2026 15:55
@pggPL

pggPL commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

/te-ci pytorch core L0

@greptile-apps

greptile-apps Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with no actionable new issues found.

Summary

This PR bundles small fixes for quantization, checkpoint loading, MoE token shapes, tests, and installation docs.

  • Mask-map unpermutation restores the token count from the routing map.
  • Gated FP8 casting accepts outputs that also have columnwise data.
  • Bias-free Linear layers load checkpoints without an extra bias entry.
  • The fused MLA Q projection is offered only on compute-capability 10 GPUs.
  • The NVFP4 scale comparison uses the reference tensor's shape.
  • Numerical tests use TF32 matmul and then restore the prior setting.
  • Five hybrid quantization tests mark unsupported columnwise FP8 cases as expected failures.
  • The installation guide names the CUDA include variable as NVTE_CUDA_INCLUDE_DIR.

No actionable new issues were found in the change since the previous review. No previous review threads were supplied. GPU tests were not run.

Reviews (2) · Last reviewed commit: "[PyTorch] Restrict FusedMLAQUpProjRopeQu..." · Reviewed by Greptile

Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
@pggPL
pggPL requested review from negvet and removed request for Oleg-Goncharov November 24, 2026 17:25

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

5 participants