Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
a9cd697
[PyTorch] DotProductAttention: declarative packed qkv/kv inputs
pggPL Jul 7, 2026
5f70d12
[PyTorch] MultiheadAttention: pass packed projection output to DPA de…
pggPL Jul 8, 2026
5713048
[PyTorch] DotProductAttention: factor packed-input handling into _unp…
pggPL Jul 9, 2026
2255bcc
[PyTorch] DotProductAttention: validate packed-input last-dim stride
pggPL Jul 9, 2026
dc4469b
[PyTorch] DotProductAttention: pass packed qkv/kv buffers as separate…
pggPL Jul 9, 2026
f82ba70
[PyTorch] Move packed qkv/kv input tests into test_attention.py
pggPL Jul 9, 2026
5cd0351
[PyTorch] Deprecate pointer-based detection of packed qkv layouts
pggPL Jul 9, 2026
361a2a0
[PyTorch] Fix implicit string concatenation lint warning
pggPL Jul 9, 2026
627dd3f
[PyTorch] Trim packed-input test section to equivalence and MHA tests
pggPL Jul 9, 2026
a6c454a
[PyTorch] Drop MHA packed pass-through tests
pggPL Jul 10, 2026
f453389
[PyTorch] Fold packed-input tests into test_dpa_qkv_layout via a decl…
pggPL Jul 10, 2026
2e0f32d
[PyTorch] Shrink declarative packed-input tests to a dedicated small …
pggPL Jul 10, 2026
36cf09e
[PyTorch] Use explicit q/k/v grad variables in the DPA test harness
pggPL Jul 10, 2026
09abe74
Merge branch 'main' of https://github.com/NVIDIA/TransformerEngine in…
pggPL Jul 10, 2026
560e246
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 10, 2026
86bb5bc
[PyTorch] Address review: warning stacklevel, offload suppression, ex…
pggPL Jul 10, 2026
b782ea6
TE EP integration to MoEBlock (#3116)
tdophung Jul 10, 2026
6377ca1
[PyTorch] Fix GIL/refcount abort in Comm+GEMM overlap and NCCL-EP ini…
denera Jul 10, 2026
aef96db
Migrate norms and softmax kernels to NVRTC (#3156)
CarlosGomes98 Jul 14, 2026
215e15e
[Common] Support scaled & clamped swiglu, srelu for BF16 (#3132)
zhongbozhu Jul 14, 2026
70957ad
[Common] Pass cu_seqlens and token-unit ragged offsets directly to cu…
egilliam-nv Jul 14, 2026
bfdf24d
[PyTorch] Add per-version FlashAttention env vars (NVTE_FLASH_ATTN_V2…
wdykas Jul 15, 2026
eabdd46
Update list of authorized CI users (#3211)
timmoon10 Jul 15, 2026
9d92fa0
Fix Cuda Graph based MOE Tests Hang in CI (#3210)
vthumbe1503 Jul 15, 2026
68493d2
[PyTorch] Add optional caller-provided output/grad-input buffers to …
phu0ngng Jul 17, 2026
868d8d9
Fix FusedAdam empty tensor handling (#3212)
wujingyue Jul 20, 2026
870a68e
Changed VERSION to 2.19.0.dev0 (#3228)
KshitijLakhani Jul 21, 2026
622a3ee
[PyTorch] NCCL EP zero copy with symmem pool and user provided recv_t…
YangFei1990 Jul 21, 2026
73c72ff
[Common] Migrate NCCL EP submodule to NVIDIA/nccl-extensions (#3222)
phu0ngng Jul 22, 2026
098b496
[PyTorch] Enable fused FP8 block-scaling path in GroupedLinear module…
denera Jul 22, 2026
8280f02
Fix nccl-extensions submodule name (#3239)
phu0ngng Jul 22, 2026
7b55d30
[JAX] Schedule EP dispatch/combine on XLA collective stream (#3231)
phu0ngng Jul 22, 2026
c9a1f5a
Generalized Tensor Parallelism (GTP) (#3005)
fanshiqing Jul 22, 2026
8abfa2e
Update list of authorized CI users (#3241)
timmoon10 Jul 22, 2026
4adad4c
[Common] Fix Build: NCCL EP build to respect `MAX_JOBS` (#3138)
phu0ngng Jul 22, 2026
94c868e
Merge remote-tracking branch 'upstream/main' into dpa_packed_qkv_api
pggPL Jul 23, 2026
457772b
[PyTorch] Address review nits: clarify DPA packed-input docstrings
pggPL Jul 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ SpacesInParensOptions:
InEmptyParentheses: false
Other: false
SpacesInSquareBrackets: false
Standard: Auto
Standard: c++17
StatementAttributeLikeMacros:
- Q_EMIT
StatementMacros:
Expand All @@ -277,4 +277,3 @@ WhitespaceSensitiveMacros:
- PP_STRINGIZE
- STRINGIZE
...

3 changes: 3 additions & 0 deletions .github/workflows/trigger-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ jobs:
|| github.actor == 'kainzhong'
|| github.actor == 'cspades'
|| github.actor == 'jomitchellnv'
|| github.actor == 'fheinecke'
|| github.actor == 'janekb04'
|| github.actor == 'YangFei1990'
)
steps:
- name: Check if comment is issued by authorized person
Expand Down
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
[submodule "3rdparty/cutlass"]
path = 3rdparty/cutlass
url = https://github.com/NVIDIA/cutlass.git
[submodule "3rdparty/nccl"]
path = 3rdparty/nccl
url = https://github.com/NVIDIA/nccl.git
[submodule "3rdparty/nccl-extensions"]
path = 3rdparty/nccl-extensions
url = https://github.com/NVIDIA/nccl-extensions.git
1 change: 0 additions & 1 deletion 3rdparty/nccl
Submodule nccl deleted from b87848
1 change: 1 addition & 0 deletions 3rdparty/nccl-extensions
Submodule nccl-extensions added at 2c6135
2 changes: 1 addition & 1 deletion build_tools/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.18.0.dev0
2.19.0.dev0
20 changes: 19 additions & 1 deletion docs/envvars.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,24 @@ backend-selection overview.
:Default: ``1``
:Description: Enable or disable FlashAttention backend for DotProductAttention. When set to ``0``, FlashAttention will not be used.

.. envvar:: NVTE_FLASH_ATTN_V2

:Type: ``int`` (0 or 1)
:Default: ``1``
:Description: Enable or disable FlashAttention 2 (the ``flash-attn`` package) for DotProductAttention, without affecting FlashAttention 3 or 4. When set to ``0``, FlashAttention 2 will not be used even if it is installed. Useful for pinning the FlashAttention version, e.g. so training-side attention runs the same kernel generation as an inference engine.

.. envvar:: NVTE_FLASH_ATTN_V3

:Type: ``int`` (0 or 1)
:Default: ``1``
:Description: Enable or disable FlashAttention 3 (the ``flash-attn-3`` package) for DotProductAttention, without affecting FlashAttention 2 or 4. When set to ``0``, FlashAttention 3 will not be used even if it is installed.

.. envvar:: NVTE_FLASH_ATTN_V4

:Type: ``int`` (0 or 1)
:Default: ``1``
:Description: Enable or disable FlashAttention 4 (the ``flash-attn-4`` package) for DotProductAttention, without affecting FlashAttention 2 or 3. When set to ``0``, FlashAttention 4 will not be used even if it is installed.

.. envvar:: NVTE_FUSED_ATTN

:Type: ``int`` (0 or 1)
Expand Down Expand Up @@ -274,7 +292,7 @@ Kernel Configuration

:Type: ``int`` (0 or 1)
:Default: ``0``
:Description: Disable NVRTC (CUDA Runtime Compilation) support. When set to ``1``, runtime kernel compilation is disabled. This can be useful in environments where NVRTC is not available or not desired.
:Description: Disable NVRTC (CUDA Runtime Compilation) support. When set to ``1``, runtime kernel compilation is disabled. Existing transpose operations select their static fallback automatically. Fused softmax and normalization paths require their corresponding ``NVTE_BUILD_LEGACY_STATIC_FUSED_SOFTMAX`` or ``NVTE_BUILD_LEGACY_STATIC_NORM`` CMake option to have been enabled when the library was built; otherwise no static fallback is available.

.. envvar:: NVTE_USE_CUTLASS_GROUPED_GEMM

Expand Down
4 changes: 2 additions & 2 deletions examples/jax/ep/run_test_ep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export PYTHONPATH="${TE_PATH}${PYTHONPATH:+:${PYTHONPATH}}"
COORD="${COORD:-127.0.0.1:12345}"
TEST_TIMEOUT_S="${TEST_TIMEOUT_S:-300}"

# Editable installs don't embed rpath; libtransformer_engine.so needs
# libnccl_ep.so.0 from the TE editable location at dlopen time.
# Editable installs don't embed rpath; the TE JAX extension needs
# libtransformer_engine.so from the TE editable location at dlopen time.
TE_LIB_PATH=$(pip3 show transformer-engine 2>/dev/null \
| grep -E "Location:|Editable project location:" \
| tail -n 1 | awk '{print $NF}')
Expand Down
2 changes: 0 additions & 2 deletions examples/pytorch/ep/bench/run_ep_bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ if [ "${NSYS}" -eq 1 ] && [ "${KINETO}" -eq 1 ]; then
fi

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
TE_REPO_ROOT="$(cd "${SCRIPT_DIR}/../../../.." && pwd)"
RESULTS="${SCRIPT_DIR}/results"
mkdir -p "${RESULTS}"
export PYTHONPATH="${TE_REPO_ROOT}${PYTHONPATH:+:${PYTHONPATH}}"

DETECTED_GPUS=$(nvidia-smi -L 2>/dev/null | wc -l)
NUM_GPUS="${NUM_GPUS:-${DETECTED_GPUS}}"
Expand Down
4 changes: 2 additions & 2 deletions examples/pytorch/ep/bench/run_nccl_ep_bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ TE_REPO_ROOT="$(cd "${SCRIPT_DIR}/../../../.." && pwd)"
RESULTS="${SCRIPT_DIR}/results"
mkdir -p "${RESULTS}"

BIN="${TE_REPO_ROOT}/3rdparty/nccl/build/test/nccl_ep/ep_bench"
LIB="${TE_REPO_ROOT}/3rdparty/nccl/build/lib"
BIN="${TE_REPO_ROOT}/3rdparty/nccl-extensions/build/test/nccl_ep/ep_bench"
LIB="${TE_REPO_ROOT}/3rdparty/nccl-extensions/build/lib"
[ -x "${BIN}" ] || { echo "ep_bench not built at ${BIN}" >&2; exit 2; }

NUM_GPUS=$(nvidia-smi -L 2>/dev/null | wc -l)
Expand Down
1 change: 0 additions & 1 deletion examples/pytorch/ep/run_test_ep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ if [ "${NUM_GPUS}" -gt 8 ]; then NUM_GPUS=8; fi
: ${TEST_TIMEOUT_S:=120}

SCRIPT="${TE_PATH}/examples/pytorch/ep/ep_moe.py"
export PYTHONPATH="${TE_PATH}${PYTHONPATH:+:${PYTHONPATH}}"

# Stage JIT cubins on tmpfs for fast iteration.
: ${NCCL_EP_JIT_CACHE_DIR:="${TMPDIR:-/tmp}/nccl_ep_jit_cache_$(id -u)"}
Expand Down
8 changes: 4 additions & 4 deletions qa/L0_jax_distributed_unittest/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ wait
TE_PATH=$TE_PATH bash $TE_PATH/examples/jax/ep/run_test_ep.sh || test_fail "run_test_ep.sh"
wait

# MoE custom_vjp distributed suite. Runs one Python process per GPU
# via tests/jax/run_multiprocess_moe_vjp.sh (mirrors the pattern in
# TE-EP MoE custom_vjp distributed suite. Runs one Python process per
# GPU via tests/jax/run_te_ep_moe.sh (mirrors the pattern in
# examples/jax/encoder/run_test_multiprocessing_encoder.sh). Requires
# >=4 visible GPUs.
TE_PATH=$TE_PATH bash $TE_PATH/tests/jax/run_multiprocess_moe_vjp.sh \
|| test_fail "test_multiprocess_moe_vjp.py"
TE_PATH=$TE_PATH bash $TE_PATH/tests/jax/run_te_ep_moe.sh \
|| test_fail "test_te_ep_moe.py"
# Exercise the multi-GPU tutorial in docs/examples/jax (needs >= 4 GPUs;
# auto-skips otherwise).
CUDA_VISIBLE_DEVICES=0,1,2,3 python3 -m pytest -c $TE_PATH/tests/jax/pytest.ini -v --junitxml=$XML_LOG_DIR/pytest_docs_examples_jax_distributed.xml -k multi_gpu $TE_PATH/docs/examples/jax/ || test_fail "docs/examples/jax (multi-GPU)"
Expand Down
2 changes: 2 additions & 0 deletions qa/L0_pytorch_unittest/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ python3 -m pytest --tb=auto --junitxml=$XML_LOG_DIR/pytest_test_gqa.xml $TE_PATH
python3 -m pytest --tb=auto --junitxml=$XML_LOG_DIR/pytest_test_fused_optimizer.xml $TE_PATH/tests/pytorch/test_fused_optimizer.py || test_fail "test_fused_optimizer.py"
python3 -m pytest --tb=auto --junitxml=$XML_LOG_DIR/pytest_test_multi_tensor.xml $TE_PATH/tests/pytorch/test_multi_tensor.py || test_fail "test_multi_tensor.py"
python3 -m pytest --tb=auto --junitxml=$XML_LOG_DIR/pytest_test_fusible_ops.xml $TE_PATH/tests/pytorch/test_fusible_ops.py || test_fail "test_fusible_ops.py"
python3 -m pytest --tb=auto --junitxml=$XML_LOG_DIR/pytest_test_distributed_weight.xml $TE_PATH/tests/pytorch/test_distributed_weight.py || test_fail "test_distributed_weight.py"
python3 -m pytest --tb=auto --junitxml=$XML_LOG_DIR/pytest_test_backward_override.xml $TE_PATH/tests/pytorch/test_backward_override.py || test_fail "test_backward_override.py"
python3 -m pytest --tb=auto --junitxml=$XML_LOG_DIR/pytest_test_permutation.xml $TE_PATH/tests/pytorch/test_permutation.py || test_fail "test_permutation.py"
python3 -m pytest --tb=auto --junitxml=$XML_LOG_DIR/pytest_test_parallel_cross_entropy.xml $TE_PATH/tests/pytorch/test_parallel_cross_entropy.py || test_fail "test_parallel_cross_entropy.py"
Expand All @@ -66,6 +67,7 @@ python3 -m pytest --tb=auto --junitxml=$XML_LOG_DIR/pytest_test_partial_cast.xml
# Disable autotuning to make unittests faster. In addition, disable TF32 path to fully align with the pytorch reference implementation's precision
NVTE_DISABLE_TRITON_AUTOTUNING=1 NVIDIA_TF32_OVERRIDE=0 python3 -m pytest --tb=auto --junitxml=$XML_LOG_DIR/pytest_test_mhc.xml $TE_PATH/tests/pytorch/test_mhc.py || test_fail "test_mhc.py"
PYTORCH_JIT=0 NVTE_TORCH_COMPILE=0 python3 -m pytest --tb=auto --junitxml=$XML_LOG_DIR/pytest_test_grouped_linear.xml $TE_PATH/tests/pytorch/test_grouped_linear.py || test_fail "test_grouped_linear.py"
PYTORCH_JIT=0 NVTE_TORCH_COMPILE=0 python3 -m pytest --tb=auto --junitxml=$XML_LOG_DIR/pytest_test_ops_grouped_linear_distributed_weight.xml $TE_PATH/tests/pytorch/test_ops_grouped_linear_distributed_weight.py || test_fail "test_ops_grouped_linear_distributed_weight.py"
NVTE_GROUPED_LINEAR_SINGLE_PARAM=1 NVTE_CUTEDSL_FUSED_GROUPED_MLP=1 python3 -m pytest --tb=auto --junitxml=$XML_LOG_DIR/pytest_test_grouped_mlp.xml $TE_PATH/tests/pytorch/test_grouped_mlp.py || test_fail "test_grouped_mlp.py"

if [ "$RET" -ne 0 ]; then
Expand Down
15 changes: 8 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
remove_dups,
min_python_version_str,
nccl_ep_enabled,
get_max_jobs_for_parallel_build,
)

frameworks = get_frameworks()
Expand Down Expand Up @@ -207,11 +208,11 @@ def _discover_nccl_home() -> str:


def build_nccl_ep_submodule() -> str:
"""Build libnccl_ep.a from the 3rdparty/nccl submodule and return NCCL_HOME."""
nccl_root = current_file_path / "3rdparty" / "nccl"
if not (nccl_root / "Makefile").exists():
"""Build libnccl_ep.a from the 3rdparty/nccl-extensions submodule and return NCCL_HOME."""
nccl_root = current_file_path / "3rdparty" / "nccl-extensions"
if not (nccl_root / "nccl_ep" / "Makefile").exists():
raise RuntimeError(
f"NCCL submodule not found at {nccl_root}. "
f"NCCL EP submodule not found at {nccl_root}. "
"Run `git submodule update --init --recursive`."
)

Expand Down Expand Up @@ -250,7 +251,7 @@ def build_nccl_ep_submodule() -> str:
)
gencode = " ".join(f"-gencode=arch=compute_{a},code=sm_{a}" for a in arch_list)

nproc = os.cpu_count() or 8
nproc = get_max_jobs_for_parallel_build()
env = os.environ.copy()
env["NVCC_GENCODE"] = gencode
# NCCL EP needs the core NCCL headers + libnccl.so; write NCCL EP build
Expand All @@ -267,13 +268,13 @@ def build_nccl_ep_submodule() -> str:
"rebuilding libnccl_ep.a"
)
subprocess.check_call(
["make", "-C", "contrib/nccl_ep", "clean"],
["make", "-C", "nccl_ep", "clean"],
cwd=str(nccl_root),
env=env,
)
print(f"[NCCL EP] Building libnccl_ep.a (gencode='{gencode}')")
subprocess.check_call(
["make", "-j", str(nproc), "-C", "contrib/nccl_ep", "lib"],
["make", "-j", str(nproc), "-C", "nccl_ep", "lib"],
cwd=str(nccl_root),
env=env,
)
Expand Down
2 changes: 2 additions & 0 deletions tests/cpp/operator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ add_executable(test_operator
test_cast_transpose_dbias_dgelu.cu
test_cast_transpose_dgeglu.cu
test_act.cu
test_scaled_activation.cu
test_normalization.cu
test_normalization_mxfp8.cu
test_memset.cu
test_splits_to_offsets.cu
test_multi_cast_transpose.cu
test_multi_padding.cu
test_multi_unpadding.cu
test_softmax.cu
test_causal_softmax.cu
test_swizzle.cu
test_multi_swizzle.cu
Expand Down
16 changes: 10 additions & 6 deletions tests/cpp/operator/test_cast_float8blockwise_grouped.cu
Original file line number Diff line number Diff line change
Expand Up @@ -368,14 +368,15 @@ struct TestConfig {
ScalingDir dir;
std::vector<size_t> first_dims;
size_t K;
bool force_pow_2_scales;
};

class GroupedFP8BlockwiseTestSuite : public ::testing::TestWithParam<TestConfig> {};

TEST_P(GroupedFP8BlockwiseTestSuite, Test) {
const TestConfig& cfg = GetParam();
perform_test<bf16, fp8e4m3>(cfg.shape_rep, cfg.block_dim, cfg.dir, cfg.first_dims, cfg.K,
/*force_pow_2_scales=*/false, /*epsilon=*/0.0f);
cfg.force_pow_2_scales, /*epsilon=*/0.0f);
}

std::vector<TestConfig> make_configs() {
Expand All @@ -387,11 +388,13 @@ std::vector<TestConfig> make_configs() {
for (auto bd : {BlockDim::ONE_D, BlockDim::TWO_D}) {
for (auto dir : {ScalingDir::ROWWISE, ScalingDir::COLWISE, ScalingDir::BOTH}) {
for (size_t K : Ks) {
for (const auto& v : uniform) {
configs.push_back({ShapeRep::SAME_BOTH_DIMS, bd, dir, v, K});
}
for (const auto& v : jagged) {
configs.push_back({ShapeRep::VARYING_FIRST_DIM, bd, dir, v, K});
for (bool pow2 : {false, true}) {
for (const auto& v : uniform) {
configs.push_back({ShapeRep::SAME_BOTH_DIMS, bd, dir, v, K, pow2});
}
for (const auto& v : jagged) {
configs.push_back({ShapeRep::VARYING_FIRST_DIM, bd, dir, v, K, pow2});
}
}
}
}
Expand All @@ -408,6 +411,7 @@ std::string make_name(const ::testing::TestParamInfo<TestConfig>& info) {
s += "_K" + std::to_string(c.K) + "_N" + std::to_string(c.first_dims.size());
s += "_M";
for (size_t m : c.first_dims) s += "_" + std::to_string(m);
s += (c.force_pow_2_scales ? "_POW2" : "_FP32SC");
return s;
}

Expand Down
4 changes: 2 additions & 2 deletions tests/cpp/operator/test_cast_mxfp8_grouped.cu
Original file line number Diff line number Diff line change
Expand Up @@ -509,9 +509,9 @@ void performTest(const ProcessingMethod processing_method,
break;
}
case ProcessingMethod::CAST_DBIAS: {
nvte_group_quantize_dbias(grad_group_tensor, out_group_tensor, output_dbias_tensor, workspace.data(), 0);
nvte_group_quantize_dbias(grad_group_tensor, out_group_tensor, output_dbias_tensor, workspace.data(), nullptr, 0);
workspace = Tensor("workspace", workspace.rowwise_shape(), workspace.dtype());
nvte_group_quantize_dbias(grad_group_tensor, out_group_tensor, output_dbias_tensor, workspace.data(), 0);
nvte_group_quantize_dbias(grad_group_tensor, out_group_tensor, output_dbias_tensor, workspace.data(), nullptr, 0);
break;
}
case ProcessingMethod::CAST_DBIAS_DACT: {
Expand Down
Loading
Loading