AI-Hypercomputer / AI-Hypercomputer/maxtext

Create a user friendly inference demo

未关闭
#532 0 条评论 0 个 reaction 已指派 1 人 已被 @vipannalla 认领 在 GitHub 查看
inference
主要语言
Python
星标
2.4k
派生
607
平均合并
2 天 19 小时
30 天内合并 PR
158

描述

This is a feature request.

I like `maxtext` because it is very customizable and efficient for training.
The main issue I’m having is hacking away an inference function. The code is quite complex so not straightforward to do.
The simple `decode.py` works but it seems mainly experimental development for streaming.

I think streaming will be really cool, but we would also benefit from an easy `model.generate(input_ids, attention_mask, params)` function:
* it should allow prefill based on the length of `input_ids` (user responsibility to try to supply not too many shapes to avoid recompilation)
* it should allow batch input, with left padding to support different input length
* should be compilable with `jit`/`pjit`
* allow a few common sampling strategy: greedy, sample (with temperature, top k, top p), beam search
* allow being used without a separate engine/service in case we want to make it part of a larger function that includes multiple models

This PR looked interesting: https://github.com/google/maxtext/pull/402
I think that it was mainly for benchmarking though as it didn’t stop when the entire batch was eos but had a nice prefill functionality.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。