InfiniOps
Operator Library for Accelerators
Loading...
Searching...
No Matches
infini::ops::GroupedTopk Class Referenceabstract

#include <grouped_topk.h>

Inheritance diagram for infini::ops::GroupedTopk:
infini::ops::Operator< GroupedTopk > infini::ops::OperatorBase infini::ops::OperatorBase

Public Member Functions

 GroupedTopk (const Tensor scores, const Tensor bias, const int64_t num_expert_group, const int64_t topk_group, const int64_t topk, const bool renormalize, const double routed_scaling_factor, const int64_t scoring_func, Tensor topk_values, Tensor topk_indices)
 
virtual void operator() (const Tensor scores, const Tensor bias, const int64_t num_expert_group, const int64_t topk_group, const int64_t topk, const bool renormalize, const double routed_scaling_factor, const int64_t scoring_func, Tensor topk_values, Tensor topk_indices) const =0
 
- Public Member Functions inherited from infini::ops::Operator< GroupedTopk >
void operator() (const Handle &handle, const Args &... args)
 
void operator() (const Args &... args) const
 
void operator() (const Handle &handle, const Args &... args)
 
void operator() (const Args &... args) const
 
- Public Member Functions inherited from infini::ops::OperatorBase
virtual ~OperatorBase ()=default
 
virtual std::size_t workspace_size_in_bytes () const
 
void set_handle (const Handle &handle)
 
void set_config (const Config &config)
 
void set_stream (void *stream)
 
void set_workspace (void *workspace)
 
void set_workspace_size_in_bytes (std::size_t workspace_size_in_bytes)
 
virtual ~OperatorBase ()=default
 
virtual std::size_t workspace_size_in_bytes () const
 
void set_handle (const Handle &handle)
 
void set_config (const Config &config)
 
void set_stream (void *stream)
 
void set_workspace (void *workspace)
 
void set_workspace_size_in_bytes (std::size_t workspace_size_in_bytes)
 

Protected Member Functions

void ValidateCallMetadata (const Tensor scores, const Tensor bias, const int64_t num_expert_group, const int64_t topk_group, const int64_t topk, const bool renormalize, const double routed_scaling_factor, const int64_t scoring_func, Tensor topk_values, Tensor topk_indices) const
 

Protected Attributes

Tensor::Size num_tokens_ {0}
 
Tensor::Size num_experts_ {0}
 
int64_t num_expert_group_ {0}
 
int64_t topk_group_ {0}
 
int64_t topk_ {0}
 
bool renormalize_ {false}
 
double routed_scaling_factor_ {1.0}
 
int64_t scoring_func_ {0}
 
DataType scores_dtype_
 
DataType bias_dtype_
 
int device_index_ {0}
 
- Protected Attributes inherited from infini::ops::OperatorBase
std::unique_ptr< Handle > handle_ptr_
 
std::unique_ptr< Config > config_ptr_
 
void * stream_ {nullptr}
 
void * workspace_ {nullptr}
 
std::size_t workspace_size_in_bytes_ {0}
 

Additional Inherited Members

- Static Public Member Functions inherited from infini::ops::Operator< GroupedTopk >
static void clear_cache ()
 
static void clear_cache ()
 
static std::unique_ptr< Operator > Make (const Config &config, const Tensor tensor, Args &&... args)
 
static std::unique_ptr< Operator > Make (const Tensor tensor, Args &&... args)
 
static std::unique_ptr< Operator > Make (const Config &config, const std::vector< Tensor > tensors, Args &&... args)
 
static std::unique_ptr< Operator > Make (const std::vector< Tensor > tensors, Args &&... args)
 
static std::unique_ptr< Operator > Make (const Config &config, const Tensor tensor, Args &&... args)
 
static std::unique_ptr< Operator > Make (const Tensor tensor, Args &&... args)
 
static std::unique_ptr< Operator > Make (const Config &config, const std::vector< Tensor > tensors, Args &&... args)
 
static std::unique_ptr< Operator > Make (const std::vector< Tensor > tensors, Args &&... args)
 
static void Call (const Handle &handle, const Config &config, const Args &... args)
 
static void Call (const Tensor tensor, const Args &... args)
 
static auto Call (const TensorLike &tensor, const Args &... args)
 
static void Call (const Handle &handle, const Config &config, const Args &... args)
 
static void Call (const Tensor tensor, const Args &... args)
 
static auto Call (const TensorLike &tensor, const Args &... args)
 
static std::vector< std::size_t > active_implementation_indices (Device::Type dev_type)
 
static std::vector< std::size_t > active_implementation_indices (Device::Type dev_type)
 
- Static Protected Attributes inherited from infini::ops::Operator< GroupedTopk >
static constexpr Device::Type device_type_
 
static constexpr std::size_t implementation_index_
 

Constructor & Destructor Documentation

◆ GroupedTopk()

infini::ops::GroupedTopk::GroupedTopk ( const Tensor  scores,
const Tensor  bias,
const int64_t  num_expert_group,
const int64_t  topk_group,
const int64_t  topk,
const bool  renormalize,
const double  routed_scaling_factor,
const int64_t  scoring_func,
Tensor  topk_values,
Tensor  topk_indices 
)
inline

Member Function Documentation

◆ operator()()

virtual void infini::ops::GroupedTopk::operator() ( const Tensor  scores,
const Tensor  bias,
const int64_t  num_expert_group,
const int64_t  topk_group,
const int64_t  topk,
const bool  renormalize,
const double  routed_scaling_factor,
const int64_t  scoring_func,
Tensor  topk_values,
Tensor  topk_indices 
) const
pure virtual

◆ ValidateCallMetadata()

void infini::ops::GroupedTopk::ValidateCallMetadata ( const Tensor  scores,
const Tensor  bias,
const int64_t  num_expert_group,
const int64_t  topk_group,
const int64_t  topk,
const bool  renormalize,
const double  routed_scaling_factor,
const int64_t  scoring_func,
Tensor  topk_values,
Tensor  topk_indices 
) const
inlineprotected

Member Data Documentation

◆ bias_dtype_

DataType infini::ops::GroupedTopk::bias_dtype_
protected

◆ device_index_

int infini::ops::GroupedTopk::device_index_ {0}
protected

◆ num_expert_group_

int64_t infini::ops::GroupedTopk::num_expert_group_ {0}
protected

◆ num_experts_

Tensor::Size infini::ops::GroupedTopk::num_experts_ {0}
protected

◆ num_tokens_

Tensor::Size infini::ops::GroupedTopk::num_tokens_ {0}
protected

◆ renormalize_

bool infini::ops::GroupedTopk::renormalize_ {false}
protected

◆ routed_scaling_factor_

double infini::ops::GroupedTopk::routed_scaling_factor_ {1.0}
protected

◆ scores_dtype_

DataType infini::ops::GroupedTopk::scores_dtype_
protected

◆ scoring_func_

int64_t infini::ops::GroupedTopk::scoring_func_ {0}
protected

◆ topk_

int64_t infini::ops::GroupedTopk::topk_ {0}
protected

◆ topk_group_

int64_t infini::ops::GroupedTopk::topk_group_ {0}
protected

The documentation for this class was generated from the following file: