Skip to content

Add add-op-overload agent skill - #200671

Closed
ezyang wants to merge 2 commits into
gh/ezyang/3617/basefrom
gh/ezyang/3617/head
Closed

ezyang wants to merge 2 commits into
gh/ezyang/3617/basefrom
gh/ezyang/3617/head

Conversation

@ezyang

@ezyang ezyang commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

Add a checklist skill for adding a new overload to an existing ATen op
in native_functions.yaml. It collects the steps that are easy to miss
and expensive to discover late:

  • C++ overload resolution: kwarg-only arguments are flattened into
    positional parameters, so a new str argument makes existing calls like
    at::addmm_out(out, self, m1, m2, 0, 1) ambiguous, and a bool/int
    argument silently rebinds them; fix with cpp_no_default_args.
  • Per-overload tables that the base op's entries don't cover: autocast
    lists, derivatives.yaml, vmap batch rules, Conjugate fallthroughs,
    DTensor sharding strategies.
  • Python registrations on an OpOverloadPacket (meta, decompositions,
    Inductor lowerings) that silently capture the new overload, and the
    make_fallback ordering in Inductor's lowering.py.

@pytorch-bot

pytorch-bot Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

PR Status: Approved 🚀

Please fix all CI failures and trigger merge by commenting "@pytorchbot merge".

✅ AUTOMATED REVIEW - Ready for human review:

Docs-only PR adding an agent skill (.agents/skills/add-op-overload/SKILL.md)
with a checklist for adding overloads to existing ATen ops. Its concrete claims
(out_dtype precedents, cpp_no_default_args, autocast macro lists, VMAP/conj
tables, packet-registration expansion, Inductor make_fallback ordering, DTensor
fallback, HasDecomp expect test, unittest -k behavior) were checked against the
tree and hold; frontmatter matches sibling skills and no registry needs
updating. No maintainer comments are outstanding.

Reviewed commit: 0f636ee

Review run

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/200671

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 0f636ee with merge base 44a629b (image):
💚 Looks good so far! There are no failures yet. 💚

🟡 GREEN LIGHT - PR requires human review:

  • Never trivial: pytorch skills tree
    • Adds .agents/skills/add-op-overload/SKILL.md, a new agent skill under pytorch's skills tree
    • .lintrunner.toml describes .claude/skills as a symlink to .agents/skills, so this edits the .claude/ skills that agents load as instructions
  • Content needs expert review
    • Prescribes ATen codegen, autocast, autograd, Inductor and DTensor steps (e.g. cpp_no_default_args, make_fallback ordering); a maintainer should check they are accurate

reason: not_trivial
Reviewed commit: 0f636ee

Inference job

🐛 Report a wrong verdict

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot Bot added the topic: not user facing topic category label Oct 12, 2026
…t.h from generated per-op headers

[ghstack-poisoned]
@ezyang

ezyang commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

From a skim, maybe this is overly wordy but it seems OK. The prompt grounded this on "focus on things that made things take a long time / many tokens in the transcript"

@ezyang
ezyang requested review from albanD and drisspg October 12, 2026 20:48
@ezyang
ezyang marked this pull request as ready for review October 12, 2026 20:48
ezyang added a commit that referenced this pull request Oct 12, 2026
ezyang added a commit that referenced this pull request Oct 12, 2026
ezyang added a commit that referenced this pull request Oct 13, 2026
Add a checklist skill for adding a new overload to an existing ATen op
in native_functions.yaml. It collects the steps that are easy to miss
and expensive to discover late:

- C++ overload resolution: kwarg-only arguments are flattened into
  positional parameters, so a new str argument makes existing calls like
  at::addmm_out(out, self, m1, m2, 0, 1) ambiguous, and a bool/int
  argument silently rebinds them; fix with cpp_no_default_args.
- Per-overload tables that the base op's entries don't cover: autocast
  lists, derivatives.yaml, vmap batch rules, Conjugate fallthroughs,
  DTensor sharding strategies.
- Python registrations on an OpOverloadPacket (meta, decompositions,
  Inductor lowerings) that silently capture the new overload, and the
  make_fallback ordering in Inductor's lowering.py.

ghstack-source-id: 5155757
Pull-Request: #200671
@pytorchbot pytorchbot added the in progress PR is being worked on by the author, until the automated review accepts it label Oct 16, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated review of 0f636ee: nothing blocking; ready for human review.

Docs-only PR adding an agent skill (.agents/skills/add-op-overload/SKILL.md) with a checklist for adding overloads to existing ATen ops. Its concrete claims (out_dtype precedents, cpp_no_default_args, autocast macro lists, VMAP/conj tables, packet-registration expansion, Inductor make_fallback ordering, DTensor fallback, HasDecomp expect test, unittest -k behavior) were checked against the tree and hold; frontmatter matches sibling skills and no registry needs updating. No maintainer comments are outstanding.

This review is AI-generated and advisory. Each new automated review replaces the previous one.

@pytorch-bot pytorch-bot Bot added ready for review Automated review passed, ready for a final review by a maintainer. and removed in progress PR is being worked on by the author, until the automated review accepts it labels Oct 16, 2026
@ezyang

ezyang commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 18, 2026
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

majing921201 pushed a commit to majing921201/pytorch that referenced this pull request Nov 16, 2026
Add a checklist skill for adding a new overload to an existing ATen op
in native_functions.yaml. It collects the steps that are easy to miss
and expensive to discover late:

- C++ overload resolution: kwarg-only arguments are flattened into
  positional parameters, so a new str argument makes existing calls like
  at::addmm_out(out, self, m1, m2, 0, 1) ambiguous, and a bool/int
  argument silently rebinds them; fix with cpp_no_default_args.
- Per-overload tables that the base op's entries don't cover: autocast
  lists, derivatives.yaml, vmap batch rules, Conjugate fallthroughs,
  DTensor sharding strategies.
- Python registrations on an OpOverloadPacket (meta, decompositions,
  Inductor lowerings) that silently capture the new overload, and the
  make_fallback ordering in Inductor's lowering.py.
Pull Request resolved: pytorch#200671
Approved by: https://github.com/drisspg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged ready for review Automated review passed, ready for a final review by a maintainer. topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants