Skip to content

Commit 8058e1c

Browse files
committed
Changes done internally at Facebook
baa5235524cdb0c60ff8a448c802ff575122b986 Lu Fang <lufang@fb.com> Eliminate c10::optional usage in vllm_flash_attn
1 parent 323b789 commit 8058e1c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

csrc/flash_attn/flash_api.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -346,14 +346,14 @@ mha_fwd_sparse(at::Tensor &q, // batch_size x seqlen_q x num_heads x hea
346346
const at::Tensor &block_offset,
347347
const at::Tensor &column_count,
348348
const at::Tensor &column_index,
349-
const c10::optional<at::Tensor> &out_, // batch_size x seqlen_q x num_heads x head_size
350-
const c10::optional<at::Tensor> &alibi_slopes_, // num_heads or batch_size x num_heads
349+
const std::optional<at::Tensor> &out_, // batch_size x seqlen_q x num_heads x head_size
350+
const std::optional<at::Tensor> &alibi_slopes_, // num_heads or batch_size x num_heads
351351
const double p_dropout,
352352
const double softmax_scale,
353353
bool is_causal,
354354
const double softcap,
355355
const bool return_softmax,
356-
c10::optional<at::Generator> gen_) {
356+
std::optional<at::Generator> gen_) {
357357

358358
auto dprops = at::cuda::getCurrentDeviceProperties();
359359
// bool is_sm75 = dprops->major == 7 && dprops->minor == 5;
@@ -515,11 +515,11 @@ mha_varlen_fwd_sparse(at::Tensor &q, // total_q x num_heads x head_size, total_
515515
const at::Tensor &block_offset,
516516
const at::Tensor &column_count,
517517
const at::Tensor &column_index,
518-
const c10::optional<at::Tensor> &out_, // total_q x num_heads x head_size, total_k := \sum_{i=0}^{b} s_i
518+
const std::optional<at::Tensor> &out_, // total_q x num_heads x head_size, total_k := \sum_{i=0}^{b} s_i
519519
const at::Tensor &cu_seqlens_q, // b+1
520520
const at::Tensor &cu_seqlens_k, // b+1
521-
const c10::optional<at::Tensor> &seqused_k, // b. If given, only this many elements of each batch element's keys are used.
522-
const c10::optional<at::Tensor> &alibi_slopes_, // num_heads or b x num_heads
521+
const std::optional<at::Tensor> &seqused_k, // b. If given, only this many elements of each batch element's keys are used.
522+
const std::optional<at::Tensor> &alibi_slopes_, // num_heads or b x num_heads
523523
int64_t max_seqlen_q,
524524
const int64_t max_seqlen_k,
525525
const double p_dropout,
@@ -528,7 +528,7 @@ mha_varlen_fwd_sparse(at::Tensor &q, // total_q x num_heads x head_size, total_
528528
bool is_causal,
529529
const double softcap,
530530
const bool return_softmax,
531-
c10::optional<at::Generator> gen_) {
531+
std::optional<at::Generator> gen_) {
532532

533533
auto dprops = at::cuda::getCurrentDeviceProperties();
534534
// bool is_sm75 = dprops->major == 7 && dprops->minor == 5;

0 commit comments

Comments
 (0)