CodeRankEmbed 的 bf16 量化版内置三层注意力调度
原标题:handwoven8588/CodeRankEmbed-flash-attn
AI 摘要
Hugging Face 用户 handwoven8588 发布了 CodeRankEmbed-flash-attn,这是对 nomic-ai/CodeRankEmbed 的 bf16 量化版本,权重未重新训练。该仓库在自定义 modeling 文件中内置三层注意力调度(torch_varlen、flash_attn、eager),用 O(N) 非填充路径替代原有 O(seq²) 的 eager 注意力,以解决大 batch 下的显存溢出问题。实测显示 torch_varlen 与原始输出余弦相似度约 0.9999,峰值显存从约 1145 MiB 降至 875 MiB。
正文节选
--- base_model: nomic-ai/CodeRankEmbed base_model_relation: quantized library_name: sentence-transformers license: mit tags: - flash-attention - code-retrieval - sentence-transformers - nomic-bert - bf16 language: - en --- # CodeRankEmbed-flash-attn A **bf16 quantization of [`nomic-ai/CodeRankEmbed`](https://huggingface.co/nomic-ai/CodeRankEmbed)** with a **three-tier attention dispatch built into a custom `modeling_hf_nomic_bert.py` shipped in this repo.** It is not a finetune — the weights a