Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
dc6b87c
[Common] Make public C API headers valid C
timmoon10 Dec 2, 2026
a55a278
[Common] Use bool for flag arguments in the C API
timmoon10 Dec 2, 2026
dc48e2e
[Common] Replace deprecated C API functions with their versioned sign…
timmoon10 Dec 2, 2026
6462858
[Common] Remove deprecated C API functions
timmoon10 Dec 2, 2026
d1d6f33
[Common] Remove cast-transpose functions redundant with nvte_quantize
timmoon10 Dec 2, 2026
52e4c4c
[Common] Make public C API headers include what they use
timmoon10 Dec 2, 2026
220e458
[Common] Address review feedback on the C API cleanup
timmoon10 Dec 2, 2026
a128537
Fix broken Doxygen comments
timmoon10 Dec 2, 2026
6b7f1a9
[Docs] Document typedef'd C API types once
timmoon10 Dec 2, 2026
acdf881
[Common] Use int template parameters for the NVFP4 4over6 mode
timmoon10 Dec 2, 2026
0328a1b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 2, 2026
a6ea70b
Debug compile error with C enum template arg
timmoon10 Dec 2, 2026
1bd5104
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 2, 2026
2391b8f
Revert changes to NVFP4 4over6 enum
timmoon10 Dec 2, 2026
7774dea
Merge branch 'main' into tmoon/c-api-refactor
timmoon10 Dec 2, 2026
4a362a0
Synchronize and shut down NCCL at end of TE ops Userbuffers test
timmoon10 Dec 2, 2026
9006a39
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 2, 2026
777c5e6
Merge branch 'main' into tmoon/c-api-refactor
timmoon10 Dec 4, 2026
5a204f7
Merge branch 'main' into tmoon/c-api-refactor
timmoon10 Dec 4, 2026
8790ffa
Fix merge conflicts
timmoon10 Dec 5, 2026
2494853
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 5, 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
2 changes: 1 addition & 1 deletion docs/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ INLINE_SIMPLE_STRUCTS = NO
# types are typedef'ed and only the typedef is referenced, never the tag name.
# The default value is: NO.

TYPEDEF_HIDES_STRUCT = NO
TYPEDEF_HIDES_STRUCT = YES

# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
# cache is used to resolve symbols given their name and scope. Since this can be
Expand Down
9 changes: 0 additions & 9 deletions docs/api/c/cast_transpose_noop.rst

This file was deleted.

1 change: 0 additions & 1 deletion docs/api/c/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ directly from C/C++, without Python.

transformer_engine.h <transformer_engine>
activation.h <activation>
cast_transpose_noop.h <cast_transpose_noop>
cast.h <cast>
cudnn.h <cudnn>
fused_attn.h <fused_attn>
Expand Down
12 changes: 11 additions & 1 deletion tests/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CUDA_STANDARD 17)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)

project(transformer_engine_tests LANGUAGES CUDA CXX)
project(transformer_engine_tests LANGUAGES C CUDA CXX)

add_subdirectory(../../3rdparty/googletest ${PROJECT_BINARY_DIR}/googletest)

Expand All @@ -40,7 +40,17 @@ include_directories(../../transformer_engine/common)
include_directories(../../transformer_engine)
include_directories(${CMAKE_SOURCE_DIR})

# Configure dependencies
find_package(CUDAToolkit REQUIRED)
find_package(Python COMPONENTS Interpreter REQUIRED)
find_path(NCCL_INCLUDE_DIR
NAMES nccl.h
HINTS "${Python_SITEARCH}/nvidia/nccl"
"/opt/nvidia/nccl"
"/usr/local/nccl"
PATH_SUFFIXES include
REQUIRED)
include_directories(SYSTEM ${NCCL_INCLUDE_DIR})
include(${CMAKE_SOURCE_DIR}/../../transformer_engine/common/cmake/cuDNN.cmake)

add_subdirectory(operator)
Expand Down
2 changes: 1 addition & 1 deletion tests/cpp/operator/test_cast.cu
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void performTest(const std::vector<size_t>& shape) {
setRandomScale(&output_c);
const float ref_scale = isFp8Type(otype) ? output_c.scale() : 1.0f;

nvte_quantize(input.data(), output_c.data(), 0);
nvte_quantize(input.data(), output_c.data(), nullptr, 0);

float ref_amax;

Expand Down
2 changes: 1 addition & 1 deletion tests/cpp/operator/test_cast_current_scaling.cu
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void performTest(const std::vector<size_t>& shape) {
amax_to_check = output_c.amax();
output_c.set_tensor_amax_nullptr();
}
nvte_quantize(input.data(), output_c.data(), 0);
nvte_quantize(input.data(), output_c.data(), nullptr, 0);

float ref_amax;
float ref_scale = 1.0;
Expand Down
4 changes: 2 additions & 2 deletions tests/cpp/operator/test_cast_float8blockwise.cu
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ void runTestCase(const ProcessingMethod processing_method, const std::vector<siz
Tensor workspace;
switch (processing_method) {
case ProcessingMethod::CAST_ONLY: {
nvte_quantize_v2(input.data(), output_c.data(), quant_config, nullptr);
nvte_quantize(input.data(), output_c.data(), quant_config, nullptr);
break;
}
}
Expand Down Expand Up @@ -380,7 +380,7 @@ void runTestCaseOneDimensionalBlocks(const ProcessingMethod processing_method,
quant_config.set_amax_epsilon(opts.amax_epsilon);
switch (processing_method) {
case ProcessingMethod::CAST_ONLY: {
nvte_quantize_v2(input.data(), output_c.data(), quant_config, nullptr);
nvte_quantize(input.data(), output_c.data(), quant_config, nullptr);
break;
}
}
Expand Down
4 changes: 2 additions & 2 deletions tests/cpp/operator/test_cast_float8blockwise_grouped.cu
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ constexpr size_t kBlock = 128;

inline size_t align4(size_t x) { return ((x + 3) / 4) * 4; }

// Configure split-quantize reference: call non-grouped nvte_quantize_v2 on each tensor slice.
// Configure split-quantize reference: call non-grouped nvte_quantize on each tensor slice.
// Returns flat host buffers for per-tensor outputs and scales (in their per-tensor natural
// layout) so the test can index them and compare element-wise against the grouped layout.
struct PerTensorRef {
Expand Down Expand Up @@ -257,7 +257,7 @@ void perform_test(ShapeRep shape_rep, BlockDim block_dim, ScalingDir dir,
QuantizationConfigWrapper qc;
qc.set_force_pow_2_scales(force_pow_2_scales);
qc.set_amax_epsilon(epsilon);
nvte_quantize_v2(ref_in.data(), ref_out.data(), qc, 0);
nvte_quantize(ref_in.data(), ref_out.data(), qc, 0);
cudaDeviceSynchronize();
ASSERT_EQ(cudaGetLastError(), cudaSuccess);
ref_out.to_cpu(); // sync output and scale_inv buffers from GPU to CPU
Expand Down
6 changes: 3 additions & 3 deletions tests/cpp/operator/test_cast_mxfp4.cu
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ void check_swizzled(Tensor &input, Tensor &swizzled, const std::vector<size_t> &
Tensor compact("compact", shape, DType::kFloat4E2M1, rowwise, !rowwise, NVTE_MXFP4_1D_SCALING);
Tensor ref("ref", shape, DType::kFloat4E2M1, rowwise, !rowwise, NVTE_MXFP4_1D_SCALING);
ref.set_with_gemm_swizzled_scales(true);
nvte_quantize(input.data(), compact.data(), 0);
nvte_quantize(input.data(), compact.data(), nullptr, 0);
cudaMemcpy(rowwise ? ref.rowwise_dptr() : ref.columnwise_dptr(),
rowwise ? compact.rowwise_dptr() : compact.columnwise_dptr(), data_bytes,
cudaMemcpyDeviceToDevice);
Expand Down Expand Up @@ -185,7 +185,7 @@ void performTest(const std::vector<size_t> &shape, bool rowwise, bool columnwise
fillUniform(&input);
quantized.set_with_gemm_swizzled_scales(swizzled);

nvte_quantize(input.data(), quantized.data(), 0);
nvte_quantize(input.data(), quantized.data(), nullptr, 0);
nvte_dequantize(quantized.data(), output.data(), 0);
cudaDeviceSynchronize();
auto err = cudaGetLastError();
Expand Down Expand Up @@ -249,7 +249,7 @@ TEST(CastMXFP4Test, RejectsMismatchedOutputShape) {
Tensor input("input", std::vector<size_t>{256, 128}, DType::kBFloat16);
Tensor output("output", std::vector<size_t>{128, 128}, DType::kFloat4E2M1, true, true,
NVTE_MXFP4_1D_SCALING);
EXPECT_THROW(nvte_quantize(input.data(), output.data(), 0), std::runtime_error);
EXPECT_THROW(nvte_quantize(input.data(), output.data(), nullptr, 0), std::runtime_error);
}

#endif // FP4_TYPE_SUPPORTED
16 changes: 8 additions & 8 deletions tests/cpp/operator/test_cast_mxfp8.cu
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ void performTest_x1(const ProcessingMethod processing_method,
Tensor workspace;
switch (processing_method) {
case ProcessingMethod::CAST_ONLY: {
nvte_quantize(input.data(), output_c.data(), 0);
nvte_quantize(input.data(), output_c.data(), nullptr, 0);
break;
}
case ProcessingMethod::CAST_DBIAS: {
Expand Down Expand Up @@ -479,7 +479,7 @@ void performTest_x2(const ProcessingMethod processing_method,
Tensor workspace;
switch (processing_method) {
case ProcessingMethod::CAST_ONLY: {
nvte_quantize(input.data(), output.data(), 0);
nvte_quantize(input.data(), output.data(), nullptr, 0);
break;
}
case ProcessingMethod::CAST_DBIAS: {
Expand Down Expand Up @@ -655,7 +655,7 @@ void performTest_2d_quantize(const std::vector<size_t>& shape,

QuantizationConfigWrapper quant_config;
quant_config.set_mxfp8_2d_quantization(true);
nvte_quantize_v2(input.data(), output.data(), quant_config, 0);
nvte_quantize(input.data(), output.data(), quant_config, 0);

cudaDeviceSynchronize();
auto err = cudaGetLastError();
Expand Down Expand Up @@ -1087,7 +1087,7 @@ TEST_P(SwizzledScalesFusedCastMXFP8TestSuite, TestSwizzledCastMXFP8) {
// CastTraitsSwizzle<..., kCacheColwise=true, kSwizzled=true> on kernel #3.
Tensor output_swizzled("output_swizzled", shape, otype, true, true, NVTE_MXFP8_1D_SCALING);
output_swizzled.set_with_gemm_swizzled_scales(true);
nvte_quantize(input.data(), output_swizzled.data(), 0);
nvte_quantize(input.data(), output_swizzled.data(), nullptr, 0);

// Rowwise-only activations take the pointer-based cast-only kernel. This
// directly exercises its WITH_GEMM_SWIZZLED_SCALES trait specialization
Expand All @@ -1096,7 +1096,7 @@ TEST_P(SwizzledScalesFusedCastMXFP8TestSuite, TestSwizzledCastMXFP8) {
/*rowwise=*/true, /*colwise=*/false,
NVTE_MXFP8_1D_SCALING);
output_rowwise_swizzled.set_with_gemm_swizzled_scales(true);
nvte_quantize(input.data(), output_rowwise_swizzled.data(), 0);
nvte_quantize(input.data(), output_rowwise_swizzled.data(), nullptr, 0);

cudaDeviceSynchronize();
ASSERT_EQ(cudaGetLastError(), cudaSuccess) << "swizzled-scale nvte_quantize failed";
Expand All @@ -1111,7 +1111,7 @@ TEST_P(SwizzledScalesFusedCastMXFP8TestSuite, TestSwizzledCastMXFP8) {
// Rowwise reference.
Tensor linear_row("linear_row", shape, otype, /*rowwise=*/true, /*colwise=*/false,
NVTE_MXFP8_1D_SCALING);
nvte_quantize(input.data(), linear_row.data(), 0);
nvte_quantize(input.data(), linear_row.data(), nullptr, 0);
Tensor ref_row_swz("ref_row_swz", shape, otype, /*rowwise=*/true, /*colwise=*/false,
NVTE_MXFP8_1D_SCALING);
ref_row_swz.set_with_gemm_swizzled_scales(true);
Expand All @@ -1124,7 +1124,7 @@ TEST_P(SwizzledScalesFusedCastMXFP8TestSuite, TestSwizzledCastMXFP8) {
// Colwise reference.
Tensor linear_col("linear_col", shape, otype, /*rowwise=*/false, /*colwise=*/true,
NVTE_MXFP8_1D_SCALING);
nvte_quantize(input.data(), linear_col.data(), 0);
nvte_quantize(input.data(), linear_col.data(), nullptr, 0);
Tensor ref_col_swz("ref_col_swz", shape, otype, /*rowwise=*/false, /*colwise=*/true,
NVTE_MXFP8_1D_SCALING);
ref_col_swz.set_with_gemm_swizzled_scales(true);
Expand Down Expand Up @@ -1386,7 +1386,7 @@ TEST_P(CompactScalesCastMXFP8TestSuite, TestCompactScales) {
// CAST_DBIAS covers the larger tiles of the generic kernel's dbias variant.
auto quantize = [&](NVTETensor output) {
if (processing_method == ProcessingMethod::CAST_ONLY) {
nvte_quantize(input.data(), output, 0);
nvte_quantize(input.data(), output, nullptr, 0);
return;
}
Tensor dbias("dbias", std::vector<size_t>{ cols }, itype);
Expand Down
6 changes: 4 additions & 2 deletions tests/cpp/operator/test_cast_mxfp8_act_exact.cu
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,9 @@ void run_case(const Mode mode, const Fill fill, const size_t rows, const size_t
Tensor ref("ref", shape, otype, rowwise, colwise, NVTE_MXFP8_1D_SCALING);
ref.set_with_gemm_swizzled_scales(swizzled);
Tensor noop("noop", std::vector<size_t>{1}, DType::kFloat32);
nvte_quantize_noop(y.data(), ref.data(), noop.data(), 0);
QuantizationConfigWrapper quant_config;
quant_config.set_noop_tensor(noop.data());
nvte_quantize(y.data(), ref.data(), quant_config, 0);

// Fused.
Tensor out("out", shape, otype, rowwise, colwise, NVTE_MXFP8_1D_SCALING);
Expand All @@ -317,7 +319,7 @@ void run_case(const Mode mode, const Fill fill, const size_t rows, const size_t
ASSERT_EQ(cudaMemset(amax_dev, 0, sizeof(float)), cudaSuccess);
const size_t one = 1;
const NVTEBasicTensor amax = {amax_dev, kNVTEFloat32, nvte_make_shape(&one, 1)};
nvte_set_tensor_param_v2(out.data(), kNVTEAmax, &amax, sizeof(amax));
nvte_set_tensor_param(out.data(), kNVTEAmax, &amax, sizeof(amax));
}
Tensor dbias("dbias", std::vector<size_t>{cols}, itype);
Tensor workspace;
Expand Down
28 changes: 12 additions & 16 deletions tests/cpp/operator/test_cast_nvfp4_transpose.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1044,8 +1044,6 @@ void performTest(float (*OP)(const float),
quant_config.set_nvfp4_4over6_err_use_fast_math(use_4over6 && use_4over6_err_use_fast_math);

// Call appropriate function based on operation type
// Activation functions take 3 parameters (input, output, stream)
// nvte_quantize_v2 takes 4 parameters (input, output, quant_config, stream)
if (OP == &gelu) {
nvte_gelu(input.data(), output.data(), 0);
} else if (OP == &silu) {
Expand All @@ -1057,7 +1055,7 @@ void performTest(float (*OP)(const float),
} else if (OP == &srelu) {
nvte_srelu(input.data(), output.data(), 0);
} else {
nvte_quantize_v2(input.data(), output.data(), quant_config, 0);
nvte_quantize(input.data(), output.data(), quant_config, 0);
}

cudaDeviceSynchronize();
Expand Down Expand Up @@ -1170,8 +1168,8 @@ void performTestColumnwiseOnly2D(const std::vector<size_t>& shape) {
quant_config.set_stochastic_rounding(false);
quant_config.set_nvfp4_2d_quantization(true);

nvte_quantize_v2(input.data(), output_both.data(), quant_config, 0);
nvte_quantize_v2(input.data(), output_col.data(), quant_config, 0);
nvte_quantize(input.data(), output_both.data(), quant_config, 0);
nvte_quantize(input.data(), output_col.data(), quant_config, 0);

cudaDeviceSynchronize();
auto err = cudaGetLastError();
Expand Down Expand Up @@ -1260,7 +1258,7 @@ void performTestRowScaledTranspose(const std::vector<size_t>& shape) {
fillCase<fp32>(&input, InputsFillCase::uniform);

// System under test: row-scaled NVFP4 with both directions requested in one
// call. The transpose kernel is selected by the generic nvte_quantize_v2
// call. The transpose kernel is selected by the generic nvte_quantize
// dispatch when a row-scaled tensor (set_row_scaled_nvfp4) also allocates a
// columnwise output -- no dedicated config flag.
Tensor output("output", shape, otype, /*rowwise=*/true, /*columnwise=*/true,
Expand All @@ -1271,15 +1269,15 @@ void performTestRowScaledTranspose(const std::vector<size_t>& shape) {
output.set_row_scaled_nvfp4(true);
QuantizationConfigWrapper quant_config;
quant_config.set_stochastic_rounding(false);
nvte_quantize_v2(input.data(), output.data(), quant_config, 0);
nvte_quantize(input.data(), output.data(), quant_config, 0);

// Reference (rowwise direction): trusted row-scaled 1D kernel on the input.
Tensor ref_row("ref_row", shape, otype, /*rowwise=*/true, /*columnwise=*/false,
NVTE_NVFP4_1D_SCALING);
ref_row.set_row_scaled_nvfp4(true);
QuantizationConfigWrapper ref_config;
ref_config.set_stochastic_rounding(false);
nvte_quantize_v2(input.data(), ref_row.data(), ref_config, 0);
nvte_quantize(input.data(), ref_row.data(), ref_config, 0);

// Reference (columnwise direction): trusted row-scaled 1D kernel on input^T.
input.to_cpu();
Expand All @@ -1292,7 +1290,7 @@ void performTestRowScaledTranspose(const std::vector<size_t>& shape) {
Tensor ref_col("ref_col", shape_t, otype, /*rowwise=*/true, /*columnwise=*/false,
NVTE_NVFP4_1D_SCALING);
ref_col.set_row_scaled_nvfp4(true);
nvte_quantize_v2(input_t.data(), ref_col.data(), ref_config, 0);
nvte_quantize(input_t.data(), ref_col.data(), ref_config, 0);

cudaDeviceSynchronize();
ASSERT_EQ(cudaGetLastError(), cudaSuccess) << cudaGetErrorString(cudaGetLastError());
Expand Down Expand Up @@ -1368,8 +1366,8 @@ void performTestRowScaledColumnwiseOnly(const std::vector<size_t>& shape) {

QuantizationConfigWrapper quant_config;
quant_config.set_stochastic_rounding(false);
nvte_quantize_v2(input.data(), output.data(), quant_config, 0);
nvte_quantize_v2(input.data(), ref.data(), quant_config, 0);
nvte_quantize(input.data(), output.data(), quant_config, 0);
nvte_quantize(input.data(), ref.data(), quant_config, 0);

cudaDeviceSynchronize();
ASSERT_EQ(cudaGetLastError(), cudaSuccess) << cudaGetErrorString(cudaGetLastError());
Expand Down Expand Up @@ -1668,10 +1666,9 @@ TEST(NVFP4UE5M3ReferenceTest, Grouped) {

Tensor output_storage("ue5m3_group_output_storage", input_shape, DType::kFloat4E2M1,
true, false, NVTE_NVFP4_1D_SCALING, DType::kFloat8UE5M3);
const NVTEBasicTensor storage_data =
nvte_get_tensor_param(output_storage.data(), kNVTERowwiseData);
const NVTEBasicTensor storage_data = get_tensor_param(output_storage.data(), kNVTERowwiseData);
const NVTEBasicTensor storage_scales =
nvte_get_tensor_param(output_storage.data(), kNVTERowwiseScaleInv);
get_tensor_param(output_storage.data(), kNVTERowwiseScaleInv);

std::vector<Tensor> output_metadata;
std::vector<TensorWrapper> output_views;
Expand All @@ -1684,8 +1681,7 @@ TEST(NVFP4UE5M3ReferenceTest, Grouped) {
DType::kFloat4E2M1, true, false, NVTE_NVFP4_1D_SCALING, DType::kFloat8UE5M3);
output_metadata.back().set_amax(golden_amax);

const NVTEBasicTensor amax =
nvte_get_tensor_param(output_metadata.back().data(), kNVTEAmax);
const NVTEBasicTensor amax = get_tensor_param(output_metadata.back().data(), kNVTEAmax);
auto *data_ptr =
reinterpret_cast<uint8_t *>(storage_data.data_ptr) + i * rows * cols / 2;
auto *scale_ptr =
Expand Down
2 changes: 1 addition & 1 deletion tests/cpp/operator/test_cast_transpose.cu
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void performTest(const size_t N, const size_t H) {
setRandomScale(&output);
const float ref_scale = isFp8Type(otype) ? output.scale() : 1.0f;

nvte_quantize(input.data(), output.data(), 0);
nvte_quantize(input.data(), output.data(), nullptr, 0);

float ref_amax;
compute_ref<InputType, OutputType>(input.rowwise_cpu_dptr<InputType>(), ref_output_c.get(),
Expand Down
2 changes: 1 addition & 1 deletion tests/cpp/operator/test_cast_transpose_current_scaling.cu
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void performTest(const size_t N, const size_t H) {
amax_to_check = output.amax();
output.set_tensor_amax_nullptr();
}
nvte_quantize(input.data(), output.data(), 0);
nvte_quantize(input.data(), output.data(), nullptr, 0);

float ref_amax;
float ref_scale;
Expand Down
26 changes: 13 additions & 13 deletions tests/cpp/operator/test_cast_transpose_dbias_dgelu.cu
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <cuda_runtime.h>
#include <gtest/gtest.h>

#include <transformer_engine/transpose.h>
#include <transformer_engine/cast.h>
#include "../test_common.h"

using namespace transformer_engine;
Expand Down Expand Up @@ -104,22 +104,22 @@ void performTest(const size_t N, const size_t H) {

Tensor workspace;

nvte_cast_transpose_dbias_dgelu(input.data(),
gelu_input.data(),
output.data(),
dbias.data(),
workspace.data(),
0);
nvte_quantize_dbias_dgelu(input.data(),
gelu_input.data(),
output.data(),
dbias.data(),
workspace.data(),
0);

workspace = Tensor("workspace", workspace.rowwise_shape(), workspace.dtype());


nvte_cast_transpose_dbias_dgelu(input.data(),
gelu_input.data(),
output.data(),
dbias.data(),
workspace.data(),
0);
nvte_quantize_dbias_dgelu(input.data(),
gelu_input.data(),
output.data(),
dbias.data(),
workspace.data(),
0);

cudaDeviceSynchronize();
auto err = cudaGetLastError();
Expand Down
2 changes: 1 addition & 1 deletion tests/cpp/operator/test_dequantize_mxfp8.cu
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ void performTest_quantize_then_dequantize(const size_t rows,
const size_t copy_size = sizeof(InputType) * rows * cols;
cudaMemcpy(input_cpu.get(), input.rowwise_dptr(), copy_size, cudaMemcpyDeviceToHost);

nvte_quantize(input.data(), quantized.data(), 0);
nvte_quantize(input.data(), quantized.data(), nullptr, 0);
cudaDeviceSynchronize();

const size_t copy_size_quantized = sizeof(IntermediateType) * rows * cols;
Expand Down
Loading
Loading