You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bugfix: support uint8_t for vec_t class template (#1234)
This PR tries to fix an issue that occured while enabling fp8 kv-cache
support for vllm (vllm-project/vllm#17005).
The issue was that in an generated inc file (e.g. in my case
flashinfer/100/generated/batch_decode_with_kv_cache_dtype_q_bf16_dtype_kv_u8_dtype_o_bf16_dtype_idx_i32_head_dim_qk_128_head_dim_vo_128_posenc_0_use_swa_False_use_logits_cap_False/batch_decode_config.inc
)
we declared DTypeKV to be uint8_t, shown as below:
```
using DTypeKV = uint8_t;
...
struct Params {
...
using DTypeKV = DTypeKV;
...
};
```
Consequently, when we instantiate the vec_ from cast_load_impl defined
in vec_dtypes.cuh, i.e.
```
vec_t<src_float_t, vec_size> tmp;
```
src_float_t is instantiated to uint8_t through template parameter
T=Params::DTypeKV, where Params::DTypeKV is uint8_t.
Because vec_t doesn't have any specialization for uint8_t, we ended up
with the following ptxas error:
```
ptxas fatal : Unresolved extern function '_ZN10flashinfer5vec_tIhLm16EE4loadEPKh'
```
The fix is to add a specialization for uint8_t. However, this may not be
the right fix, because the root cause might be that we shouldn't
generate ```using DTypeKV = uint8_t;``` in the first place.
<!-- .github/pull_request_template.md -->
## 📌 Description
<!-- What does this PR do? Briefly describe the changes and why they’re
needed. -->
## 🔍 Related Issues
<!-- Link any related issues here -->
## 🚀 Pull Request Checklist
Thank you for contributing to FlashInfer! Before we review your pull
request, please make sure the following items are complete.
### ✅ Pre-commit Checks
- [x] I have installed `pre-commit` by running `pip install pre-commit`
(or used your preferred method).
- [x] I have installed the hooks with `pre-commit install`.
- [x] I have run the hooks manually with `pre-commit run --all-files`
and fixed any reported issues.
> If you are unsure about how to set up `pre-commit`, see [the
pre-commit documentation](https://pre-commit.com/).
## 🧪 Tests
- [ ] Tests have been added or updated as needed.
- [ ] All tests are passing (`unittest`, etc.).
## Reviewer Notes
<!-- Optional: anything you'd like reviewers to focus on, concerns, etc.
-->
0 commit comments