Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
178 commits
Select commit Hold shift + click to select a range
fff2245
Changed version to 2.16.0.dev0
ptrendx Apr 20, 2026
264da2b
[Common] Reduced padding kernel compilation time (#2827)
Oleg-Goncharov Apr 21, 2026
2d92aa6
[PyTorch] Fix cuteDSL kernel incorrect numerics when K is 64 aligned …
ksivaman Apr 21, 2026
0e8ff35
fix(readme): update broken links and modernize project description (#…
sbhavani Apr 21, 2026
ee5dcec
Add MXFP8 attention (#2719)
cyanguwa Apr 21, 2026
0be9046
Bias/Dbias Support for GroupedLinear (#2885)
vthumbe1503 Apr 22, 2026
f2ed86b
Add better ordering enforcment to split_overlap_rs gemms. (#2056)
chaseblock Apr 22, 2026
4014f7f
Fix flash attention version check. (#2910)
bbuschkaemper Apr 22, 2026
0a088c1
[PyT] Fix FSDP2 memory leaks for FP8 weight workspaces and transpose …
pstjohn Apr 22, 2026
3c62f42
Make NS coefficients parameter 2D in Python API (#2904)
vcherepanov-nv Apr 22, 2026
a5164fe
[PyTorch] [torch.compile] Remove internal tensor state from Float8Cur…
pggPL Apr 23, 2026
424b031
[PyTorch] Fix CP A2A F16 when NVTE_FP8_DPA_BWD=1 (#2917)
cyanguwa Apr 23, 2026
ab60f4c
fix: scope get_full_cu_seqlens cache key by device and inference mode…
DmCarpe93 Apr 23, 2026
9e55a25
[PyTorch] Fix FA4 selection when FA3 is unavailable. (#2909)
bbuschkaemper Apr 23, 2026
0c2e7b0
Add optimised top-k kernel AIR. (#2890)
dcampora Apr 23, 2026
5d947a0
Fix the race in the dbias computation in MXFP8 quantization and group…
ptrendx Apr 24, 2026
9ad2e7b
Remove uncessary ctype being passed to GroupedGEMMQuant kernel (#2922)
vthumbe1503 Apr 24, 2026
f2e31db
fix: TransformerEngineBaseModule quantizers init values type (#2927)
muutot Apr 27, 2026
82ace62
[Common] Fix "0" literal for compilation (#2934)
cyanguwa Apr 28, 2026
df0025b
[Common, PyTorch] Add triton mHC kernels & pytorch APIs (#2790)
kainzhong Apr 28, 2026
b4aeed1
[PyTorch] Main_Grad buffer isnt overwritten when overwrite_main_grad=…
vthumbe1503 Apr 29, 2026
01aef4f
Correctly pad scaling factor inverses to satisfy cuteDSL requirements…
ksivaman Apr 29, 2026
cc05742
[JAX] Fix bf16 precision loss in TestGroupedDense reference dbias (#2…
tdophung Apr 30, 2026
d156fa6
[JAX] Fix MNIST L2 jax test instability (#2933)
tdophung Apr 30, 2026
a7a2b3b
Variable Grouped Swizzle (#2914)
int-smart Apr 30, 2026
88e6071
[PyTorch] Fusible ops preserve usages in quantized weight tensors (#2…
timmoon10 May 1, 2026
4fafdf2
[Common] Fix incorrect amax initialization in non-RHT NVFP4 C++ tests…
Oleg-Goncharov May 1, 2026
0e9020d
[PyTorch] Cleanup `cudnn-frontend` requirements for fused grouped MLP…
ksivaman May 1, 2026
36fc336
[PyTorch] Add workaround for cuteDSL stride requirement for zero-toke…
ksivaman May 1, 2026
7e8bc98
[Core] Remove unused NVFP4 quantize kernel (#2946)
timmoon10 May 1, 2026
360779b
[JAX] Calculate seqlens and offsets in O(T) space instead of O(T*T) s…
KshitijLakhani May 1, 2026
0803102
Optimizations for MXFP8/NVFP4 dequantize kernels (#2865)
YigongQin May 2, 2026
3e07f5d
[JAX] Remove xla deterministic arg for MNIST test to not timeout L2_j…
tdophung May 4, 2026
ad4b3fd
[PyTorch][Core] Fix CUBLAS GGEMM when weight dims are not divisible b…
vthumbe1503 May 4, 2026
528f16c
[PyTorch] Guard/document single parameter feature for grouped linear …
ksivaman May 4, 2026
3ded616
Graph Safe support for TE Grouped linear Op (#2923)
vthumbe1503 May 5, 2026
3c89426
[Common] Always define cuBLASMp comm GEMM API (#2963)
vcherepanov-nv May 6, 2026
4b6923d
[JAX][Common] Enable cuDNN fused attn backend for NO_MASK + bidirecti…
KshitijLakhani May 6, 2026
2f3eda4
[All] Remove legacy max512 backend (#2949)
cyanguwa May 7, 2026
e8c0dc6
[PyTorch/Common] Remove legacy FP8DS implementation (#2959)
cyanguwa May 7, 2026
b9df401
[Common] Improved fused MoE aux loss kernel for large # of experts (#…
denera May 8, 2026
c74e5aa
Implement row-scaled NVFP4 fprop recipe (#2931)
zianglih May 8, 2026
b1b3026
guard fuser grad checks on non-leaf nodes (#2919)
CarlosGomes98 May 8, 2026
56ff4c6
[PyTorch] Remove internal PyTorch testing helper (#2969)
timmoon10 May 9, 2026
0e28953
Fix nvfp4 convert_and_update_tensor shape check (#2670)
skydoorkai May 9, 2026
25934ac
Refactor tensor class in C++ unit tests (#2962)
timmoon10 May 11, 2026
d73bfa1
[PyTorch] Introduce QuantizerRole (#2620)
negvet May 11, 2026
b7323b1
[Common][PyTorch] Fix int32 overflow and -1 sentinel handling in moe_…
jing-4369 May 11, 2026
282b4fb
[torch.compile][PyTorch] Prepare linear for torch compile (#2967)
pggPL May 11, 2026
6cdd711
[PyTorch] CPU overhead optimizations for te autocast (#2957)
vthumbe1503 May 12, 2026
d5e7087
Disable the RHT fusion for non-SM100 family devices (#2968)
ptrendx May 12, 2026
cb59ef1
[PyTorch] Expose function to bulk-allocate tensors backed by the same…
timmoon10 May 12, 2026
c3fd8f8
fix(CP, FA): the conditional logic in the FA version contains a vulne…
zhujian19891203 May 12, 2026
1800fe3
[Common] Use specialized unfused MXFP8 cast kernels by default (#2958)
Oleg-Goncharov May 12, 2026
f0ab81d
Build Docs fix (#2982)
vthumbe1503 May 12, 2026
4eab389
[JAX] Add wait per multi-proc cleanup in `L0_jax_distributed_unittest…
phu0ngng May 12, 2026
472ae55
Avoid CPU offload wait_event for validation (#2793)
vasunvidia May 12, 2026
c3a1d30
[Core] Report CUDA versions when NVRTC compilation fails (#2842)
timmoon10 May 13, 2026
4631d97
[pyTorch] Replace the make_empty implementation to use C++ implementa…
ptrendx May 13, 2026
76c2a9e
Added the CODEOWNERS file (#2980)
ptrendx May 13, 2026
4322c0a
Remove `epel-release` package from wheel Dockerfiles (#2987)
ksivaman May 14, 2026
c40398c
[JAX] Size autotuned Triton grids per config (#2975)
tdophung May 14, 2026
eca05d3
ci: declare contents:read on Lint workflow (#2989)
arpitjain099 May 14, 2026
583d2d1
Changed VERSION to 2.17.0.dev0
ptrendx May 18, 2026
ca50bbf
Add license to framework sdist builds (#3002)
ksivaman May 19, 2026
b629e6e
docs: fix comm GEMM overlap README typos (#3010)
LeSingh1 May 19, 2026
50ac303
Update `cudnn-frontend` to 1.23.0 (#3003)
ksivaman May 20, 2026
a12f7aa
mnnvl guard (#3013)
francesco-bertolotti May 20, 2026
aab7bc9
Add GitHub actions to automatically mark community contributions (#3007)
ptrendx May 20, 2026
a014300
Split grouped quantize/activations and dbias for faster compilation o…
ptrendx May 21, 2026
8c0f1d2
[JAX] Improve JAX tutorial documentation (#2976)
jberchtold-nvidia May 21, 2026
d95b34c
Fix the permissions in the automatic labeler (#3029)
ptrendx May 21, 2026
82776bc
refactor(distributed): deduplicate TE module class lookups with cachi…
muutot May 21, 2026
390eac8
Fixes to the community labeling GitHub Action (#3030)
ptrendx May 21, 2026
1bd9964
GGEMM+srelu kernels for MxFP8 Nemotron (#2981)
sraman-rgb May 21, 2026
86ade9e
CP Tests batching using subprocess worker pool (#2993)
sudhakarsingh27 May 21, 2026
856d075
Update cudnn-frontend to 1.24.0 (#3016)
sudhakarsingh27 May 22, 2026
9af70a8
[Pytorch][Bug] DCP Checkpoint Loading Fixes for FSDP2 with QuantizedM…
vthumbe1503 May 22, 2026
dc9af4a
Implement 4over6 NVFP4 recipe (#2972)
zianglih May 22, 2026
80ea313
[PyTorch] Add `pad_between_seqs` support for non-CP and CP (A2A and …
sudhakarsingh27 May 23, 2026
7e6ffcc
[Common/PyTorch/JAX] make offset of ClampedSwiGLU configurable (#2938)
hxbai May 26, 2026
937c4de
Add examples for MoE models - Mixtral in TE (#2642)
faradawn May 26, 2026
4442134
[Common] Fix fused MoE aux loss for sequence aux loss (#3018)
harryzhou2000 May 26, 2026
be37e9b
[common] Grouped gemm update - nvfp4 for blackwell and fp8 blockwise …
pggPL May 27, 2026
5f1eaff
[PyTorch] Enable head dim 256 for FA4 (#2932)
yaox12 May 27, 2026
f3c2e74
[fused_router][pytorch] Optimize naive topk path and add perf benchma…
XiaomingFun233 May 28, 2026
439ca21
[JAX] Support new JAX triton_kernel_call_ffi for cuda-graph support (…
jberchtold-nvidia May 28, 2026
ace2a96
[PyTorch] Allocate grouped linear wgrads as tensor views (#3049)
timmoon10 May 28, 2026
9e5a847
Optimize function that loads pointers on GPU (#3001)
timmoon10 May 28, 2026
f8bda5d
[PyTorch] Make `modules.GroupedLinear` graph-safe (#3038)
yaox12 May 29, 2026
af5d1e0
[JAX] Fix L0_jax_unittest docs example test to enforce single-GPU (#…
jberchtold-nvidia May 29, 2026
d1920cf
[JAX] Add an MoE Block (Layer) that compound router, permutation, gro…
tdophung May 29, 2026
79821e2
[Pytorch] Skip the Single Grouped Param Test if NVTE_GROUPED_LINEAR_S…
vthumbe1503 May 29, 2026
2055c6d
[PyTorch Debug] Fix scale_inv_min returning 0 for MXFP8/NVFP4 (#3041)
pggPL Jun 1, 2026
920a7db
Enable NVFP4 fused grouped MLP (#3048)
sraman-rgb Jun 1, 2026
1609c89
Adds GEMM Profiling Guide to TE (#2863)
jomitchellnv Jun 1, 2026
3f1d889
Fix WHEEL Tag mismatch in transformer-engine-cu12 wheels (#2928)
eyupcanakman Jun 2, 2026
b24049b
[Fix] Fix CUTLASS grouped GEMM segfault for empty groups (#3067)
Baibaifan Jun 2, 2026
9028a39
Enable NVFP4 grouped MLP SReLU fusion (#3072)
sraman-rgb Jun 2, 2026
e8102e6
Enable NVFP4 grouped MLP cuDNN wgrad (#3071)
sraman-rgb Jun 2, 2026
f5e500b
Bitmap topk (#3009)
tdophung Jun 2, 2026
c1e827f
[PyTorch] Refactor function to prepare pointers for grouped MLP discr…
timmoon10 Jun 3, 2026
3bca938
increasing precision tolerance (#3060)
francesco-bertolotti Jun 3, 2026
54e5bfc
[JAX] Fallback to old triton ffi for autotuned kernels (#3077)
jberchtold-nvidia Jun 3, 2026
b38c16b
Optimize grouped split metadata preparation (#3075)
zhongbozhu Jun 3, 2026
815bf36
[Common] Comm+GEMM overlap API updated to support cuBlasMp backend (i…
denera Jun 4, 2026
86d4e15
[PyT] Reduce test sizes in fused attn fp8 vs fp16 to avoid OOM (#3020)
vedaanta Jun 4, 2026
5535b09
[PyTorch] Fix FlashAttention 2 head_dim > 192 on sm103 and other arch…
pedramr Jun 4, 2026
64311fe
Add MXFP8 attention unit test with linear and rope layers (#3033)
layalir Jun 4, 2026
1b12177
[PyTorch] Expose interleave and de-interleave function for GLU tensor…
ksivaman Jun 4, 2026
abdb406
[JAX] Support for cuDNN-backed flex attention (#2985)
vcherepanov-nv Jun 4, 2026
97a9bfe
[PyTorch] Support for cuDNN-backed flex attention (#2984)
vcherepanov-nv Jun 4, 2026
f458abe
[PyTorch] Python DType enum (#3039)
vthumbe1503 Jun 4, 2026
0e58073
[PyTorch] Isolate CP pool worker stdout from NCCL/library banners (#3…
sudhakarsingh27 Jun 4, 2026
fc92624
Add the getter and setter of skip_fp8_weight_update_tensor (#3015)
xrennvidia Jun 4, 2026
3f64073
Enable NVFP4 grouped MLP GLU RHT amax path (#3073)
sraman-rgb Jun 5, 2026
720ec27
[PyTorch] NVFP4 RHT cast-fusion: emit GEMM-swizzled scale factors dir…
cael-ling Jun 5, 2026
1ea48eb
[PyTorch] Propagate FP8 graph weight update flag in GroupedLinear (#3…
allenphilipj Jun 5, 2026
8a5af97
[PyTorch] Pad V when Q/V head dims differ (MLA) for THD (#2629)
HollowMan6 Jun 5, 2026
23a3f54
[PyTorch] Fix wrong stream capture for cuteDSL delayed wgrad GEMM (#3…
Wohox Jun 5, 2026
2fd033a
[JAX] Skip score_mod tests on older cuDNN (#3098)
vcherepanov-nv Jun 5, 2026
15b92f2
skip test if TE is not compiled with cusolver (#3096)
francesco-bertolotti Jun 5, 2026
0dd1af2
Test failing from .resolve() when TE is installend in a venv (#3094)
francesco-bertolotti Jun 6, 2026
3fffa55
[PyTorch] Debug CPU offloading in grouped linear and grouped MLP (#3047)
lhb8125 Jun 6, 2026
21ba49c
[Common] Optimize fused router forward/backward kernels (#3012)
harryzhou2000 Jun 8, 2026
2a30d03
[PyTorch] Add joint forward-backward op fusion pass (#3080)
timmoon10 Jun 9, 2026
2323e54
[Common] Reduce shared-memory bank conflicts in the colwise scaling p…
Oleg-Goncharov Jun 9, 2026
96fe4f1
Fix release wheel CUDA index calculation (#3100)
fallintoplace Jun 9, 2026
bb720e3
[JAX] Use TE with_sharding_constraint wrapper even if flax returns su…
KshitijLakhani Jun 9, 2026
da115df
Fix GroupedLinear FP8 calibration loop (#3101)
fallintoplace Jun 9, 2026
b972fa8
Optimize NVFP4 4over6 candidate error path (#3068)
zianglih Jun 9, 2026
4bf946d
Fix convergence table rendering in `README.rst` (#3109)
ksivaman Jun 9, 2026
5fdfbec
[PyTorch] Propagate skip_fp8_weight_update in GroupedLinear during FP…
LeSingh1 Jun 10, 2026
20e185c
Add wheel support for Newton-Schulz method via cuSolverMp (#3004)
ksivaman Jun 10, 2026
9b06f26
[PyTorch] Add op-level activation offload opt-out API (#3108)
lhb8125 Jun 11, 2026
9b38184
guarding max_logits fused attention for cudnn < 9.21.0 (#3091)
francesco-bertolotti Jun 11, 2026
3976a68
Revert "[PyTorch] Add op-level activation offload opt-out API" (#3120)
timmoon10 Jun 11, 2026
91bb9cf
[PyTorch] Refactor grouped MLP into joint forward-backward fused op (…
timmoon10 Jun 11, 2026
cdf5f33
[JAX] Extend tensor inspect utility to dump out tensors in identifiab…
tdophung Jun 11, 2026
318dd94
[Common] Enable NVFP4 2D block scaling in columnwise only (#3027)
negvet Jun 12, 2026
f95573f
[PyTorch] Refactor grouped linear and grouped MLP tests (#3122)
timmoon10 Jun 12, 2026
c3396ee
Expert Parallelism: common C API + NCCL EP backend (#3034)
phu0ngng Jun 13, 2026
547d284
Revert "Expert Parallelism: common C API + NCCL EP backend" (#3126)
phu0ngng Jun 13, 2026
4130d73
[PyTorch] Update cuBLASLt grouped gemm filter (#3119)
yaox12 Jun 16, 2026
4955320
Expert Parallelism: common C API + NCCL EP backend (#3127)
timmoon10 Jun 17, 2026
5d1dddf
[Common] Fix int32 overflow in multi_tensor_apply tensor sizes for nu…
javierdejesusda Jun 22, 2026
c862021
Changed VERSION to 2.17.0
KshitijLakhani Jun 23, 2026
66e8aab
Update FE to 1.25 (#3139)
cyanguwa Jun 23, 2026
ec965c3
Add L2 score mod distributed attention shape (#3147)
vcherepanov-nv Jun 26, 2026
563b9bd
[JAX] Expert Parallelism: JAX primitives + VJPs (#3036)
phu0ngng Jun 27, 2026
d8c17e8
Revert "Add wheel support for Newton-Schulz method via cuSolverMp" (#…
ksivaman Jun 29, 2026
dd6827b
[PyTorch] Expert Parallelism: PyTorch wrapper + autograd ops with sym…
phu0ngng Jun 29, 2026
431e6d8
[Common] Update NCCL submodule to have the fix for MAX_SUPPORTED_TOKE…
phu0ngng Jun 30, 2026
9bb3cf2
[Common] EP C API: version config structs and extend `nvte_ep_prepare…
phu0ngng Jun 30, 2026
eb5c54b
[JAX] Keep the routing map format alive and EP multiprocess tests in …
KshitijLakhani Jul 1, 2026
2e559f0
Disable cuDNN 9.23.0/9.23.1 for MXFP8 attention (#3173)
cyanguwa Jul 6, 2026
fbcaca7
Merge upstream NVIDIA TransformerEngine release_v2.17 into ROCm dev
AllenFarcas Jul 7, 2026
0cf6b69
Fix ROCm build for the v2.17 IFU
AllenFarcas Jul 7, 2026
87991f8
Gate cpp test scale accessors on FP8/scale presence
AllenFarcas Jul 9, 2026
3350726
Merge remote-tracking branch 'origin/dev' into IFU-dev-20260706-v2.17
AllenFarcas Jul 9, 2026
4e94fd7
Fix NVFP4 dequant scale on ROCm fnuz archs
AllenFarcas Jul 10, 2026
c0a327e
Guard ROCm-unsupported cpp operator tests after v2.17 IFU
AllenFarcas Jul 10, 2026
bebd247
Fix NVFP4 GEMM NoneType crash from swizzle no-op on ROCm
AllenFarcas Jul 12, 2026
93f8888
Enable row-scaled NVFP4 quantization on ROCm
AllenFarcas Jul 12, 2026
306a371
Route grouped-tensor GEMM through general_grouped_gemm on ROCm
AllenFarcas Jul 12, 2026
f88abf7
Fix circular import in quantized_tensor.py on ROCm
AllenFarcas Jul 12, 2026
fdc9510
Fix Triton current-scaling quantize on ROCm
AllenFarcas Jul 12, 2026
c99b4d7
Add roles param to MXFP4BlockScalingRecipeState
AllenFarcas Jul 12, 2026
6b16a30
Skip ROCm-unsupported NVFP4 features and update tests for v2.17
AllenFarcas Jul 12, 2026
bd8c404
Fix stale test_numerics -k filter after recipe-id rename
AllenFarcas Jul 12, 2026
cdd4e9c
Accept NVFP4TensorStorage in NVFP4Quantizer.update_quantized
AllenFarcas Jul 12, 2026
9c2bbda
Fix NVFP4 dequantize recursion on CPU-offloaded tensors
AllenFarcas Jul 13, 2026
2f2b5fc
Fix FSDP2 all-gather for Float8 current scaling on ROCm
AllenFarcas Jul 13, 2026
6191576
xfail NVFP4 async DCP parity on ROCm (torch 2.8 stager limitation)
AllenFarcas Jul 13, 2026
35418cb
xfail primary-FP8 + FSDP2 forward mem accumulation on ROCm (#2681)
AllenFarcas Jul 13, 2026
a6bbb7c
Fix fused-attn bwd layout for CPU-offload reload on ROCm
AllenFarcas Jul 13, 2026
990bf8b
Don't force FlashAttention THD pad-between-seqs leg on ROCm
AllenFarcas Jul 13, 2026
77fb261
Use arch-aware E4M3 max for NVFP4 encode scale on ROCm
AllenFarcas Jul 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 2 additions & 6 deletions .github/actions/build-pytorch-wheel/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,5 @@ RUN CUDA_MAJOR_VERSION=$(echo $CUDA_VERSION | awk -F \. {'print $1'}) && \
# Install PyTorch
RUN export MATRIX_CUDA_VERSION=$(echo $CUDA_VERSION | awk -F \. {'print $1 $2'}) && \
export MATRIX_TORCH_VERSION=$(echo $TORCH_VERSION | awk -F \. {'print $1 "." $2'}) && \
export TORCH_CUDA_VERSION=$(python -c "from os import environ as env; \
minv = {'2.5': 118, '2.6': 118, '2.7': 118, '2.8': 126, '2.9': 126}[env['MATRIX_TORCH_VERSION']]; \
maxv = {'2.5': 124, '2.6': 126, '2.7': 128, '2.8': 129, '2.9': 130}[env['MATRIX_TORCH_VERSION']]; \
print(minv if int(env['MATRIX_CUDA_VERSION']) < 120 else maxv)" \
) && \
pip install --no-cache-dir torch==${TORCH_VERSION} --index-url https://download.pytorch.org/whl/cu${TORCH_CUDA_VERSION}
export TORCH_CUDA_VERSION=$(python -c "from os import environ as env; versions = {'2.5': (118, 124), '2.6': (118, 126), '2.7': (118, 128), '2.8': (126, 129), '2.9': (126, 130)}; minv, maxv = versions[env['MATRIX_TORCH_VERSION']]; print(minv if int(env['MATRIX_CUDA_VERSION']) < 120 else maxv)") && \
pip install --no-cache-dir torch==${TORCH_VERSION} --index-url https://download.pytorch.org/whl/cu${TORCH_CUDA_VERSION}
63 changes: 63 additions & 0 deletions .github/workflows/community_label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# See LICENSE for license information.

# A workflow to automatically label the contributions as community/org
name: Label community contributions

on:
pull_request_target:
types: [opened, reopened, ready_for_review, synchronize]

permissions:
contents: read
issues: write
pull-requests: write

jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3
with:
script: |
const pr = context.payload.pull_request;
const user = pr.user.login;
const association = pr.author_association;

const communityLabel = "community-contribution";
const orgLabel = "org-contribution";

let targetLabel = null;

const isOrgMember =
association === "MEMBER" || association === "OWNER";

let permission = "none";

try {
const res = await github.rest.repos.getCollaboratorPermissionLevel({
owner: context.repo.owner,
repo: context.repo.repo,
username: user,
});
permission = res.data.permission;
} catch (e) {
if (e.status !== 404) throw e;
}

const isCore = permission === "write" || permission === "admin";
if (!isOrgMember) {
targetLabel = communityLabel;
} else {
targetLabel = orgLabel;
}

if (!isCore) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
labels: [targetLabel],
});
}
2 changes: 2 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ concurrency:
# Group by workflow name + PR number (for PRs) or ref (for branch/tag pushes)
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
pytorch_cpplint:
name: 'PyTorch C++'
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@
[submodule "3rdparty/ck_jit"]
path = 3rdparty/ck_jit
url = https://github.com/ROCm/ck-jit.git
[submodule "3rdparty/nccl"]
path = 3rdparty/nccl
url = https://github.com/NVIDIA/nccl.git
1 change: 1 addition & 0 deletions 3rdparty/nccl
Submodule nccl added at a6b5de
24 changes: 24 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# IMPORTANT:
# This file is ONLY used to subscribe for notifications for PRs
# related to a specific file path. Approvals from people in this
# file are not required for merges.

# C API
/transformer_engine/common/include/ @ptrendx

# TE/JAX
/transformer_engine/jax/ @jberchtold-nvidia

# TE/PyTorch
/transformer_engine/pytorch/ @ksivaman

# te.ops API
/transformer_engine/pytorch/ops/ @timmoon10

# Quantization kernels
/transformer_engine/common/cast/ @Oleg-Goncharov

# Attention
/transformer_engine/pytorch/attention/ @cyanguwa
/transformer_engine/common/fused_attn/ @cyanguwa
/transformer_engine/jax/cpp_extensions/attention.py @KshitijLakhani
36 changes: 17 additions & 19 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -353,21 +353,19 @@ precision-like API that can be used seamlessly with your framework-specific code
framework agnostic C++ API that can be integrated with other deep learning libraries to enable FP8
support for Transformers.

As the number of parameters in Transformer models continues to grow, training and inference for
architectures such as BERT, GPT and T5 become very memory and compute-intensive. Most deep learning
frameworks train with FP32 by default. This is not essential, however, to achieve full accuracy for
many deep learning models. Using mixed-precision training, which combines single-precision (FP32)
with lower precision (e.g. FP16) format when training a model, results in significant speedups with
minimal differences in accuracy as compared to FP32 training. With Hopper GPU
architecture FP8 precision was introduced, which offers improved performance over FP16 with no
degradation in accuracy. Although all major deep learning frameworks support FP16, FP8 support is
not available natively in frameworks today.

TE addresses the problem of FP8 support by providing APIs that integrate with popular Large Language
Model (LLM) libraries. It provides a Python API consisting of modules to easily build a Transformer
layer as well as a framework-agnostic library in C++ including structs and kernels needed for FP8
support. Modules provided by TE internally maintain scaling factors and other values needed for FP8
training, greatly simplifying mixed precision training for users.
As Transformer models scale to hundreds of billions of parameters across large language models,
MoE architectures, and multimodal models, training and inference become increasingly
memory and compute-intensive. Mixed-precision training, which combines single-precision (FP32) with
lower precision formats, delivers significant speedups with minimal impact on accuracy. FP8, introduced
with the Hopper GPU architecture, offers further performance gains over FP16 with no degradation in
accuracy, and newer formats like MXFP8 and NVFP4 on Blackwell push efficiency even further.

TE integrates with popular LLM frameworks and provides optimizations that make low-precision training
work seamlessly with advanced features like MoE, tensor/sequence/context parallelism, and fused
operations. It provides a Python API consisting of modules to easily build a Transformer layer as
well as a framework-agnostic library in C++ including structs and kernels needed for FP8 support.
Modules provided by TE internally maintain scaling factors and other values needed for FP8 training,
greatly simplifying mixed precision training for users.

Highlights
==========
Expand Down Expand Up @@ -455,7 +453,7 @@ Flax
for _ in range(10):
loss, (param_grads, other_grads) = fwd_bwd_fn(params, other_variables, inp)

For a more comprehensive tutorial, check out our `Getting Started Guide <https://docs.nvidia.com/deeplearning/transformer-engine/user-guide/getting_started.html>`_.
For a more comprehensive tutorial, check out our `Getting Started Guide <https://docs.nvidia.com/deeplearning/transformer-engine/user-guide/getting_started/index.html>`_.

.. overview-end-marker-do-not-remove

Expand Down Expand Up @@ -697,7 +695,7 @@ FP8 and MXFP8 have been tested extensively across different model architectures
+------------+------------------+---------------------------------------------------------------------------------------------------------+
| Model | Framework | Source |
+============+==================+=========================================================================================================+
| MPT-1.3B | Mosaic Composer | https://www.mosaicml.com/blog/coreweave-nvidia-h100-part-1 |
| MPT-1.3B | Mosaic Composer | https://www.databricks.com/blog/coreweave-nvidia-h100-part-1 |
+------------+------------------+---------------------------------------------------------------------------------------------------------+
| LLama2-7B | Alibaba Pai | https://mp.weixin.qq.com/s/NQT0uKXLbXyh5031zBdeBQ |
+------------+------------------+---------------------------------------------------------------------------------------------------------+
Expand Down Expand Up @@ -773,8 +771,8 @@ Previous News
:alt: H200

* [11/2023] `Inflection-2: The Next Step Up <https://inflection.ai/inflection-2>`_
* [11/2023] `Unleashing The Power Of Transformers With NVIDIA Transformer Engine <https://lambdalabs.com/blog/unleashing-the-power-of-transformers-with-nvidia-transformer-engine>`_
* [11/2023] `Unleashing The Power Of Transformers With NVIDIA Transformer Engine <https://lambda.ai/blog/unleashing-the-power-of-transformers-with-nvidia-transformer-engine>`_
* [11/2023] `Accelerating PyTorch Training Workloads with FP8 <https://towardsdatascience.com/accelerating-pytorch-training-workloads-with-fp8-5a5123aec7d7>`_
* [09/2023] `Transformer Engine added to AWS DL Container for PyTorch Training <https://github.com/aws/deep-learning-containers/pull/3315>`_
* [06/2023] `Breaking MLPerf Training Records with NVIDIA H100 GPUs <https://developer.nvidia.com/blog/breaking-mlperf-training-records-with-nvidia-h100-gpus/>`_
* [04/2023] `Benchmarking Large Language Models on NVIDIA H100 GPUs with CoreWeave (Part 1) <https://www.mosaicml.com/blog/coreweave-nvidia-h100-part-1>`_
* [04/2023] `Benchmarking Large Language Models on NVIDIA H100 GPUs with CoreWeave (Part 1) <https://www.databricks.com/blog/coreweave-nvidia-h100-part-1>`_
5 changes: 2 additions & 3 deletions benchmarks/benchmark_rht_cast.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import torch.utils.benchmark as benchmark

import transformer_engine.pytorch as te
import transformer_engine_torch as tex
import transformer_engine.pytorch.cpp_extensions as ext

from transformer_engine.pytorch.tensor.nvfp4_tensor import NVFP4Quantizer
Expand All @@ -17,7 +16,7 @@
permute_scale = False

TORCH_TO_TE_FLOAT_MAP = {
torch.bfloat16: tex.DType.kBFloat16,
torch.bfloat16: te.DType.kBFloat16,
}


Expand All @@ -31,7 +30,7 @@ def run_kernel(shape, stochastic_rounding: bool, input_dtype=torch.bfloat16):

# Quantize
nvfp4_quantizer = NVFP4Quantizer(
fp4_dtype=tex.DType.kFloat4E2M1,
fp4_dtype=te.DType.kFloat4E2M1,
rowwise=True,
columnwise=True,
with_amax_reduction=False,
Expand Down
189 changes: 189 additions & 0 deletions benchmarks/benchmark_rht_cast_swizzle_fusion.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
# Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# See LICENSE for license information.

"""Benchmark NVFP4 RHT cast-fusion with vs without fused GEMM-swizzled SF output.

For each shape we measure two paths and two builds:

* path = "quant_only": just NVFP4Quantizer(x)
* path = "quant_plus_swizzle": NVFP4Quantizer(x) + tex.swizzle_scales_for_gemm_(t)
(this is what te.Linear -> tex.generic_gemm does right before the
cuBLAS LT NVFP4 GEMM dispatch)

* build = "baseline": optimize_for_gemm=False
-> quant kernel emits compact SF;
tex.swizzle_scales_for_gemm_ launches the standalone
swizzle_{row,col}_scaling_kernel pass before GEMM.
* build = "swizzle_fusion": optimize_for_gemm=True
-> quant kernel emits GEMM-swizzled SF directly (via the
kEnableSwizzleSFOutput compile-time switch in
row_cast_col_hadamard_transform_cast_fusion.cu);
tex.swizzle_scales_for_gemm_ early-returns and the standalone
swizzle pass disappears from the timeline.

The wall-clock delta on the "quant_plus_swizzle" path is the production
saving of this PR.
"""

import argparse
import torch
import pandas as pd
import torch.utils.benchmark as benchmark

import transformer_engine.pytorch as te # noqa: F401 must be first per te-python-import-order
import transformer_engine_torch as tex
from transformer_engine.pytorch.tensor.nvfp4_tensor import NVFP4Quantizer


def make_quantizer(optimize_for_gemm: bool) -> NVFP4Quantizer:
q = NVFP4Quantizer(
fp4_dtype=tex.DType.kFloat4E2M1,
rowwise=True,
columnwise=True,
with_amax_reduction=False,
amax_reduction_group=None,
with_rht=True,
with_post_rht_amax=True,
with_random_sign_mask=True,
)
q.optimize_for_gemm = optimize_for_gemm
return q


def _bench(stmt: str, globals_dict: dict, min_run_time: float) -> float:
"""Returns median wall-clock per call in microseconds."""
timing = benchmark.Timer(
stmt=stmt,
globals=globals_dict,
num_threads=1,
).blocked_autorange(min_run_time=min_run_time)
return timing.median * 1e6


def run_shape(shape, min_run_time: float):
M, K = shape
assert M % 16 == 0 and K % 16 == 0, "Shape must be divisible by 16"

x = torch.randn([M, K], dtype=torch.bfloat16, device="cuda")
q_base = make_quantizer(optimize_for_gemm=False)
q_swf = make_quantizer(optimize_for_gemm=True)

# quant_only path
quant_only_base_us = _bench(
stmt="q(x)",
globals_dict={"q": q_base, "x": x},
min_run_time=min_run_time,
)
quant_only_swf_us = _bench(
stmt="q(x)",
globals_dict={"q": q_swf, "x": x},
min_run_time=min_run_time,
)

# quant_plus_swizzle path (this is what te.Linear actually runs)
quant_plus_swizzle_base_us = _bench(
stmt="t = q(x); tex.swizzle_scales_for_gemm_(t)",
globals_dict={"q": q_base, "x": x, "tex": tex},
min_run_time=min_run_time,
)
quant_plus_swizzle_swf_us = _bench(
stmt="t = q(x); tex.swizzle_scales_for_gemm_(t)",
globals_dict={"q": q_swf, "x": x, "tex": tex},
min_run_time=min_run_time,
)

saved_us = quant_plus_swizzle_base_us - quant_plus_swizzle_swf_us
speedup = (
quant_plus_swizzle_base_us / quant_plus_swizzle_swf_us
if quant_plus_swizzle_swf_us > 0
else float("inf")
)

print(
f" shape={shape}: quant_only base={quant_only_base_us:.2f}us, "
f"SUT={quant_only_swf_us:.2f}us | "
f"quant+swizzle base={quant_plus_swizzle_base_us:.2f}us, "
f"SUT={quant_plus_swizzle_swf_us:.2f}us "
f"-> saved {saved_us:.2f}us ({speedup:.2f}x)"
)

return {
"shape": shape,
"M": M,
"K": K,
"quant_only_base_us": quant_only_base_us,
"quant_only_swf_us": quant_only_swf_us,
"quant_plus_swizzle_base_us": quant_plus_swizzle_base_us,
"quant_plus_swizzle_swf_us": quant_plus_swizzle_swf_us,
"saved_us": saved_us,
"speedup": speedup,
}


# Nsight Compute Profiling Command (for verifying the swizzle kernel disappears):
# ncu -f -o swizzle_fusion --set=full \
# --kernel-name "regex:swizzle_(row|col)_scaling_kernel|cast_col_hadamard_transform_cast_fusion" \
# -s 5 -c 10 python benchmarks/benchmark_rht_cast_swizzle_fusion.py --profile


if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"--profile",
action="store_true",
help="Run only one shape for use with ncu/nsys; longer min_run_time",
)
parser.add_argument(
"--min-run-time",
type=float,
default=2.0,
help="Minimum total measured time per cell in seconds (benchmark.Timer)",
)
parser.add_argument(
"--csv",
type=str,
default="benchmark_rht_cast_swizzle_fusion.csv",
help="CSV output path",
)
args = parser.parse_args()

if args.profile:
print("Profiling mode enabled (single shape).")
shapes = [(8192, 4096)]
min_run_time = max(5.0, args.min_run_time)
else:
shapes = [
# production-class shapes
(8192, 5120),
(8192, 10240),
(8192, 2560),
(8192, 11328),
(8192, 3584),
(5120, 8192),
(10240, 8192),
(2560, 8192),
(11328, 8192),
(3584, 8192),
(4096, 16384),
(14336, 16384),
]
min_run_time = args.min_run_time

print(
"NVFP4 RHT cast-fusion: swizzle-fusion (optimize_for_gemm=True) vs baseline. "
f"min_run_time={min_run_time}s per cell, BF16 input, "
"rowwise+columnwise SF, RHT=True+post_rht_amax."
)
rows = []
for shape in shapes:
print(f"Running {shape} ...")
rows.append(run_shape(shape, min_run_time))

df = pd.DataFrame(rows)
pd.set_option("display.max_columns", None)
pd.set_option("display.width", 200)
print()
print(df.to_string(index=False))
df.to_csv(args.csv, index=False)
print(f"\nWrote {args.csv}")
Loading