Skip to content

fix structured_output/guided_output for delayed_sampling #1494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 4, 2025

Conversation

inkcherry
Copy link

@inkcherry inkcherry commented Jun 30, 2025

pick #1270

Under structured_output, Xgrammer needs to modify the logits, and there is a data dependency on the sampling results.
1 if compute logits depend the sampling result , we fetch sample result in advance.
2 if not, we keep its previous behavior to keep performance.
@czhu15

inkcherry and others added 3 commits June 30, 2025 02:02
1 if compute logits depend the sampling result , we fetch sample result
in advance.
2 if not,  we keep its previous behavior to keep performance.

example:
```prompt = ("Generate a JSON with the brand, model and car_type of the most iconic car from the 90's") ```

use dalay_sampling with structure output

```
{
"brand": "Tuner's favorite Mitsubishi",
"model": "Mitsubishi Lancer Evolution VI",
"car_type": "Coupe"
}
```

cc @czhu15

---------

Co-authored-by: root <[email protected]>
@jikunshang
Copy link

/run-gaudi-tests

@xuechendi
Copy link

please update the title, I think this PR is to fix structured_output/guided_output for delayed_sampling. Let's point that out in the title.

Copy link

@xuechendi xuechendi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR looks good, please add a description to explain the existing issue with 'deplayed_sampling + structured_output' and how this PR fixed this issue.

@inkcherry inkcherry changed the title Fix structure output fix structured_output/guided_output for delayed_sampling Jul 4, 2025
@inkcherry
Copy link
Author

PR looks good, please add a description to explain the existing issue with 'deplayed_sampling + structured_output' and how this PR fixed this issue.

Thanks for pointing that out — I've added a more detailed explanation.

Copy link

@czhu15 czhu15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jikunshang jikunshang merged commit 05dff66 into HabanaAI:habana_main Jul 4, 2025
51 checks passed
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.

4 participants