Skip to content

Add vLLM-metax vllm metax cmake presets build type#302

Open
ghangz wants to merge 2 commits into
MetaX-MACA:masterfrom
ghangz:mengz/vllm-metax-cmake-presets-build-type
Open

Add vLLM-metax vllm metax cmake presets build type#302
ghangz wants to merge 2 commits into
MetaX-MACA:masterfrom
ghangz:mengz/vllm-metax-cmake-presets-build-type

Conversation

@ghangz

@ghangz ghangz commented Jul 1, 2026

Copy link
Copy Markdown

Summary

  • Adds a focused vllm metax cmake presets build type improvement for MetaX-MACA/vLLM-metax.
  • 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: vLLM-metax_vLLM image batch, 10/10 PASS; PyTorch-MACA batch also covered vLLM-metax runtime tools.
  • Branch validation command: python -m pytest tests/tools/test_generate_cmake_presets_build_type.py
  • Pull request text is intentionally ASCII-only to avoid encoding issues on web forms and API clients.

Review notes

  • Source branch: ghangz:mengz/vllm-metax-cmake-presets-build-type
  • Target branch: MetaX-MACA/vLLM-metax:master
  • 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
Contributor

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 adds support for specifying a custom CMake build type (such as Debug, Release, RelWithDebInfo, or MinSizeRel) when generating CMake presets, both programmatically and via a new --build-type CLI argument. A new test has been added to verify this functionality. The review feedback points out that mocking os.path.exists globally in the test can cause side effects and suggests creating a dummy compiler file within the tmp_path directory instead.

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 +9 to +10
monkeypatch.setattr(presets, "CUDA_HOME", str(tmp_path))
monkeypatch.setattr(presets.os.path, "exists", lambda path: True)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

Mocking os.path.exists globally on the os.path module (via presets.os.path) has global side effects because os.path is a shared module across the entire Python process. Any other test, fixture, or pytest teardown process that calls os.path.exists during this test's execution will receive True, which can lead to flaky tests, unexpected failures, or cleanup issues.

Instead of mocking os.path.exists, we can leverage the tmp_path fixture to create a dummy nvcc file at the expected path (tmp_path / "bin" / "nvcc"). This allows the real os.path.exists to return True naturally for the compiler check, while avoiding any global side effects and keeping the test clean and robust.

Suggested change
monkeypatch.setattr(presets, "CUDA_HOME", str(tmp_path))
monkeypatch.setattr(presets.os.path, "exists", lambda path: True)
monkeypatch.setattr(presets, "CUDA_HOME", str(tmp_path))
nvcc_path = tmp_path / "bin" / "nvcc"
nvcc_path.parent.mkdir(parents=True, exist_ok=True)
nvcc_path.touch()

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