Commit ec328c1
Synthetic Dataset: Prefix Caching Controls (#183)
## Summary
<!--
Include a short paragraph of the changes introduced in this PR.
If this PR requires additional context or rationale, explain why
the changes are necessary.
-->
Work to allow control of token prefix cache rates with the synthetic
data generator. Firstly adds an auto-incrementing single token prefix to
ensure we never repeat the same prefix. Secondly adds controls for
sharing a fixed prefix between samples.
## Details
<!--
Provide a detailed list of all changes introduced in this pull request.
-->
### 1. Ensure every prompt is unique
When generating a prompt, the first token is now taken from an iterator
over the tokenizer vocab.
### 2. Add configurable prefix to simulate system prompt or other common
token prefixes
Example usage:
```yaml
data:
prefix_tokens: 2048
prompt_tokens: 256,
output_tokens: 256,
samples: 1024
```
## Test Plan
<!--
List the steps needed to test this PR.
-->
- PR includes unit tests for all synthetic dataset changes (`pytest
tests/unit/dataset`)
- Scenario in the Details section can be used against a model server
with prefix caching and the cache rate can be confirmed by inspecting
console output.
## Related Issues
<!--
Link any relevant issues that this PR addresses.
-->
- Resolves #104
- Resolves #186
---
- [x] "I certify that all code in this PR is my own, except as noted
below."
## Use of AI
- [x] Includes AI-assisted code completion
- [ ] Includes code generated by an AI application
- [x] Includes AI-generated tests (NOTE: AI written tests should have a
docstring that includes `## WRITTEN BY AI ##`)
---------
Signed-off-by: Samuel Monson <[email protected]>
Co-authored-by: Mehul <[email protected]>
Co-authored-by: Mark Kurtz <[email protected]>1 parent 3e274d3 commit ec328c1
File tree
4 files changed
+904
-9
lines changed- docs
- src/guidellm/dataset
- tests/unit/dataset
4 files changed
+904
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
28 | 34 | | |
29 | 35 | | |
30 | 36 | | |
| |||
163 | 169 | | |
164 | 170 | | |
165 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
166 | 176 | | |
167 | 177 | | |
168 | 178 | | |
169 | 179 | | |
170 | 180 | | |
171 | 181 | | |
172 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
173 | 190 | | |
174 | | - | |
175 | | - | |
| 191 | + | |
| 192 | + | |
176 | 193 | | |
177 | 194 | | |
178 | 195 | | |
179 | | - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
180 | 199 | | |
181 | | - | |
| 200 | + | |
182 | 201 | | |
183 | 202 | | |
184 | 203 | | |
| 204 | + | |
185 | 205 | | |
186 | 206 | | |
187 | 207 | | |
188 | 208 | | |
189 | | - | |
| 209 | + | |
190 | 210 | | |
191 | | - | |
192 | | - | |
193 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
194 | 214 | | |
195 | 215 | | |
196 | 216 | | |
197 | 217 | | |
198 | | - | |
| 218 | + | |
| 219 | + | |
199 | 220 | | |
200 | 221 | | |
201 | 222 | | |
| |||
Whitespace-only changes.
0 commit comments