[Maintain][Manifest] flip Var/Std/VarMean fwd ops to status: implemented#1430
Conversation
|
/gemini review |
There was a problem hiding this comment.
Pull request overview
This PR aligns the reduction manifest with the already-landed implementation and conformance coverage by promoting the variance-family forward ops (VarFwdOp, StdFwdOp, VarMeanFwdOp) from status: spec-only to status: implemented in tileops/manifest/reduction.yaml.
Changes:
- Flip
VarFwdOpmanifest status toimplemented. - Flip
StdFwdOpmanifest status toimplemented. - Flip
VarMeanFwdOpmanifest status toimplemented.
There was a problem hiding this comment.
Code Review
This pull request updates the status of VarFwdOp, StdFwdOp, and VarMeanFwdOp to implemented in the reduction manifest. However, several issues were identified in the underlying implementation: an AttributeError in roofline calculations due to incorrect dtype attribute access, incorrect handling of empty dimension lists in shape rules, and potential runtime errors related to non-contiguous tensor reshaping and type handling for dimension info.
| ref_api: "torch.var" | ||
| family: reduction | ||
| status: spec-only # dim=None not yet implemented; update when impl lands | ||
| status: implemented |
There was a problem hiding this comment.
While flipping the status to implemented is correct, I noticed a bug in the underlying implementation that will affect these ops. In tileops/ops/reduction/reduce.py, the eval_roofline method (line 180) attempts to access self.dtype.itemsize. However, torch.dtype objects do not have an itemsize attribute; the correct method is element_size(). This will cause an AttributeError when calculating roofline metrics for these newly implemented ops.
There was a problem hiding this comment.
Verified false positive. torch.dtype.itemsize has existed since torch 2.1, and pyproject.toml pins torch>=2.1.0,<2.11.0. Local check on torch 2.9.1: torch.float16.itemsize == 2, torch.int64.itemsize == 8 — no AttributeError. No fix needed.
There was a problem hiding this comment.
Code Review
This pull request updates the status of VarFwdOp, StdFwdOp, and VarMeanFwdOp from spec-only to implemented in the reduction manifest, indicating that these operations (torch.var, torch.std, and torch.var_mean) are now fully supported. I have no feedback to provide as there were no review comments.
Ibuki-wind
left a comment
There was a problem hiding this comment.
Overall
The status flips are blocked because default construction still reduces the last axis while the manifest contract says dim=None full reduction.
|
Reviewer-feedback verification summary After re-reading every comment on PRs #1428 / #1430 / #1431 and running targeted checks, the verified picture is:
Plan:
Detailed per-comment verdicts are posted as inline replies on each thread. |
2f0c5c2 to
b7b0d27
Compare
Ibuki-wind
left a comment
There was a problem hiding this comment.
Overall
The status flip overclaims implementation conformance; scalar input support is still missing for the flipped PyTorch variance reduction APIs.
b7b0d27 to
e048b8c
Compare
Ibuki-wind
left a comment
There was a problem hiding this comment.
Overall
These flips are still ahead of the implementation: the shared reduction base rejects 0-D tensors, but torch.var / torch.std / torch.var_mean accept scalar inputs and return 0-D outputs.
Op implementations (incl. dim=None full reduction) and conformance tests are in place; promote the three Welford reductions from spec-only to implemented and drop the now-stale "not yet implemented" comments. Co-Authored-By: Ibuki 🍃 — a wind born from GPTs <[email protected]>
e048b8c to
3dd3edd
Compare
…mented (#1431) Closes #1401 ## Summary - Flip `AllFwdOp`, `AnyFwdOp`, `CountNonzeroFwdOp` from `status: spec-only` to `status: implemented` in `tileops/manifest/reduction.yaml`. - Single-file manifest-only change; no signature/roofline/workloads/shape_rules edits. ## Context Third of a sibling set: - #1428 — issue #1399, Sum/Mean/Amax/Amin. - #1430 — issue #1400, Var/Std/VarMean. - This PR — issue #1401, All/Any/CountNonzero. After all three merge, the remaining 7 spec-only reduction ops flip to `implemented`, bringing the reduction family to 19/19 `status: implemented`. ## Note on AC-5 AC-5 in the linked issue says "All 13 reduction.yaml ops are status: implemented after merge." The literal count is stale — `reduction.yaml` currently holds 19 ops (12 already `implemented` on `upstream/main`, 7 `spec-only` before this sibling set). The substantive intent — "reduction family fully implemented after merge" — is satisfied once #1428, #1430, and this PR all land. ## Test plan - [x] AC-1: `tileops/manifest/reduction.yaml` shows `status: implemented` for AllFwdOp, AnyFwdOp, CountNonzeroFwdOp. - [x] AC-2: `python scripts/validate_manifest.py` exits 0. - [x] AC-3: `pytest tests/test_validate_manifest.py` passes. - [x] AC-4: PR diff touches only `tileops/manifest/reduction.yaml` (3 lines changed). - [x] AC-5: Reduction family fully `implemented` after the three sibling PRs merge (literal "13" is a stale count; see note above). Co-authored-by: Ibuki 🍃 — a wind born from GPTs <[email protected]>
Closes #1400
Summary
VarFwdOp,StdFwdOp,VarMeanFwdOpfromstatus: spec-onlytostatus: implementedintileops/manifest/reduction.yaml.Context
The issue body references impl PR
#1397, which does not exist. The actual implementation already landed onmain:dim=Nonesupport via [Feat][Reduction] Support dim=None in all reduction ops for full reduction #834.dim×correctionconformance coverage via [Test][Reduction] add var/std/var_mean conformance across dim x correction #1406.This PR is the spec-side flip aligning manifest status with the already-merged implementation and conformance tests.
Test plan
tileops/manifest/reduction.yamlshowsstatus: implementedforVarFwdOp,StdFwdOp,VarMeanFwdOp.python scripts/validate_manifest.pyexits 0 (All manifest checks passed.).pytest tests/test_validate_manifest.pypasses (218 passed, 3 warnings).tileops/manifest/reduction.yaml(+3 / -3).