Skip to content

Update kernel_wrapper.cpp - #49

Open
Bjorntday wants to merge 1 commit into
Tencent:mainfrom
Bjorntday:main
Open

Bjorntday wants to merge 1 commit into
Tencent:mainfrom
Bjorntday:main

Conversation

@Bjorntday

@Bjorntday Bjorntday commented Jul 2, 2025

Copy link
Copy Markdown

Fix the issues that occur when running cmake -DSM=86 -DWITH_TESTING=ON .. && make -j32 for Ksana_llm error information:
/home/ubuntu/KsanaLLM/src/ksana_llm/kernels/nvidia/kernel_wrapper.cpp: In function ‘void ksana_llm::InvokePagedAttention(void*, void*, void**, void**, void*, int, cudaStream_t, void*, int, int, int, int, int, int, float, float, int, void*, void*, int, std::optional<llm_kernels::nvidia::RotaryEmbeddingCuda<SCALAR_T> >&, void*, float, bool, void*, void*, size_t, int, const std::optional<void*>&, void*, void*, void*, int32_t*, int64_t, int, bool, bool, bool, float, size_t)’:
/home/ubuntu/KsanaLLM/src/ksana_llm/kernels/nvidia/kernel_wrapper.cpp:1248:21: error: cannot bind non-const lvalue reference of type ‘std::optional&’ to an rvalue of type ‘std::optional’
1248 | block_table_tensor, // batch_size x max_num_blocks_per_seq
| ^~~~~~~~~~~~~~~~~~
In file included from /usr/local/lib/python3.12/dist-packages/torch/include/c10/util/StringUtil.h:9:
/usr/include/c++/13/optional:768:9: note: after user-defined conversion: ‘constexpr std::optional<_Tp>::optional(const std::optional<_Up>&) [with _Up = at::Tensor; typename std::enable_if<__and_v<std::_not<std::is_same<_T1, _U1> >, std::is_constructible<_T1, const _U1&>, std::is_convertible<const _Up&, _Tp>, std::_not<std::_or<std::is_constructible<_Tp, const std::optional<_Up>&>, std::is_constructible<_Tp, std::optional<_Up>&>, std::is_constructible<_Tp, const std::optional<_Up>&&>, std::is_constructible<_Tp, std::optional<_Up>&&>, std::is_convertible<const std::optional<_Up>&, _Tp>, std::is_convertible<std::optional<_Up>&, _Tp>, std::is_convertible<const std::optional<_Up>&&, _Tp>, std::is_convertible<std::optional<_Up>&&, _Tp> > > >, bool>::type = true; _Tp = const at::Tensor]’

When the flash-attn version is 2.6.2, the function interfaces in src\ksana_llm\kernels\nvidia\kernel_wrapper.cpp do not correspond to those in ksana_llm/kernels/nvidia/flash_attn_cpp_wrapper.h.

fix bug for flash-attn v2.6.2
@tencent-adm

tencent-adm commented Jul 2, 2025

Copy link
Copy Markdown
Member

CLA assistant check
All committers have signed the CLA.

@whitelok

whitelok commented Jul 7, 2025

Copy link
Copy Markdown
Contributor

pls check latest commit(9173531) whether still reproduce this issue.

thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants