Skip to content

Conversation

@Ceng23333
Copy link
Collaborator

  1. API 更新 (include/infiniop/ops/random_sample.h)

    • infiniopRandomSample() 中添加了 previous_tokensprevious_tokens_len 参数
    • 文档说明 previous_tokens 应仅包含唯一 token ID(vLLM 风格)
    • previous_tokens 为 NULL/空时回退到全历史惩罚(向后兼容)
  2. CPU/Metax 实现

    • 仅对 previous_tokens 数组中的 token 应用惩罚(如果提供)
    • 为向后兼容回退到全历史惩罚
    • 支持禁用 topk(0 或 -1 表示考虑所有 token,类似 vLLM)
  3. 测试框架 (test/infiniop/random_sample.py)

    • 添加了包含 previous_tokens(唯一 token)的测试用例
    • 测试空 previous_tokens(全历史回退)
    • 测试重复处理(自动去重)
    • 更新 Python 绑定以使用 c_uint32 处理 previous_tokens

Signed-off-by: Ceng23333 <441651826@qq.com>
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.

2 participants