Fix _riscv_supports_rvv_vlen128() to detect RVV on hardware without zvl flags (#43179)

Signed-off-by: liuyudong <liuyudong@iscas.ac.cn>
Co-authored-by: YuanSheng <yuansheng@isrc.iscas.ac.cn>
This commit is contained in:
lyd1992
2026-06-18 21:22:35 +08:00
committed by GitHub
co-authored by YuanSheng
parent 4cb5e746b6
commit 021cdf72bc
3 changed files with 30 additions and 3 deletions
+11
View File
@@ -11,6 +11,17 @@ static inline cpu_attention::Fp8KVCacheDataType parse_fp8_kv_dtype(
return cpu_attention::Fp8KVCacheDataType::kAuto;
}
bool cpu_attn_has_isa(const std::string& isa) {
if (isa == "rvv") {
#if defined(__riscv) && defined(__riscv_v_min_vlen) && __riscv_v_min_vlen == 128
return true;
#else
return false;
#endif
}
return false;
}
torch::Tensor get_scheduler_metadata(
const int64_t num_req, const int64_t num_heads_q,
const int64_t num_heads_kv, const int64_t head_dim,