Skip to content

Add mcTVM mctvm build artifact manifest - #33

Open
ghangz wants to merge 2 commits into
MetaX-MACA:devfrom
ghangz:mengz/mctvm-build-artifact-manifest
Open

Add mcTVM mctvm build artifact manifest#33
ghangz wants to merge 2 commits into
MetaX-MACA:devfrom
ghangz:mengz/mctvm-build-artifact-manifest

Conversation

@ghangz

@ghangz ghangz commented Jul 1, 2026

Copy link
Copy Markdown

Summary

  • Adds a focused mctvm build artifact manifest improvement for MetaX-MACA/mcTVM.
  • 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: mctvm_TileLang_20260701, 6/6 PASS.
  • Branch validation command: python tools/maca_artifact_manifest.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/mctvm-build-artifact-manifest
  • Target branch: MetaX-MACA/mcTVM:dev
  • 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/maca_artifact_manifest.py, designed to generate a reproducible artifact manifest containing file sizes and SHA-256 hashes. Feedback on the implementation suggests validating that the provided root path exists and is a directory to avoid silent failures, and replacing the assert statement in the self-test function with an explicit runtime check to ensure it is not bypassed 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 on lines +22 to +23
def collect(root: Path) -> dict[str, object]:
seen: set[str] = set()

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

The collect function does not validate whether the provided root path exists and is a directory. If an invalid or misspelled path is passed, root.glob() will silently return an empty list, producing an empty manifest without any warning or error. This can lead to hard-to-detect failures in CI/CD pipelines. Consider validating that root is an existing directory before proceeding.

def collect(root: Path) -> dict[str, object]:
    if not root.is_dir():
        raise FileNotFoundError(f"The root path '{root}' does not exist or is not a directory.")
    seen: set[str] = set()

Comment thread tools/maca_artifact_manifest.py Outdated
sample.write_text("maca artifact\n", encoding="utf-8")
try:
data = collect(Path.cwd())
assert any(item["path"] == sample.name for item in data["artifacts"])

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

Avoid using assert statements for runtime validation or self-tests in executable scripts. When Python is run with optimization flags (e.g., python -O), all assert statements are compiled away and ignored, which would cause this self-test to silently pass even if the validation fails. Use an explicit if condition and raise an exception (such as RuntimeError) instead.

Suggested change
assert any(item["path"] == sample.name for item in data["artifacts"])
if not any(item["path"] == sample.name for item in data["artifacts"]):
raise RuntimeError("Self-test failed: sample artifact not found in manifest")

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