Skip to content
Open
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
5 changes: 4 additions & 1 deletion transformer_engine/common/cast/dispatch/gated.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ void quantize_gated_fwd_helper(const NVTETensor nvte_input, NVTETensor nvte_outp

switch (output->scaling_mode) {
case NVTE_DELAYED_TENSOR_SCALING: {
// Only dispatch the FP8 TMA kernel when quantizing to FP8; for non-FP8 outputs
// (e.g. BF16/FP16/FP32), the vectorized pointwise kernel avoids TMA/shared-memory
// overhead and achieves higher memory bandwidth.
const bool use_tma_kernels =
(cols % 32 == 0) && is_supported_by_CC_100() &&
is_fp8_dtype(output->dtype()) && (cols % 32 == 0) && is_supported_by_CC_100() &&
fp8::cast_gated_tma_fits_device</*IS_BWD=*/false, ParamOP, ActOP, nullptr>(
input.dtype(), output->dtype());
if (use_tma_kernels) {
Expand Down