Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2025-2026, NVIDIA CORPORATION. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,6 +21,7 @@
#include <cstdint>
#include <cuda_fp8.h>
#include <cuda_runtime_api.h>
#include <type_traits>
#include <vector>

// non-persistent-cooperative GEMM
Expand Down Expand Up @@ -55,6 +56,10 @@ class CutlassFp8BlockScaleGemmRunnerInterface
float const* scales_b = nullptr)
= 0;

virtual int64_t getActScaleLeadingDim() const = 0;

virtual bool isActivationPrequantized() const = 0;

virtual void strideBatchGemm(__nv_bfloat16* mat_d, int ld_d, int stride_d, __nv_fp8_e4m3* mat_a, int ld_a,
int stride_a, __nv_fp8_e4m3* mat_b, int ld_b, int stride_b, int num_problems, int shape_m, int shape_n,
int shape_k, cudaStream_t stream, float* scales_a, int stride_scales_a, float* scales_b)
Expand Down Expand Up @@ -117,6 +122,16 @@ class CutlassFp8BlockScaleGemmRunner : public CutlassFp8BlockScaleGemmRunnerInte
size_t num_problems, size_t shape_n, size_t shape_k, cudaStream_t stream, float const* scales_a = nullptr,
float const* scales_b = nullptr) override;

int64_t getActScaleLeadingDim() const override
{
return max_shape_m_32_align_padded_;
}

bool isActivationPrequantized() const override
{
return std::is_same_v<ElementA, __nv_fp8_e4m3>;
}

void strideBatchGemm(__nv_bfloat16* mat_d, int ld_d, int stride_d, __nv_fp8_e4m3* mat_a, int ld_a, int stride_a,
__nv_fp8_e4m3* mat_b, int ld_b, int stride_b, int num_problems, int shape_m, int shape_n, int shape_k,
cudaStream_t stream, float* scales_a, int stride_scales_a, float* scales_b) override;
Expand Down
Loading
Loading