Skip to content

armgit / uzu

Public Imported from GitHub
0

A high-performance inference engine for AI models

1.2 KB
Raw Blame
// Autogenerated stub
import definitions;

[[Variants("HEAD_DIM", "128")]]
[[Public]] [[Kernel]] func AncestorAttention<let HEAD_DIM: uint32_t>(
  StructuredBuffer<int8_t> prefix_k_codes,
  StructuredBuffer<BFloat16> prefix_k_scales,
  StructuredBuffer<uint8_t> prefix_v_codes,
  StructuredBuffer<BFloat16> prefix_v_scales,
  RWStructuredBuffer<int8_t> node_k_codes,
  RWStructuredBuffer<BFloat16> node_k_scales,
  RWStructuredBuffer<uint8_t> node_v_codes,
  RWStructuredBuffer<BFloat16> node_v_scales,
  StructuredBuffer<BFloat16> current_qkv,
  StructuredBuffer<float> cosines,
  StructuredBuffer<float> sines,
  StructuredBuffer<uint32_t> node_metadata,
  StructuredBuffer<uint32_t> ancestor_indices,
  StructuredBuffer<uint32_t> ancestor_counts,
  StructuredBuffer<uint32_t> node_indices,
  RWStructuredBuffer<BFloat16> output,
  uint32_t rows,
  uint32_t prefix_length,
  uint32_t ancestor_stride,
  uint32_t node_capacity,
  uint32_t max_depth,
  float scale,
  [[Specialize]] uint32_t num_heads,
  [[Specialize]] uint32_t backend_opaque_layout,
  ThreadContext thread_context,
  [[Groups("(rows * num_heads).div_ceil(4)")]] uint32_t group,
  [[Threads("(4 * 32)")]] uint32_t lid,
) {
  // TODO
}