Repository navigation
Conversation
Fix the public headers so they compile as C: - Typedef every NVTE enum and struct and include stdbool.h. - Replace C++-only members of NVTETensorPack with NVTE_TENSOR_PACK_MAX_SIZE. - Take NVTETensor arrays instead of std::vector in nvte_delayed_scaling_recipe_amax_and_scale_update_after_reduction. - Take tensors by value instead of by reference in context-parallel attention functions. - Give C linkage to nvte_cudnn_handle_init, nvte_cublas_handle_init, nvte_built_with_cublasmp, and the permutation functions. - Remove default arguments, use (void) prototypes, guard NVTE_Activation_Type for C++, and drop unneeded CUDA includes. Add a test that calls every C API function from a C translation unit compiled with strict flags, so building checks that the headers are valid C and linking checks that the functions have C linkage. A CTest checks that the test covers every function declared in the headers. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Tim Moon <[email protected]>
Now that the public headers include stdbool.h, change int arguments and return values that are logically flags to bool: GEMM transpose flags, router use_pre_softmax, context-parallel attention flags, multi-tensor optimizer flags, and the nvte_is_non_tn_fp8_gemm_supported and nvte_fused_topk_with_aux_loss_scores_is_supported results. Also fix the is_non_paged documentation, which described the opposite meaning. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Tim Moon <[email protected]>
…atures Give each unversioned C API function the signature and behavior of its latest _v2 variant, and keep the _v2 names as deprecated aliases that forward to it. Internal callers in common, PyTorch, JAX, and the tests now use the unversioned names. The EP functions are left unchanged while that code is being refactored separately. Notable consequences: - nvte_cublas_gemm takes alpha/beta/C and an NVTEMatmulConfig. The comm-GEMM overlap code and the distributed test map the old bias/GELU/accumulate arguments onto the config. - The MoE aux-loss kernels only implement the deterministic two-stage reduction and require a workspace. The atomic path is removed, the PyTorch deterministic keyword is a deprecated no-op that warns, and the JAX primitive allocates the workspace. - nvte_clamped_swiglu/dswiglu take glu_linear_offset and nvte_splits_to_offsets_multi takes split_alignment. Also remove nvte_quantize_noop (use the quantization config's noop tensor), nvte_cublas_gemm_scaled, and the deprecated _unchecked fused-router functions. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Tim Moon <[email protected]>
Remove nvte_convert_pointers_to_tensor, nvte_group_nvfp4_compute_amax, and nvte_multi_stream_cublas_gemm. Remove the deprecated FP8 block scaling tensor format: the quantization config attribute (value 3 is left unused), the Float8BlockScaleTensorFormat enum and its Python binding, the QuantizationConfigWrapper setter, and the unreachable compact-format path in the FP8 1D block-scaling kernel. That kernel now takes return_rowwise/return_columnwise flags instead of option enums. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Tim Moon <[email protected]>
Remove nvte_cast_transpose, nvte_cast_transpose_with_noop,
nvte_cast_transpose_dbias, and nvte_cast_transpose_dbias_d{gelu,silu,
relu,qgelu,srelu}. nvte_quantize and nvte_quantize_dbias[_d*] dispatch
to the same kernels for delayed scaling, with the noop tensor passed
through the quantization config. Explicitly instantiate the fused
dbias+dact cast-transpose kernels, which those removed functions
previously instantiated implicitly.
Move nvte_transpose_with_noop to transpose.h and delete
cast_transpose_noop.h.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
Each header now directly includes the headers that declare what it uses: cuda_runtime_api.h for CUDA stream and event types, and stddef.h, stdint.h, and stdbool.h for size_t, fixed-width integers, and bool. Unused includes are removed: transformer_engine.h from cudnn.h and utils.h, stdint.h from ep.h, and cuda.h, cuda_fp8.h, and <functional> from comm_gemm_overlap.h, which now includes <cstddef>, <vector>, and logging.h directly. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Tim Moon <[email protected]>
Zero NVTETensorPack.size in nvte_tensor_pack_create, since the struct no longer has a default member initializer. Reject NVFP4 operands in the comm+GEMM overlap GEMM helper. Remove stale comments and reformat calls and forwarders affected by the _v2 renames. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Tim Moon <[email protected]>
timmoon10
requested review from
Oleg-Goncharov,
cyanguwa,
jberchtold-nvidia,
ksivaman and
ptrendx
as code owners
December 2, 2026 03:35
Contributor
Confidence Score: 5/5
[High impact] The reviewed changes appear safe to merge; no new actionable issue was established. SummaryRefactors the C API for TE 3.0 and updates native, PyTorch, and JAX callers.
Reviews (9) · Last reviewed commit: "[pre-commit.ci] auto fixes from pre-comm..." · Reviewed by Greptile |
Signed-off-by: Tim Moon <[email protected]>
The public C API headers now typedef their enums and structs, which made Doxygen emit both the tag and the typedef and Sphinx report duplicate C++ declarations. Enable TYPEDEF_HIDES_STRUCT so each type is documented once under its typedef name. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Tim Moon <[email protected]>
Building the 4over6 kernels with nvcc fails with "wrong number of template arguments" for quantize_4over6_kernel::Config now that NVTENVFP44Over6Mode is a typedef'd C enum. Take the mode as an int template parameter in Config and compute_error_rn. Config::mode keeps the enum type, and enum values still convert implicitly, so callers and the NVRTC source are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Tim Moon <[email protected]>
for more information, see https://pre-commit.ci
This comment was marked as outdated.
This comment was marked as outdated.
Signed-off-by: Tim Moon <[email protected]>
for more information, see https://pre-commit.ci
timmoon10
commented
Dec 2, 2026
Signed-off-by: Tim Moon <[email protected]>
Member
Author
|
/te-ci L1 |
Collaborator
|
LGTM from TE/JAX side |
Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
for more information, see https://pre-commit.ci
Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
for more information, see https://pre-commit.ci
Member
Author
|
/te-ci L1 |
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.
Description
This PR makes breaking changes in the C API to remove deprecated functions. It also makes changes so the C API actually compiles under C.
Type of change
Changes
_v2variant, the original function is changed to match the_v2variant.Checklist: