MoonshotAI / MoonshotAI/checkpoint-engine

Make GPU/NPU test collection safe on CPU-only hosts

Open
#95 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1k
Forks
107
Avg merge
7d 13h
Merged PRs (30d)
3

Description

Summary

Some GPU/NPU test modules perform device setup at import time. On CPU-only hosts, full pytest collection can fail before markers such as -m "not gpu" have a chance to deselect those tests.

Why this matters

CPU-only CI and local development should be able to collect and run the CPU test suite without initializing CUDA/NPU runtime state. Import-time device setup also makes failures harder to diagnose because collection fails before the test body runs.

Suggested fix

  • Avoid creating DeviceManager() or similar accelerator-dependent objects at module import time in test files.
  • Move accelerator setup into GPU-marked test functions or fixtures.
  • Skip inside those fixtures when the required accelerator runtime is unavailable.
  • Verify that pytest tests/ -m "not gpu" can collect and run on CPU-only hosts.

Expected outcome

CPU-only test runs should be able to execute non-GPU tests without CUDA/NPU initialization side effects during collection.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with pytest tests/ -m "not gpu" on a CPU-only host, then inspect test modules under tests/ for DeviceManager or other accelerator-dependent setup performed during import. Move that setup into GPU-marked tests or fixtures, skip when the runtime is unavailable, and confirm non-GPU collection and execution no longer initialize CUDA/NPU state.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.