microsoft / microsoft/onnxruntime

[Feature Request] transformers convert_generation.py only support three types: beam_search,greedy_search and sampling?

Open
#17,050 5 comments 0 reactions 0 assignees View on GitHub
feature request
Dominant language
C++
Stars
21.9k
Forks
4.2k
Avg merge
4d 11h
Merged PRs (30d)
184

Description

### Describe the feature request

I have noticed that in https://github.com/microsoft/onnxruntime/blob/main/onnxruntime/python/tools/transformers/convert_generation.py, it only supports three types: beam_search,greedy_search and sampling.

```python
class GenerationType(Enum):
BEAMSEARCH = "beam_search"
GREEDYSEARCH = "greedy_search"
SAMPLING = "sampling"

```

Is there support for other types, such as beam_sample? If not, are there any plans to support it?

### Describe scenario use case

In fairseq\transformers\src\transformers\generation\utils.py, there are 7 types of generation, contrastive_search, greedy_search, sample, beam_search, beam_sample, group_beam_search and constrained_beam_search.

Contributor guide

Open the contributing guide

Research direction

Start by reading onnxruntime/python/tools/transformers/convert_generation.py, especially the GenerationType enum, and compare its supported modes with fairseq/transformers/src/transformers/generation/utils.py. Determine the scope and design needed for additional generation types such as beam_sample; done means the supported behavior and plans are clearly established and the converter handles the agreed types.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.