Skip to content

Add mcoplib mcoplib unit test matrix#57

Open
ghangz wants to merge 2 commits into
MetaX-MACA:mainfrom
ghangz:mengz/mcoplib-unit-test-matrix
Open

Add mcoplib mcoplib unit test matrix#57
ghangz wants to merge 2 commits into
MetaX-MACA:mainfrom
ghangz:mengz/mcoplib-unit-test-matrix

Conversation

@ghangz

@ghangz ghangz commented Jul 1, 2026

Copy link
Copy Markdown

Summary

  • Adds a focused mcoplib unit test matrix improvement for MetaX-MACA/mcoplib.
  • The change targets MetaX MACA development and validation workflows, with emphasis on earlier diagnostics, reproducible logs, or safer benchmark tooling.
  • Existing default behavior is kept compatible; the new logic is scoped to explicit checks, helper tools, or validation metadata.

Validation

  • Verified on Gitee.AI MetaX GPU resources: mcoplib_McFlashInfer_TileLang_20260701, mcoplib and McFlashInfer batch 18/18 PASS.
  • Branch validation command: python tools/unit_test_matrix.py --self-test
  • Pull request text is intentionally ASCII-only to avoid encoding issues on web forms and API clients.

Review notes

  • Source branch: ghangz:mengz/mcoplib-unit-test-matrix
  • Target branch: MetaX-MACA/mcoplib:main
  • Maintainers can modify this branch if follow-up adjustments are needed.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces a new Python script, tools/unit_test_matrix.py, which generates a reproducible validation matrix for MACA GPU testing based on test names, data types, and scopes. The feedback suggests replacing the assert statements in the self-test function with explicit conditional checks and raising exceptions, as assertions can be optimized out and ignored when Python is run with optimization flags.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread tools/unit_test_matrix.py Outdated
Comment on lines +29 to +30
assert rows
assert "test" in rows[0]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Using assert statements for validation or control flow in production/tooling code is discouraged. When Python is run with optimization flags (such as python -O), all assert statements are compiled out and ignored. This would cause the self-test to report success even if the validation checks fail.\n\nInstead, use explicit conditional checks and raise an appropriate exception (e.g., ValueError or RuntimeError).

    if not rows:\n        raise RuntimeError("Self-test failed: build_matrix returned no rows.")\n    if "test" not in rows[0]:\n        raise RuntimeError("Self-test failed: 'test' key missing in the generated matrix row.")

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