fix(workflow-operator): validate zero-shot-image-classification labels before running - #7585
fix(workflow-operator): validate zero-shot-image-classification labels before running#7585PG1204 wants to merge 2 commits into
Conversation
|
/request-review @xuang7 |
Backport auto-label reportThis
|
Automated Reviewer SuggestionsBased on the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7585 +/- ##
=========================================
Coverage 88.45% 88.45%
Complexity 4333 4333
=========================================
Files 1176 1176
Lines 46890 46890
Branches 5228 5228
=========================================
Hits 41476 41476
Misses 3665 3665
Partials 1749 1749
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
| config | throughput | MB/s | latency | max Δ latest / 7d | |
|---|---|---|---|---|---|
| 🔴 | bs=10 sw=10 sl=64 | 372 | 0.227 | 25,657/37,043/37,043 us | 🔴 +14.5% / 🔴 +131.7% |
| 🔴 | bs=100 sw=10 sl=64 | 796 | 0.486 | 124,729/160,867/160,867 us | 🔴 +8.1% / 🔴 +48.9% |
| 🟢 | bs=1000 sw=10 sl=64 | 933 | 0.569 | 1,071,173/1,109,503/1,109,503 us | 🟢 -5.1% / 🔴 -9.5% |
Baseline details
Latest main 408b33a from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 372 tuples/sec | 434 tuples/sec | 784.3 tuples/sec | -14.3% | -52.6% |
| bs=10 sw=10 sl=64 | MB/s | 0.227 MB/s | 0.265 MB/s | 0.479 MB/s | -14.3% | -52.6% |
| bs=10 sw=10 sl=64 | p50 | 25,657 us | 22,412 us | 12,590 us | +14.5% | +103.8% |
| bs=10 sw=10 sl=64 | p95 | 37,043 us | 32,899 us | 15,991 us | +12.6% | +131.7% |
| bs=10 sw=10 sl=64 | p99 | 37,043 us | 32,899 us | 18,694 us | +12.6% | +98.2% |
| bs=100 sw=10 sl=64 | throughput | 796 tuples/sec | 821 tuples/sec | 1,002 tuples/sec | -3.0% | -20.6% |
| bs=100 sw=10 sl=64 | MB/s | 0.486 MB/s | 0.501 MB/s | 0.612 MB/s | -3.0% | -20.5% |
| bs=100 sw=10 sl=64 | p50 | 124,729 us | 117,448 us | 101,285 us | +6.2% | +23.1% |
| bs=100 sw=10 sl=64 | p95 | 160,867 us | 148,784 us | 108,068 us | +8.1% | +48.9% |
| bs=100 sw=10 sl=64 | p99 | 160,867 us | 148,784 us | 118,235 us | +8.1% | +36.1% |
| bs=1000 sw=10 sl=64 | throughput | 933 tuples/sec | 934 tuples/sec | 1,030 tuples/sec | -0.1% | -9.4% |
| bs=1000 sw=10 sl=64 | MB/s | 0.569 MB/s | 0.57 MB/s | 0.629 MB/s | -0.2% | -9.5% |
| bs=1000 sw=10 sl=64 | p50 | 1,071,173 us | 1,073,902 us | 991,882 us | -0.3% | +8.0% |
| bs=1000 sw=10 sl=64 | p95 | 1,109,503 us | 1,168,730 us | 1,038,496 us | -5.1% | +6.8% |
| bs=1000 sw=10 sl=64 | p99 | 1,109,503 us | 1,168,730 us | 1,068,265 us | -5.1% | +3.9% |
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,538.00,200,128000,372,0.227,25657.24,37043.22,37043.22
1,100,10,64,20,2511.68,2000,1280000,796,0.486,124728.57,160867.43,160867.43
2,1000,10,64,20,21438.56,20000,12800000,933,0.569,1071172.73,1109502.64,1109502.64
What changes were proposed in this PR?
When the
zero-shot-image-classificationtask ran without at least 2 candidate labels, the operator raised the error from inside the per-row loop, so it crashed mid-run instead of failing cleanly. This moves the check up front, alongside the operator's other config validations, so it fails fast with a clear message before any rows are processed.Labels now come from the Candidate Labels field only (matching the text
zero-shot-classificationtask); the old fallback that read labels from the prompt column is removed.Any related issues?
Closes #7199 (the Part B follow-up to #7297, which addressed the same issue).
How was this PR tested?
Unit tests + the generated-Python compile check, plus a quick headless run of the generated operator: with 0 labels it now raises a clear "requires at least 2 Candidate Labels" error before the loop; with 2+ labels it proceeds normally.
Was this PR authored or co-authored using generative AI tooling?
Yes, this PR was co-authored with Claude in compliance with ASF policy.