Skip to content

Commit 1d2c21e

Browse files
houseroadMu Huai
authored and
Mu Huai
committed
[Easy] Eliminate c10::optional usage in vllm/csrc (vllm-project#17819)
Signed-off-by: Mu Huai <tianbowen.tbw@antgroup.com>
1 parent 0ef7d61 commit 1d2c21e

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

csrc/quantization/gptq_allspark/allspark_qgemm_w8a16.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ at::Tensor as_g_workspace;
99

1010
torch::Tensor allspark_w8a16_gemm(
1111
torch::Tensor const& a, torch::Tensor const& b_qweight,
12-
torch::Tensor const& b_scales, c10::optional<torch::Tensor> const& b_qzeros,
12+
torch::Tensor const& b_scales, std::optional<torch::Tensor> const& b_qzeros,
1313
int64_t n, int64_t group_size, int64_t sm_count, int64_t sm_version,
1414
int64_t CUBLAS_M_THRESHOLD, bool has_zp, bool n32k16_reorder) {
1515
TORCH_CHECK_NOT_IMPLEMENTED(
@@ -918,7 +918,7 @@ void allspark_qgemm_w8a16_perc_ampere(
918918

919919
torch::Tensor allspark_w8a16_gemm(
920920
torch::Tensor const& a, torch::Tensor const& b_qweight,
921-
torch::Tensor const& b_scales, c10::optional<torch::Tensor> const& b_qzeros,
921+
torch::Tensor const& b_scales, std::optional<torch::Tensor> const& b_qzeros,
922922
int64_t n, int64_t group_size, int64_t sm_count, int64_t sm_version,
923923
int64_t CUBLAS_M_THRESHOLD, bool has_zp, bool n32k16_reorder) {
924924
// Verify device and strides

csrc/quantization/gptq_allspark/allspark_repack.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ void rearrange_kn_weight_as_n32k16_order_ldg16(
100100

101101
void rearrange_kn_weight_as_n32k16_order(
102102
torch::Tensor const& b_qweight, torch::Tensor const& b_scales,
103-
c10::optional<torch::Tensor> const& b_zeros, bool has_zp,
103+
std::optional<torch::Tensor> const& b_zeros, bool has_zp,
104104
torch::Tensor& b_qweight_reorder, torch::Tensor& b_scales_reorder,
105-
c10::optional<torch::Tensor> const& b_zeros_reorder, const int64_t K,
105+
std::optional<torch::Tensor> const& b_zeros_reorder, const int64_t K,
106106
const int64_t N, const int64_t N_32align) {
107107
// Verify device and strides
108108
TORCH_CHECK(b_qweight.device().is_cuda(), "b_qweight is not on GPU");

csrc/rocm/attention.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1597,7 +1597,7 @@ void paged_attention_custom_launcher(
15971597
torch::Tensor& block_tables, torch::Tensor& context_lens,
15981598
const std::optional<torch::Tensor>& query_start_loc, int max_context_len,
15991599
const std::optional<torch::Tensor>& alibi_slopes, torch::Tensor& k_scale,
1600-
torch::Tensor& v_scale, const c10::optional<torch::Tensor>& fp8_out_scale) {
1600+
torch::Tensor& v_scale, const std::optional<torch::Tensor>& fp8_out_scale) {
16011601
int num_seqs = block_tables.size(0);
16021602
int num_heads = query.size(1);
16031603
int head_size = query.size(2);
@@ -1825,7 +1825,7 @@ void paged_attention(
18251825
const std::optional<torch::Tensor>& alibi_slopes,
18261826
const std::string& kv_cache_dtype, torch::Tensor& k_scale,
18271827
torch::Tensor& v_scale,
1828-
const c10::optional<torch::Tensor>& fp8_out_scale) {
1828+
const std::optional<torch::Tensor>& fp8_out_scale) {
18291829
// clang-format on
18301830
const int head_size = query.size(2);
18311831
if (kv_cache_dtype == "auto") {

csrc/rocm/ops.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ void paged_attention(
1919
const std::optional<torch::Tensor>& query_start_loc, int64_t block_size,
2020
int64_t max_context_len, const std::optional<torch::Tensor>& alibi_slopes,
2121
const std::string& kv_cache_dtype, torch::Tensor& k_scale,
22-
torch::Tensor& v_scale, const c10::optional<torch::Tensor>& fp8_out_scale);
22+
torch::Tensor& v_scale, const std::optional<torch::Tensor>& fp8_out_scale);

0 commit comments

Comments
 (0)