Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 14 additions & 0 deletions transformer_engine/common/include/transformer_engine/transpose.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,20 @@ void nvte_fp8_transpose_dbias(const NVTETensor input, NVTETensor transposed_outp
void nvte_multi_cast_transpose(size_t num_tensors, const NVTETensor* input_list,
NVTETensor* output_list, cudaStream_t stream);

/*! \brief Cast multiple input tensors to 1D block-scaled FP8 tensors.
*
* \param[in] num_tensors Number of tensors.
* \param[in] input_list List of input tensors.
* \param[in,out] output_list List of 1D block-scaled FP8 output tensors.
* \param[in] quant_config Quantization configuration.
* \param[in] stream CUDA stream used for the operation.
*/
void nvte_multi_quantize_transpose_vector_blockwise(size_t num_tensors,
const NVTETensor* input_list,
NVTETensor* output_list,
const NVTEQuantizationConfig quant_config,
cudaStream_t stream);

/*! \brief Compute backward of GeLU operation on the input, then cast and transpose.
* Additionally, reduce the result of the GeLU backward along the first dimension.
*
Expand Down
6 changes: 6 additions & 0 deletions transformer_engine/common/transpose/cast_transpose.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ void quantize_transpose_vector_blockwise(const SimpleTensor &input, SimpleTensor
const bool pow_2_scale, const SimpleTensor &noop_tensor,
cudaStream_t stream);

void multi_quantize_transpose_vector_blockwise(
const std::vector<Tensor *> &input_list, std::vector<Tensor *> &output_list,
const float epsilon, FP8BlockwiseRowwiseOption rowwise_option,
FP8BlockwiseColumnwiseOption columnwise_option, const bool pow_2_scale,
const SimpleTensor &noop_tensor, cudaStream_t stream);

void quantize_transpose_vector_blockwise_fp4(
const SimpleTensor &input, const SimpleTensor &global_amax, SimpleTensor &scale_inv,
SimpleTensor &scale_inv_t, SimpleTensor &output, SimpleTensor &output_t, const float epsilon,
Expand Down
Loading