Skip to content

Fix no-golden TS rows: feed golden a 0-dim tensor scalar#13

Merged
Aswinmcw merged 1 commit into
mainfrom
fix-ts-no-golden
Jul 3, 2026
Merged

Fix no-golden TS rows: feed golden a 0-dim tensor scalar#13
Aswinmcw merged 1 commit into
mainfrom
fix-ts-no-golden

Conversation

@Aswinmcw

@Aswinmcw Aswinmcw commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

Follow-up to the tensor-scalar (TS) variants work. The TS path passed a python scalar to both the device op and the torch golden, but several goldens reject a python scalar 2nd operand, so call_golden returned None and 605 rows were reported as no-golden (accuracy not measured).

Affected ops (all <op> TS): maximum, minimum, logical_and/or/xor (+ in-place), ldexp (+ in-place), logaddexp, logaddexp2 (+ in-place), div_no_nan.

Fix

Feed the golden a 0-dim tensor of the scalar (torch.tensor(s, dtype=int32/float32)); the device op still receives the python scalar. torch broadcasts a 0-dim tensor identically, so those goldens now evaluate.

Impact

  • All 605 no-golden TS rows now produce real pass/fail + PCC.
  • TT rows and already-working TS rows are unchanged (golden value identical for scalar vs 0-dim tensor).

Test plan

  • Sim (bfloat16/tile/dram): maximum/minimum/logaddexp/ldexp/logical_and/div_no_nan TS now report pass/PCC; 0 no-golden rows remain.
  • add TS unchanged.

Made with Cursor

The tensor-scalar path passed a python scalar to both the device op and the
torch golden. Several goldens (maximum, minimum, logical_and/or/xor, ldexp,
logaddexp/2, div_no_nan and their in-place forms) reject a python scalar 2nd
operand, so call_golden returned None -> 605 rows reported "no-golden".

Feed the golden a 0-dim tensor of the scalar instead (device still gets the
python scalar); torch broadcasts it identically. All 605 no-golden TS rows
now produce real pass/fail measurements; TT rows are unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Aswinmcw Aswinmcw requested review from a team and Aswin-coder as code owners July 3, 2026 10:36
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 3, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
ttnn-ops-coverage cb58cfb Commit Preview URL

Branch Preview URL
Jul 03 2026, 10:36 AM

@Aswincloud-Bot Aswincloud-Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Auto-approved: @Aswinmcw is a member of @Aswincloud/admins.

@Aswinmcw Aswinmcw added this pull request to the merge queue Jul 3, 2026
Merged via the queue into main with commit acb999d Jul 3, 2026
5 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.

2 participants