Skip to content

fix(workflow-operator): validate zero-shot-image-classification labels before running - #7585

Open
PG1204 wants to merge 2 commits into
apache:mainfrom
PG1204:fix/hf-zero-shot-image-labels
Open

fix(workflow-operator): validate zero-shot-image-classification labels before running#7585
PG1204 wants to merge 2 commits into
apache:mainfrom
PG1204:fix/hf-zero-shot-image-labels

Conversation

@PG1204

@PG1204 PG1204 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

When the zero-shot-image-classification task 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-classification task); 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.

@PG1204

PG1204 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

/request-review @xuang7

@github-actions

Copy link
Copy Markdown
Contributor

Backport auto-label report

This fix: PR was checked against each actively-supported release branch. release/* labels drive the post-merge backport, so add or remove one to change where this fix lands.

Release branch Analysis
⚠️ release/v1.2 Not labeled automatically — none of the files this PR modifies exist on this branch (common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/huggingFace/codegen/HuggingFaceCodegenBase.scala, common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/huggingFace/codegen/ImageTaskCodegen.scala, common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/huggingFace/HuggingFaceInferenceOpDescSpec.scala, common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/huggingFace/codegen/ImageTaskCodegenSpec.scala). The fix may target code that isn't on this release, or the files were moved/renamed after the branch was cut. Please check and add release/v1.2 by hand if this fix should be backported here.

Auto-label run.

@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • No candidates found from git blame history.

@github-actions
github-actions Bot requested a review from xuang7 August 12, 2026 04:30
@codecov-commenter

codecov-commenter commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.45%. Comparing base (408b33a) to head (01fb308).

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           
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø)
agent-service 98.62% <ø> (ø) Carriedforward from 408b33a
amber 84.25% <ø> (ø) Carriedforward from 408b33a
computing-unit-managing-service 60.38% <ø> (ø)
config-service 77.31% <ø> (ø)
file-service 69.05% <ø> (ø)
frontend 89.95% <ø> (ø) Carriedforward from 408b33a
notebook-migration-service 78.89% <ø> (ø)
pyamber 97.52% <ø> (ø) Carriedforward from 408b33a
workflow-compiling-service 57.89% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

🟢 2 better · 🔴 8 worse · ⚪ 5 noise (<±5%) · 0 without baseline

Compared against main 408b33a benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HuggingFace inference operator: inconsistent input validation, asserts vs a per-row ValueError that crashes the operator

2 participants