Skip to content

Add mcoplib mcoplib kernel inventory JSON#54

Open
ghangz wants to merge 2 commits into
MetaX-MACA:mainfrom
ghangz:mengz/mcoplib-kernel-inventory-json
Open

Add mcoplib mcoplib kernel inventory JSON#54
ghangz wants to merge 2 commits into
MetaX-MACA:mainfrom
ghangz:mengz/mcoplib-kernel-inventory-json

Conversation

@ghangz

@ghangz ghangz commented Jul 1, 2026

Copy link
Copy Markdown

Summary

  • Adds a focused mcoplib kernel inventory JSON 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/kernel_inventory.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-kernel-inventory-json
  • 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/kernel_inventory.py, which generates a JSON inventory of kernel files matching specific glob patterns. The feedback suggests adding validation for the --root directory argument to ensure it exists and is a directory, preventing silent failures with a 0 exit code when an invalid path is provided.

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/kernel_inventory.py
Comment on lines +38 to +43
args = parser.parse_args()
if args.self_test:
self_test()
return 0
print(json.dumps(inventory(Path(args.root)), ensure_ascii=False, indent=2))
return 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

If an invalid or non-existent path is provided to --root, the script currently silently succeeds, returning an empty inventory with a 0 exit code. This can lead to silent failures in CI/CD or validation workflows if the path is misconfigured.

Using parser.error() to validate that the specified root path exists and is a directory provides a clear error message on stderr and exits with a non-zero status code.

Suggested change
args = parser.parse_args()
if args.self_test:
self_test()
return 0
print(json.dumps(inventory(Path(args.root)), ensure_ascii=False, indent=2))
return 0
args = parser.parse_args()
if args.self_test:
self_test()
return 0
root_path = Path(args.root)
if not root_path.is_dir():
parser.error(f"The specified root path '{args.root}' is not a directory.")
print(json.dumps(inventory(root_path), ensure_ascii=False, indent=2))
return 0

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