Skip to content

test: add maximum operator coverage#770

Open
voltjia wants to merge 1 commit into
masterfrom
test/maximum-operator-coverage
Open

test: add maximum operator coverage#770
voltjia wants to merge 1 commit into
masterfrom
test/maximum-operator-coverage

Conversation

@voltjia

@voltjia voltjia commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds handwritten maximum operator coverage in tests/test_maximum.py.
  • Covers contiguous and strided inputs/outputs across float32, float16, and bfloat16.

Motivation

Generated smoke coverage confirms the PyTorch backend path is wired, but it does not provide focused per-operator correctness coverage. This PR adds a dedicated maximum test following the existing operator-test style.

Closes N/A

Type of Change

  • feat — new feature / new operator / new platform
  • fix — bug fix
  • perf — performance improvement (no behavioral change)
  • refactor — code restructuring without behavior change
  • test — adding or fixing tests only
  • docs — documentation only
  • build / ci — build system or CI configuration
  • chore — tooling, formatting, or other non-code changes
  • Breaking change (requires a ! in the Conventional Commits prefix or a BREAKING CHANGE: footer)

Platforms Affected

  • CPU (WITH_CPU)
  • NVIDIA (WITH_NVIDIA)
  • Iluvatar (WITH_ILUVATAR)
  • MetaX (WITH_METAX)
  • Cambricon (WITH_CAMBRICON)
  • Moore (WITH_MOORE)
  • Ascend (WITH_ASCEND)
  • PyTorch C++ bindings (WITH_TORCH)
  • Build system / CMake / CI
  • Python bindings / user-facing API

Smoke Test Result

ruff format --check tests/test_maximum.py tests/test_minimum.py tests/test_addcmul.py tests/test_addcdiv.py
4 files already formatted

ruff check tests/test_maximum.py tests/test_minimum.py tests/test_addcmul.py tests/test_addcdiv.py
All checks passed!

Cross-platform cropped smoke validation:
python3 -m pytest tests/test_maximum.py tests/test_minimum.py tests/test_addcmul.py tests/test_addcdiv.py -q -v --devices <cpu + platform>
138 passed, 6 skipped

Test Results on Supported Platforms

Platform Affected Build / Smoke Result Full Result / Notes
NVIDIA Yes passed; build 158s, test 7s, total 165s 138 passed, 6 skipped
Iluvatar Yes passed; build 149s, test 4s, total 153s 138 passed, 6 skipped
MetaX Yes passed; build 242s, test 15s, total 258s 138 passed, 6 skipped
Cambricon Yes passed; build 338s, test 10s, total 348s 138 passed, 6 skipped
Moore Yes passed; build 336s, test 21s, total 357s 138 passed, 6 skipped
Ascend Yes pytest passed; build 195s, test 14s, total 209s 138 passed, 6 skipped; container exit code was 137 after pytest summary, consistent with prior Ascend runs
Full `pytest` output (optional)
NVIDIA:    tests/test_maximum.py + tests/test_minimum.py + tests/test_addcmul.py + tests/test_addcdiv.py: 138 passed, 6 skipped in 2.58s
Iluvatar:  tests/test_maximum.py + tests/test_minimum.py + tests/test_addcmul.py + tests/test_addcdiv.py: 138 passed, 6 skipped in 0.80s
MetaX:     tests/test_maximum.py + tests/test_minimum.py + tests/test_addcmul.py + tests/test_addcdiv.py: 138 passed, 6 skipped in 0.71s
Cambricon: tests/test_maximum.py + tests/test_minimum.py + tests/test_addcmul.py + tests/test_addcdiv.py: 138 passed, 6 skipped in 3.93s
Moore:     tests/test_maximum.py + tests/test_minimum.py + tests/test_addcmul.py + tests/test_addcdiv.py: 138 passed, 6 skipped in 14.23s
Ascend:    tests/test_maximum.py + tests/test_minimum.py + tests/test_addcmul.py + tests/test_addcdiv.py: 138 passed, 6 skipped in 2.27s

Benchmark / Performance Impact

N/A - test-only change.

Notes for Reviewers

The six skipped cases are from the batch companion addcdiv test: PyTorch addcdiv.out does not support float16 on CPU, so those CPU/PyTorch-backend cases are skipped explicitly.

@voltjia voltjia requested a review from a team June 26, 2026 09:33
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.

1 participant