"platforms/opencl/src/OpenCLFFT3D.h" did not exist on "e561a67824a1a0ac544547ff4c08baa4853d1b5f"
topk_transform.h 998 Bytes
Newer Older
Xiaowei.zhang's avatar
Xiaowei.zhang committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// These interfaces were ported from sglang.
#pragma once

#include <ATen/ATen.h>
#include <ATen/Tensor.h>
#include <Python.h>
#include <torch/all.h>
#include <torch/library.h>
#include <torch/torch.h>
#include <tuple>
#include <vector>

#include <torch/extension.h>


void fast_topk_interface(
    const torch::Tensor& score,
    torch::Tensor& indices,
    const torch::Tensor& lengths,
    std::optional<torch::Tensor> row_starts_opt = std::nullopt);

void fast_topk_transform_interface(
    const torch::Tensor& score,
    const torch::Tensor& lengths,
    torch::Tensor& dst_page_table,
    const torch::Tensor& src_page_table,
    const torch::Tensor& cu_seqlens_q,
    std::optional<torch::Tensor> row_starts_opt = std::nullopt);

void fast_topk_transform_ragged_interface(
    const torch::Tensor& score,
    const torch::Tensor& lengths,
    torch::Tensor& topk_indices_ragged,
    const torch::Tensor& topk_indices_offset,
    std::optional<torch::Tensor> row_starts_opt = std::nullopt);