fix(workflow-operator): carry structured task context into chat fallback payloads - #7798
Merged
Merged
Conversation
Contributor
Backport auto-label reportThis
|
Contributor
Automated Reviewer SuggestionsBased on the
|
Contributor
Author
|
/request-review @xuang7 |
Contributor
|
| config | throughput | MB/s | latency | max Δ latest / 7d | |
|---|---|---|---|---|---|
| 🔴 | bs=10 sw=10 sl=64 | 373 | 0.228 | 28,239/33,413/33,413 us | 🔴 +37.4% / 🔴 +121.5% |
| 🔴 | bs=100 sw=10 sl=64 | 784 | 0.478 | 125,397/170,879/170,879 us | 🔴 +23.8% / 🔴 +60.0% |
| ⚪ | bs=1000 sw=10 sl=64 | 920 | 0.562 | 1,087,072/1,123,787/1,123,787 us | ⚪ within ±5% / 🔴 +11.9% |
Baseline details
Latest main 5f95b67 from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 373 tuples/sec | 401 tuples/sec | 771.02 tuples/sec | -7.0% | -51.6% |
| bs=10 sw=10 sl=64 | MB/s | 0.228 MB/s | 0.245 MB/s | 0.471 MB/s | -6.9% | -51.6% |
| bs=10 sw=10 sl=64 | p50 | 28,239 us | 20,558 us | 12,749 us | +37.4% | +121.5% |
| bs=10 sw=10 sl=64 | p95 | 33,413 us | 45,932 us | 15,594 us | -27.3% | +114.3% |
| bs=10 sw=10 sl=64 | p99 | 33,413 us | 45,932 us | 19,320 us | -27.3% | +72.9% |
| bs=100 sw=10 sl=64 | throughput | 784 tuples/sec | 821 tuples/sec | 997.05 tuples/sec | -4.5% | -21.4% |
| bs=100 sw=10 sl=64 | MB/s | 0.478 MB/s | 0.501 MB/s | 0.609 MB/s | -4.6% | -21.5% |
| bs=100 sw=10 sl=64 | p50 | 125,397 us | 121,250 us | 100,339 us | +3.4% | +25.0% |
| bs=100 sw=10 sl=64 | p95 | 170,879 us | 138,030 us | 106,781 us | +23.8% | +60.0% |
| bs=100 sw=10 sl=64 | p99 | 170,879 us | 138,030 us | 113,101 us | +23.8% | +51.1% |
| bs=1000 sw=10 sl=64 | throughput | 920 tuples/sec | 926 tuples/sec | 1,037 tuples/sec | -0.6% | -11.3% |
| bs=1000 sw=10 sl=64 | MB/s | 0.562 MB/s | 0.565 MB/s | 0.633 MB/s | -0.5% | -11.2% |
| bs=1000 sw=10 sl=64 | p50 | 1,087,072 us | 1,080,533 us | 971,388 us | +0.6% | +11.9% |
| bs=1000 sw=10 sl=64 | p95 | 1,123,787 us | 1,133,336 us | 1,013,249 us | -0.8% | +10.9% |
| bs=1000 sw=10 sl=64 | p99 | 1,123,787 us | 1,133,336 us | 1,039,879 us | -0.8% | +8.1% |
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,536.55,200,128000,373,0.228,28238.77,33412.94,33412.94
1,100,10,64,20,2552.64,2000,1280000,784,0.478,125396.95,170879.27,170879.27
2,1000,10,64,20,21728.44,20000,12800000,920,0.562,1087071.84,1123787.12,1123787.12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this PR?
The five structured Hugging Face tasks (
question-answering,table-question-answering,zero-shot-classification,sentence-similarity,text-ranking) build a native HF pipeline payload that onlyhf-inferenceunderstands. When the operator fell back to a third-party chat-completions provider, all three chat branches sent just the prompt cell, dropping thecontext, table, candidate labels, or sentence list, so the model answered without the input that defines the task.
This adds a
_chat_content_for_taskhelper to the generated operator that reformulates each of the five tasks into a chat prompt carrying its full context, and routes all three chat branches (zai-org, OpenAI-compatible, unknown-provider fallback) through it. Other tasks pass through unchanged.QaRankingCodegen.parsePythonis also extended to readchoices[0].message.contentfrom chat responses, keeping the native{"answer": ...}shape as the primary path, the same idiomImageTaskCodegenalready uses.Any related issues?
Closes #7195
How was this PR tested?
131 tests pass in the
WorkflowOperatorHugging Face suites,PythonCodeRawInvalidTextSpecpy-compiles the generated Python for all 117 operators, andscalafmtCheckis clean for main and test sources. A new spec test asserts the helper is emitted and used by every chat branch, with one assertion per task reformulation; two existing tests were updated where they pinned the old parse expression.Was this PR authored or co-authored using generative AI tooling?
Yes, this PR was co-authored with Claude in compliance with ASF policy.